#include <OgreMeshManager.h>
Inheritance diagram for Ogre::MeshManager:
Public Types | ||||||||||||||||
typedef HashMap< String, ResourcePtr > | ResourceMap | |||||||||||||||
typedef std::map< ResourceHandle, ResourcePtr > | ResourceHandleMap | |||||||||||||||
typedef MapIterator< ResourceHandleMap > | ResourceMapIterator | |||||||||||||||
Public Member Functions | ||||||||||||||||
MeshManager () | ||||||||||||||||
~MeshManager () | ||||||||||||||||
void | _initialise (void) | |||||||||||||||
Initialises the manager, only to be called by OGRE internally. | ||||||||||||||||
MeshPtr | load (const String &filename, const String &groupName, HardwareBuffer::Usage vertexBufferUsage=HardwareBuffer::HBU_STATIC_WRITE_ONLY, HardwareBuffer::Usage indexBufferUsage=HardwareBuffer::HBU_STATIC_WRITE_ONLY, bool vertexBufferShadowed=true, bool indexBufferShadowed=true) | |||||||||||||||
Loads a mesh from a file, making it immediately available for use. | ||||||||||||||||
MeshPtr | createManual (const String &name, const String &groupName, ManualResourceLoader *loader=0) | |||||||||||||||
Creates a new Mesh specifically for manual definition rather than loading from an object file. | ||||||||||||||||
MeshPtr | createPlane (const String &name, const String &groupName, 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. | ||||||||||||||||
MeshPtr | createCurvedIllusionPlane (const String &name, const String &groupName, 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. | ||||||||||||||||
MeshPtr | createCurvedPlane (const String &name, const String &groupName, 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. | ||||||||||||||||
PatchMeshPtr | createBezierPatch (const String &name, const String &groupName, 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 | getBoundsPaddingFactor (void) | |||||||||||||||
Gets the factor by which the bounding box of an entity is padded. | ||||||||||||||||
void | setBoundsPaddingFactor (Real paddingFactor) | |||||||||||||||
Sets the factor by which the bounding box of an entity is padded. | ||||||||||||||||
void | loadResource (Resource *res) | |||||||||||||||
virtual ResourcePtr | create (const String &name, const String &group, bool isManual=false, ManualResourceLoader *loader=0, const NameValuePairList *createParams=0) | |||||||||||||||
Creates a new blank resource, but does not immediately load it. | ||||||||||||||||
virtual void | setMemoryBudget (size_t bytes) | |||||||||||||||
Set a limit on the amount of memory this resource handler may use. | ||||||||||||||||
virtual size_t | getMemoryBudget (void) const | |||||||||||||||
Get the limit on the amount of memory this resource handler may use. | ||||||||||||||||
virtual void | unload (const String &name) | |||||||||||||||
Unloads a single resource by name. | ||||||||||||||||
virtual void | unload (ResourceHandle handle) | |||||||||||||||
Unloads a single resource by handle. | ||||||||||||||||
virtual void | unloadAll (bool reloadableOnly=true) | |||||||||||||||
Unloads all resources. | ||||||||||||||||
virtual void | reloadAll (bool reloadableOnly=true) | |||||||||||||||
Caused all currently loaded resources to be reloaded. | ||||||||||||||||
virtual void | unloadUnreferencedResources (bool reloadableOnly=true) | |||||||||||||||
Unload all resources which are not referenced by any other object. | ||||||||||||||||
virtual void | reloadUnreferencedResources (bool reloadableOnly=true) | |||||||||||||||
Caused all currently loaded but not referenced by any other object resources to be reloaded. | ||||||||||||||||
virtual void | remove (ResourcePtr &r) | |||||||||||||||
Remove a single resource. | ||||||||||||||||
virtual void | remove (const String &name) | |||||||||||||||
Remove a single resource by name. | ||||||||||||||||
virtual void | remove (ResourceHandle handle) | |||||||||||||||
Remove a single resource by handle. | ||||||||||||||||
virtual void | removeAll (void) | |||||||||||||||
Removes all resources. | ||||||||||||||||
virtual ResourcePtr | getByName (const String &name) | |||||||||||||||
Retrieves a pointer to a resource by name, or null if the resource does not exist. | ||||||||||||||||
virtual ResourcePtr | getByHandle (ResourceHandle handle) | |||||||||||||||
Retrieves a pointer to a resource by handle, or null if the resource does not exist. | ||||||||||||||||
virtual bool | resourceExists (const String &name) | |||||||||||||||
Returns whether the named resource exists in this manager. | ||||||||||||||||
virtual bool | resourceExists (ResourceHandle handle) | |||||||||||||||
Returns whether a resource with the given handle exists in this manager. | ||||||||||||||||
virtual void | _notifyResourceTouched (Resource *res) | |||||||||||||||
Notify this manager that a resource which it manages has been 'touched', ie used. | ||||||||||||||||
virtual void | _notifyResourceLoaded (Resource *res) | |||||||||||||||
Notify this manager that a resource which it manages has been loaded. | ||||||||||||||||
virtual void | _notifyResourceUnloaded (Resource *res) | |||||||||||||||
Notify this manager that a resource which it manages has been unloaded. | ||||||||||||||||
virtual ResourcePtr | load (const String &name, const String &group, bool isManual=false, ManualResourceLoader *loader=0, const NameValuePairList *loadParams=0) | |||||||||||||||
Generic load method, used to create a Resource specific to this ResourceManager without using one of the specialised 'load' methods (containing per-Resource-type parameters). | ||||||||||||||||
virtual const StringVector & | getScriptPatterns (void) const | |||||||||||||||
Gets the file patterns which should be used to find scripts for this ResourceManager. | ||||||||||||||||
virtual void | parseScript (DataStreamPtr &stream, const String &groupName) | |||||||||||||||
Parse the definition of a set of resources from a script file. | ||||||||||||||||
virtual Real | getLoadingOrder (void) const | |||||||||||||||
Gets the relative loading order of resources of this type. | ||||||||||||||||
const String & | getResourceType (void) const | |||||||||||||||
Gets a string identifying the type of resource this manager handles. | ||||||||||||||||
ResourceMapIterator | getResourceIterator (void) | |||||||||||||||
Returns an iterator over all resources in this manager. | ||||||||||||||||
Singleton (void) | ||||||||||||||||
Static Public Member Functions | ||||||||||||||||
static MeshManager & | getSingleton (void) | |||||||||||||||
Override standard Singleton retrieval. | ||||||||||||||||
static MeshManager * | getSingletonPtr (void) | |||||||||||||||
Override standard Singleton retrieval. | ||||||||||||||||
Protected Types | ||||||||||||||||
typedef std::map< Resource *, MeshBuildParams > | MeshBuildParamsMap | |||||||||||||||
Map from resource pointer to parameter set. | ||||||||||||||||
enum | MeshBuildType { MBT_PLANE, MBT_CURVED_ILLUSION_PLANE, MBT_CURVED_PLANE } | |||||||||||||||
Enum identifying the types of manual mesh built by this manager. More... | ||||||||||||||||
Protected Member Functions | ||||||||||||||||
Resource * | createImpl (const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader, const NameValuePairList *createParams) | |||||||||||||||
| ||||||||||||||||
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) | |||||||||||||||
void | loadManualPlane (Mesh *pMesh, MeshBuildParams ¶ms) | |||||||||||||||
Utility method for manual loading a plane. | ||||||||||||||||
void | loadManualCurvedPlane (Mesh *pMesh, MeshBuildParams ¶ms) | |||||||||||||||
Utility method for manual loading a curved plane. | ||||||||||||||||
void | loadManualCurvedIllusionPlane (Mesh *pMesh, MeshBuildParams ¶ms) | |||||||||||||||
Utility method for manual loading a curved illusion plane. | ||||||||||||||||
ResourceHandle | getNextHandle (void) | |||||||||||||||
Allocates the next handle. | ||||||||||||||||
virtual void | addImpl (ResourcePtr &res) | |||||||||||||||
Add a newly created resource to the manager (note weak reference). | ||||||||||||||||
virtual void | removeImpl (ResourcePtr &res) | |||||||||||||||
Remove a resource from this manager; remove it from the lists. | ||||||||||||||||
virtual void | checkUsage (void) | |||||||||||||||
Checks memory usage and pages out if required. | ||||||||||||||||
virtual size_t | getMemoryUsage (void) const | |||||||||||||||
Gets the current memory usage, in bytes. | ||||||||||||||||
Protected Attributes | ||||||||||||||||
MeshBuildParamsMap | mMeshBuildParams | |||||||||||||||
bool | mPrepAllMeshesForShadowVolumes | |||||||||||||||
Real | mBoundsPaddingFactor | |||||||||||||||
ResourceHandleMap | mResourcesByHandle | |||||||||||||||
ResourceMap | mResources | |||||||||||||||
ResourceHandle | mNextHandle | |||||||||||||||
size_t | mMemoryBudget | |||||||||||||||
size_t | mMemoryUsage | |||||||||||||||
StringVector | mScriptPatterns | |||||||||||||||
Patterns to use to look for scripts if supported (e.g. *.overlay). | ||||||||||||||||
Real | mLoadOrder | |||||||||||||||
Loading order relative to other managers, higher is later. | ||||||||||||||||
String | mResourceType | |||||||||||||||
String identifying the resource type this manager handles. | ||||||||||||||||
Static Protected Attributes | ||||||||||||||||
static MeshManager * | ms_Singleton | |||||||||||||||
Classes | ||||||||||||||||
struct | MeshBuildParams | |||||||||||||||
Saved parameters used to (re)build a manual mesh built by this class. More... |
Definition at line 46 of file OgreMeshManager.h.
|
Map from resource pointer to parameter set.
Definition at line 406 of file OgreMeshManager.h. |
|
Definition at line 387 of file OgreResourceManager.h. |
|
Definition at line 386 of file OgreResourceManager.h. |
|
Definition at line 405 of file OgreResourceManager.h. |
|
Enum identifying the types of manual mesh built by this manager.
Definition at line 377 of file OgreMeshManager.h. |
|
|
|
|
|
Initialises the manager, only to be called by OGRE internally.
|
|
Notify this manager that a resource which it manages has been loaded.
|
|
Notify this manager that a resource which it manages has been 'touched', ie used.
|
|
Notify this manager that a resource which it manages has been unloaded.
|
|
Add a newly created resource to the manager (note weak reference).
|
|
Checks memory usage and pages out if required.
|
|
Creates a new blank resource, but does not immediately load it.
|
|
Creates a Bezier patch based on an array of control vertices.
|
|
Creates a plane, which because of it's texture coordinates looks like a curved surface, useful for skies in a skybox.
|
|
Creates a genuinely curved plane, by default majoring on the x/y axes facing positive Z.
|
|
Implements Ogre::ResourceManager. |
|
Creates a new Mesh specifically for manual definition rather than loading from an object file.
|
|
Creates a basic plane, by default majoring on the x/y axes facing positive Z.
|
|
|
|
Gets the factor by which the bounding box of an entity is padded. Default is 0.01 |
|
Retrieves a pointer to a resource by handle, or null if the resource does not exist.
|
|
Retrieves a pointer to a resource by name, or null if the resource does not exist.
|
|
Gets the relative loading order of resources of this type.
Implements Ogre::ScriptLoader. Definition at line 340 of file OgreResourceManager.h. |
|
Get the limit on the amount of memory this resource handler may use.
|
|
Gets the current memory usage, in bytes.
Definition at line 382 of file OgreResourceManager.h. |
|
Allocates the next handle.
|
|
Retrieves whether all Meshes should prepare themselves for shadow volumes.
|
|
Returns an iterator over all resources in this manager.
Definition at line 410 of file OgreResourceManager.h. |
|
Gets a string identifying the type of resource this manager handles.
Definition at line 343 of file OgreResourceManager.h. |
|
Gets the file patterns which should be used to find scripts for this ResourceManager.
Implements Ogre::ScriptLoader. Definition at line 317 of file OgreResourceManager.h. |
|
Override standard Singleton retrieval.
Reimplemented from Ogre::Singleton< MeshManager >. |
|
Override standard Singleton retrieval.
Reimplemented from Ogre::Singleton< MeshManager >. |
|
Generic load method, used to create a Resource specific to this ResourceManager without using one of the specialised 'load' methods (containing per-Resource-type parameters).
Reimplemented in Ogre::BspResourceManager. |
|
Loads a mesh from a file, making it immediately available for use.
|
|
Utility method for manual loading a curved illusion plane.
|
|
Utility method for manual loading a curved plane.
|
|
Utility method for manual loading a plane.
|
|
Implements Ogre::ManualResourceLoader. |
|
Parse the definition of a set of resources from a script file.
Implements Ogre::ScriptLoader. Reimplemented in Ogre::CompositorManager, Ogre::FontManager, and Ogre::MaterialManager. Definition at line 332 of file OgreResourceManager.h. |
|
Caused all currently loaded resources to be reloaded.
|
|
Caused all currently loaded but not referenced by any other object resources to be reloaded.
|
|
Remove a single resource by handle.
|
|
Remove a single resource by name.
|
|
Remove a single resource.
|
|
Removes all resources.
Reimplemented in Ogre::CompositorManager. |
|
Remove a resource from this manager; remove it from the lists.
|
|
Returns whether a resource with the given handle exists in this manager.
Definition at line 265 of file OgreResourceManager.h. |
|
Returns whether the named resource exists in this manager.
Definition at line 260 of file OgreResourceManager.h. |
|
Sets the factor by which the bounding box of an entity is padded.
|
|
Set a limit on the amount of memory this resource handler may use.
|
|
Tells the mesh manager that all future meshes should prepare themselves for shadow volumes on loading.
|
|
Definition at line 57 of file OgreSingleton.h. |
|
Utility method for tesselating 2D meshes.
|
|
Unloads a single resource by handle.
|
|
Unloads a single resource by name.
|
|
Unloads all resources.
|
|
Unload all resources which are not referenced by any other object.
|
|
Definition at line 419 of file OgreMeshManager.h. |
|
Loading order relative to other managers, higher is later.
Definition at line 400 of file OgreResourceManager.h. |
|
Definition at line 392 of file OgreResourceManager.h. |
|
Definition at line 393 of file OgreResourceManager.h. |
|
Definition at line 407 of file OgreMeshManager.h. |
|
Definition at line 391 of file OgreResourceManager.h. |
|
Definition at line 416 of file OgreMeshManager.h. |
|
Definition at line 390 of file OgreResourceManager.h. |
|
Definition at line 389 of file OgreResourceManager.h. |
|
String identifying the resource type this manager handles.
Definition at line 402 of file OgreResourceManager.h. |
|
Definition at line 54 of file OgreSingleton.h. |
|
Patterns to use to look for scripts if supported (e.g. *.overlay).
Definition at line 398 of file OgreResourceManager.h. |
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Nov 12 10:51:39 2006