#include <OgreMeshManager.h>
Inheritance diagram for Ogre::MeshManager:
Public Types | |
typedef std::map< ResourceHandle, Resource * > | ResourceHandleMap |
typedef MapIterator< ResourceHandleMap > | ResourceMapIterator |
Public Methods | |
MeshManager () | |
void | _initialise (void) |
Initialises the manager, only to be called by OGRE internally. | |
Mesh * | load (const String &filename, HardwareBuffer::Usage vertexBufferUsage=HardwareBuffer::HBU_STATIC_WRITE_ONLY, HardwareBuffer::Usage indexBufferUsage=HardwareBuffer::HBU_STATIC_WRITE_ONLY, bool vertexBufferShadowed=true, bool indexBufferShadowed=true, int priority=1) |
Loads a mesh from a file, making it available for use. | |
Resource * | create (const String &name) |
Creates a Mesh resource. | |
Mesh * | createManual (const String &name) |
Creates a new Mesh specifically for manual definition rather than loading from an object file. | |
Mesh * | createPlane (const String &name, const Plane &plane, Real width, Real height, int xsegments=1, int ysegments=1, bool normals=true, int numTexCoordSets=1, Real uTile=1.0f, Real vTile=1.0f, const Vector3 &upVector=Vector3::UNIT_Y, HardwareBuffer::Usage vertexBufferUsage=HardwareBuffer::HBU_STATIC_WRITE_ONLY, HardwareBuffer::Usage indexBufferUsage=HardwareBuffer::HBU_STATIC_WRITE_ONLY, bool vertexShadowBuffer=true, bool indexShadowBuffer=true) |
Creates a basic plane, by default majoring on the x/y axes facing positive Z. | |
Mesh * | createCurvedIllusionPlane (const String &name, const Plane &plane, Real width, Real height, Real curvature, int xsegments=1, int ysegments=1, bool normals=true, int numTexCoordSets=1, Real uTile=1.0f, Real vTile=1.0f, const Vector3 &upVector=Vector3::UNIT_Y, const Quaternion &orientation=Quaternion::IDENTITY, HardwareBuffer::Usage vertexBufferUsage=HardwareBuffer::HBU_STATIC_WRITE_ONLY, HardwareBuffer::Usage indexBufferUsage=HardwareBuffer::HBU_STATIC_WRITE_ONLY, bool vertexShadowBuffer=true, bool indexShadowBuffer=true, int ySegmentsToKeep=-1) |
Creates a plane, which because of it's texture coordinates looks like a curved surface, useful for skies in a skybox. | |
Mesh * | createCurvedPlane (const String &name, const Plane &plane, Real width, Real height, Real bow=0.5f, int xsegments=1, int ysegments=1, bool normals=false, int numTexCoordSets=1, Real xTile=1.0f, Real yTile=1.0f, const Vector3 &upVector=Vector3::UNIT_Y, HardwareBuffer::Usage vertexBufferUsage=HardwareBuffer::HBU_STATIC_WRITE_ONLY, HardwareBuffer::Usage indexBufferUsage=HardwareBuffer::HBU_STATIC_WRITE_ONLY, bool vertexShadowBuffer=true, bool indexShadowBuffer=true) |
Creates a genuinely curved plane, by default majoring on the x/y axes facing positive Z. | |
PatchMesh * | createBezierPatch (const String &name, void *controlPointBuffer, VertexDeclaration *declaration, size_t width, size_t height, size_t uMaxSubdivisionLevel=PatchSurface::AUTO_LEVEL, size_t vMaxSubdivisionLevel=PatchSurface::AUTO_LEVEL, PatchSurface::VisibleSide visibleSide=PatchSurface::VS_FRONT, HardwareBuffer::Usage vbUsage=HardwareBuffer::HBU_STATIC_WRITE_ONLY, HardwareBuffer::Usage ibUsage=HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, bool vbUseShadow=true, bool ibUseShadow=true) |
Creates a Bezier patch based on an array of control vertices. | |
void | setPrepareAllMeshesForShadowVolumes (bool enable) |
Tells the mesh manager that all future meshes should prepare themselves for shadow volumes on loading. | |
bool | getPrepareAllMeshesForShadowVolumes (void) |
Retrieves whether all Meshes should prepare themselves for shadow volumes. | |
Real | MeshManager::getBoundsPaddingFactor (void) |
void | MeshManager::setBoundsPaddingFactor (Real paddingFactor) |
virtual void | setMemoryBudget (size_t bytes) |
Set a limit on the amount of memory this resource handler may use. | |
virtual void | load (Resource *res, int priority) |
Load a resource. | |
virtual void | add (Resource *res) |
Add a resource to this manager; normally only done by subclasses. | |
virtual void | unload (Resource *res) |
Unloads a Resource from the managed resources list, calling it's unload() method. | |
virtual void | unloadAndDestroyAll (void) |
Unloads all Resources from memory. | |
virtual Resource * | getByName (const String &name) |
Retrieves a pointer to a resource by name, or null if the resource does not exist. | |
virtual Resource * | getByHandle (ResourceHandle handle) |
Retrieves a pointer to a resource by handle, or null if the resource does not exist. | |
void | addSearchPath (const String &path) |
Adds a relative path to search for resources of this type. | |
void | addArchiveEx (const String &strName, const String &strDriverName) |
Adds an archive to the search path for this type of resource. | |
bool | _findResourceData (const String &filename, DataChunk &refChunk) |
Internal method, used for locating resource data in the file system / archives. | |
std::set< String > | _getAllNamesLike (const String &startPath, const String &extension) |
Returns a collection of files with the given extension in all resource paths, common and specific to this resource type. | |
ResourceMapIterator | getResourceIterator (void) |
Returns an iterator over all resources in this manager. | |
Static Public Methods | |
MeshManager & | getSingleton (void) |
Override standard Singleton retrieval. | |
MeshManager * | getSingletonPtr (void) |
Override standard Singleton retrieval. | |
void | addCommonSearchPath (const String &path) |
Adds a relative search path for resources of ALL types. | |
void | addCommonArchiveEx (const String &strName, const String &strDriverName) |
Adds an archive to the search path for all resources. | |
std::set< String > | _getAllCommonNamesLike (const String &startPath, const String &extension) |
Returns a collection of files with the given extension in the common resource paths. | |
bool | _findCommonResourceData (const String &filename, DataChunk &refChunk) |
Internal method, used for locating common resource data in the file system / archives. | |
void | cleanupCommonArchive () |
Cleans up the statics 'mCommonVFS' and 'mCommonArchiveFiles'. | |
Protected Types | |
typedef HashMap< String, ArchiveEx * > | FileMap |
typedef HashMap< String, Resource * > | ResourceMap |
Protected Methods | |
void | tesselate2DMesh (SubMesh *pSub, int meshWidth, int meshHeight, bool doubleSided=false, HardwareBuffer::Usage indexBufferUsage=HardwareBuffer::HBU_STATIC_WRITE_ONLY, bool indexSysMem=false) |
Utility method for tesselating 2D meshes. | |
void | createPrefabPlane (void) |
ResourceHandle | getNextHandle (void) |
Allocates the next handle. | |
void | checkUsage (void) |
Checks memory usage and pages out if required. | |
Protected Attributes | |
bool | mPrepAllMeshesForShadowVolumes |
Real | mBoundsPaddingFactor |
FileMap | mArchiveFiles |
ResourceHandleMap | mResourcesByHandle |
ResourceMap | mResources |
ResourceHandle | mNextHandle |
size_t | mMemoryBudget |
size_t | mMemoryUsage |
std::vector< ArchiveEx * > | mVFS |
Collection of searchable ArchiveEx classes (virtual file system) for this resource type. | |
Static Protected Attributes | |
FileMap | mCommonArchiveFiles |
std::vector< ArchiveEx * > | mCommonVFS |
Collection of searchable ArchiveEx classes (virtual file system) for all resource types. | |
MeshManager * | ms_Singleton = 0 |
Definition at line 45 of file OgreMeshManager.h.
|
Definition at line 200 of file OgreResourceManager.h. |
|
Definition at line 208 of file OgreResourceManager.h. |
|
Definition at line 201 of file OgreResourceManager.h. |
|
Definition at line 229 of file OgreResourceManager.h. |
|
Definition at line 54 of file OgreMeshManager.cpp. References mPrepAllMeshesForShadowVolumes. |
|
Internal method, used for locating common resource data in the file system / archives.
Definition at line 294 of file OgreResourceManager.cpp. References Except, Ogre::ResourceManager::mCommonArchiveFiles, Ogre::ResourceManager::mCommonVFS, and Ogre::String. |
|
Internal method, used for locating resource data in the file system / archives.
Definition at line 212 of file OgreResourceManager.cpp. References Except, Ogre::ResourceManager::mArchiveFiles, Ogre::ResourceManager::mCommonArchiveFiles, Ogre::ResourceManager::mCommonVFS, Ogre::ResourceManager::mVFS, and Ogre::String. |
|
Returns a collection of files with the given extension in the common resource paths.
Definition at line 255 of file OgreResourceManager.cpp. References Ogre::ResourceManager::mCommonVFS, Ogre::String, and Ogre::StringVector. |
|
Returns a collection of files with the given extension in all resource paths, common and specific to this resource type.
Definition at line 274 of file OgreResourceManager.cpp. References Ogre::ResourceManager::mVFS, Ogre::String, and Ogre::StringVector. |
|
Initialises the manager, only to be called by OGRE internally.
Definition at line 62 of file OgreMeshManager.cpp. References createPrefabPlane(). |
|
Add a resource to this manager; normally only done by subclasses.
Definition at line 75 of file OgreResourceManager.cpp. References Except, Ogre::Resource::getName(), Ogre::ResourceManager::getNextHandle(), Ogre::Resource::mHandle, Ogre::ResourceManager::mResources, and Ogre::ResourceManager::mResourcesByHandle. Referenced by Ogre::Quake3ShaderManager::create(), Ogre::MaterialManager::create(), createManual(), Ogre::HighLevelGpuProgramManager::createProgram(), and Ogre::ResourceManager::load(). |
|
Adds an archive to the search path for this type of resource.
Definition at line 188 of file OgreResourceManager.cpp. References Ogre::ArchiveEx::getAllNamesLike(), Ogre::ResourceManager::mArchiveFiles, Ogre::ResourceManager::mVFS, Ogre::String, and Ogre::StringVector. Referenced by Ogre::ResourceManager::addSearchPath(). |
|
Adds an archive to the search path for all resources.
Definition at line 200 of file OgreResourceManager.cpp. References Ogre::ArchiveEx::getAllNamesLike(), Ogre::ResourceManager::mCommonArchiveFiles, Ogre::ResourceManager::mCommonVFS, Ogre::String, and Ogre::StringVector. Referenced by Ogre::ResourceManager::addCommonSearchPath(). |
|
Adds a relative search path for resources of ALL types.
This method has the same effect as ResourceManager::addSearchPath, except that the path added applies to ALL resources, not just the one managed by the subclass in question. Definition at line 182 of file OgreResourceManager.cpp. References Ogre::ResourceManager::addCommonArchiveEx(), Ogre::convertPath(), and Ogre::String. |
|
Adds a relative path to search for resources of this type.
Definition at line 176 of file OgreResourceManager.cpp. References Ogre::ResourceManager::addArchiveEx(), Ogre::convertPath(), and Ogre::String. |
|
Checks memory usage and pages out if required.
Definition at line 170 of file OgreResourceManager.cpp. Referenced by Ogre::ResourceManager::setMemoryBudget(). |
|
Cleans up the statics 'mCommonVFS' and 'mCommonArchiveFiles'. Required to reset Ogre, otherwise the containers are left with invalid pointers, which will lead to a crash as soon as one of the ResourceManager implementers (e.g. MaterialManager) initializes. Definition at line 326 of file OgreResourceManager.cpp. References Ogre::ResourceManager::mCommonArchiveFiles, and Ogre::ResourceManager::mCommonVFS. |
|
Creates a Mesh resource.
Implements Ogre::ResourceManager. Definition at line 70 of file OgreMeshManager.cpp. References Ogre::String. Referenced by createManual(), createPrefabPlane(), and load(). |
|
Creates a Bezier patch based on an array of control vertices.
Definition at line 763 of file OgreMeshManager.cpp. References Except, Ogre::ResourceManager::getByName(), Ogre::Mesh::setManuallyDefined(), and Ogre::String. |
|
Creates a plane, which because of it's texture coordinates looks like a curved surface, useful for skies in a skybox.
Definition at line 423 of file OgreMeshManager.cpp. References Ogre::Mesh::_setBoundingSphereRadius(), Ogre::Mesh::_setBounds(), Ogre::VertexDeclaration::addElement(), createManual(), Ogre::Mesh::createSubMesh(), Ogre::Vector3::crossProduct(), Ogre::Plane::d, Except, Ogre::firstTime, Ogre::Matrix3::FromAxes(), Ogre::VertexDeclaration::getVertexSize(), Ogre::Quaternion::Inverse(), Ogre::Vector3::length(), Ogre::Mesh::load(), Ogre::Vector3::makeCeil(), Ogre::Vector3::makeFloor(), Ogre::Plane::normal, Ogre::Vector3::normalise(), Ogre::Real, Ogre::VertexBufferBinding::setBinding(), Ogre::Matrix4::setTrans(), Ogre::Mesh::sharedVertexData, Ogre::Vector3::squaredLength(), Ogre::String, tesselate2DMesh(), Ogre::Resource::touch(), Ogre::SubMesh::useSharedVertices, Ogre::VertexData::vertexBufferBinding, Ogre::VertexData::vertexCount, Ogre::VertexData::vertexDeclaration, Ogre::VES_NORMAL, Ogre::VES_POSITION, Ogre::VES_TEXTURE_COORDINATES, Ogre::VET_FLOAT2, Ogre::VET_FLOAT3, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z. Referenced by Ogre::SceneManager::createSkydomePlane(). |
|
Creates a genuinely curved plane, by default majoring on the x/y axes facing positive Z.
Definition at line 263 of file OgreMeshManager.cpp. References Ogre::Mesh::_setBoundingSphereRadius(), Ogre::Mesh::_setBounds(), Ogre::VertexDeclaration::addElement(), createManual(), Ogre::Mesh::createSubMesh(), Ogre::Vector3::crossProduct(), Ogre::Plane::d, Except, Ogre::Matrix3::FromAxes(), Ogre::Vector3::length(), Ogre::Mesh::load(), Ogre::Vector3::makeCeil(), Ogre::Vector3::makeFloor(), Ogre::Plane::normal, Ogre::Vector3::normalise(), PI, Ogre::Real, Ogre::VertexBufferBinding::setBinding(), Ogre::Matrix4::setTrans(), Ogre::Mesh::sharedVertexData, Ogre::Vector3::squaredLength(), Ogre::String, tesselate2DMesh(), Ogre::Resource::touch(), Ogre::VertexData::vertexBufferBinding, Ogre::VertexData::vertexCount, Ogre::VertexData::vertexDeclaration, Ogre::VertexData::vertexStart, Ogre::VES_NORMAL, Ogre::VES_POSITION, Ogre::VES_TEXTURE_COORDINATES, Ogre::VET_FLOAT2, Ogre::VET_FLOAT3, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z. |
|
Creates a new Mesh specifically for manual definition rather than loading from an object file.
Definition at line 94 of file OgreMeshManager.cpp. References Ogre::ResourceManager::add(), create(), Ogre::ResourceManager::getByName(), Ogre::Mesh::setManuallyDefined(), and Ogre::String. Referenced by createCurvedIllusionPlane(), createCurvedPlane(), and createPlane(). |
|
Creates a basic plane, by default majoring on the x/y axes facing positive Z.
Definition at line 107 of file OgreMeshManager.cpp. References Ogre::Mesh::_setBoundingSphereRadius(), Ogre::Mesh::_setBounds(), Ogre::VertexDeclaration::addElement(), createManual(), Ogre::Mesh::createSubMesh(), Ogre::Vector3::crossProduct(), Ogre::Plane::d, Except, Ogre::firstTime, Ogre::Matrix3::FromAxes(), Ogre::VertexDeclaration::getVertexSize(), Ogre::Vector3::length(), Ogre::Mesh::load(), Ogre::Vector3::makeCeil(), Ogre::Vector3::makeFloor(), Ogre::Plane::normal, Ogre::Vector3::normalise(), Ogre::Real, Ogre::VertexBufferBinding::setBinding(), Ogre::Matrix4::setTrans(), Ogre::Mesh::sharedVertexData, Ogre::Vector3::squaredLength(), Ogre::String, tesselate2DMesh(), Ogre::Resource::touch(), Ogre::SubMesh::useSharedVertices, Ogre::VertexData::vertexBufferBinding, Ogre::VertexData::vertexCount, Ogre::VertexData::vertexDeclaration, Ogre::VES_NORMAL, Ogre::VES_POSITION, Ogre::VES_TEXTURE_COORDINATES, Ogre::VET_FLOAT2, Ogre::VET_FLOAT3, Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z. Referenced by Ogre::SceneManager::createSkyboxPlane(). |
|
|
Retrieves a pointer to a resource by handle, or null if the resource does not exist.
Definition at line 151 of file OgreResourceManager.cpp. References Ogre::ResourceManager::mResourcesByHandle, and Ogre::ResourceHandle. |
|
Retrieves a pointer to a resource by name, or null if the resource does not exist.
Definition at line 139 of file OgreResourceManager.cpp. References Ogre::ResourceManager::mResources, and Ogre::String. Referenced by Ogre::MaterialManager::create(), Ogre::FontManager::create(), createBezierPatch(), createManual(), Ogre::SceneManager::createSkyboxPlane(), Ogre::SceneManager::createSkydomePlane(), Ogre::TextureManager::load(), Ogre::SkeletonManager::load(), load(), Ogre::DynLibManager::load(), Ogre::ArchiveManager::load(), Ogre::SceneManager::setSkyBox(), and Ogre::TextureManager::unload(). |
|
Allocates the next handle.
Definition at line 165 of file OgreResourceManager.cpp. References Ogre::ResourceManager::mNextHandle, and Ogre::ResourceHandle. Referenced by Ogre::ResourceManager::add(). |
|
Retrieves whether all Meshes should prepare themselves for shadow volumes.
Definition at line 792 of file OgreMeshManager.cpp. References mPrepAllMeshesForShadowVolumes. |
|
Returns an iterator over all resources in this manager.
Definition at line 231 of file OgreResourceManager.h. |
|
Override standard Singleton retrieval.
Reimplemented from Ogre::Singleton< MeshManager >. Definition at line 49 of file OgreMeshManager.cpp. References Ogre::Singleton< MeshManager >::ms_Singleton. |
|
Override standard Singleton retrieval.
Reimplemented from Ogre::Singleton< MeshManager >. Definition at line 45 of file OgreMeshManager.cpp. References Ogre::Singleton< MeshManager >::ms_Singleton. |
|
Load a resource. Resources will be subclasses. Reimplemented in Ogre::TextureManager. Definition at line 67 of file OgreResourceManager.cpp. References Ogre::ResourceManager::add(), Ogre::Resource::load(), and Ogre::Resource::touch(). Referenced by Ogre::OverlayManager::create(). |
|
Loads a mesh from a file, making it available for use.
Definition at line 75 of file OgreMeshManager.cpp. References create(), Ogre::ResourceManager::getByName(), Ogre::Mesh::setIndexBufferPolicy(), Ogre::Mesh::setVertexBufferPolicy(), and Ogre::String. |
|
|
|
|
|
Set a limit on the amount of memory this resource handler may use.
Definition at line 97 of file OgreResourceManager.cpp. References Ogre::ResourceManager::checkUsage(), and Ogre::ResourceManager::mMemoryBudget. |
|
Tells the mesh manager that all future meshes should prepare themselves for shadow volumes on loading.
Definition at line 787 of file OgreMeshManager.cpp. References mPrepAllMeshesForShadowVolumes. |
|
Utility method for tesselating 2D meshes.
Definition at line 619 of file OgreMeshManager.cpp. References Ogre::IndexData::indexBuffer, Ogre::IndexData::indexCount, and Ogre::SubMesh::indexData. Referenced by createCurvedIllusionPlane(), createCurvedPlane(), and createPlane(). |
|
Unloads a Resource from the managed resources list, calling it's unload() method.
Definition at line 105 of file OgreResourceManager.cpp. References Ogre::Resource::getHandle(), Ogre::Resource::getName(), Ogre::Resource::getSize(), Ogre::ResourceManager::mMemoryUsage, Ogre::ResourceManager::mResources, Ogre::ResourceManager::mResourcesByHandle, and Ogre::Resource::unload(). Referenced by Ogre::SceneManager::createSkyboxPlane(), and Ogre::SceneManager::createSkydomePlane(). |
|
Unloads all Resources from memory.
Reimplemented in Ogre::D3D9TextureManager, and Ogre::GLTextureManager. Definition at line 122 of file OgreResourceManager.cpp. References Ogre::ResourceManager::mResources, and Ogre::ResourceManager::mResourcesByHandle. Referenced by Ogre::BspResourceManager::load(), Ogre::D3DTextureManager::~D3DTextureManager(), and Ogre::ResourceManager::~ResourceManager(). |
|
Definition at line 205 of file OgreResourceManager.h. Referenced by Ogre::ResourceManager::_findResourceData(), and Ogre::ResourceManager::addArchiveEx(). |
|
Definition at line 359 of file OgreMeshManager.h. |
|
Definition at line 37 of file OgreResourceManager.cpp. Referenced by Ogre::ResourceManager::_findCommonResourceData(), Ogre::ResourceManager::_findResourceData(), Ogre::ResourceManager::addCommonArchiveEx(), and Ogre::ResourceManager::cleanupCommonArchive(). |
|
Collection of searchable ArchiveEx classes (virtual file system) for all resource types.
Definition at line 36 of file OgreResourceManager.cpp. Referenced by Ogre::ResourceManager::_findCommonResourceData(), Ogre::ResourceManager::_findResourceData(), Ogre::ResourceManager::_getAllCommonNamesLike(), Ogre::ResourceManager::addCommonArchiveEx(), Ogre::ResourceManager::cleanupCommonArchive(), Ogre::OverlayManager::loadAndParseOverlayFile(), Ogre::Quake3ShaderManager::parseAllSources(), Ogre::OverlayManager::parseAllSources(), Ogre::MaterialManager::parseAllSources(), and Ogre::FontManager::parseAllSources(). |
|
Definition at line 215 of file OgreResourceManager.h. Referenced by Ogre::ResourceManager::ResourceManager(), and Ogre::ResourceManager::setMemoryBudget(). |
|
Definition at line 216 of file OgreResourceManager.h. Referenced by Ogre::ResourceManager::ResourceManager(), and Ogre::ResourceManager::unload(). |
|
Definition at line 213 of file OgreResourceManager.h. Referenced by Ogre::ResourceManager::getNextHandle(), and Ogre::ResourceManager::ResourceManager(). |
|
Definition at line 356 of file OgreMeshManager.h. Referenced by getPrepareAllMeshesForShadowVolumes(), MeshManager(), and setPrepareAllMeshesForShadowVolumes(). |
|
|
Definition at line 210 of file OgreResourceManager.h. Referenced by Ogre::ResourceManager::add(), Ogre::ResourceManager::getByHandle(), Ogre::ResourceManager::unload(), and Ogre::ResourceManager::unloadAndDestroyAll(). |
|
Definition at line 44 of file OgreMeshManager.cpp. Referenced by getSingleton(), and getSingletonPtr(). |
|
Collection of searchable ArchiveEx classes (virtual file system) for this resource type.
Definition at line 226 of file OgreResourceManager.h. Referenced by Ogre::ResourceManager::_findResourceData(), Ogre::ResourceManager::_getAllNamesLike(), Ogre::ResourceManager::addArchiveEx(), Ogre::OverlayManager::loadAndParseOverlayFile(), Ogre::Quake3ShaderManager::parseAllSources(), Ogre::OverlayManager::parseAllSources(), Ogre::MaterialManager::parseAllSources(), and Ogre::FontManager::parseAllSources(). |
Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:51:13 2004