This manager is for the storage of all shapes and creation of mesh shapes. More...
#include <collisionshapemanager.h>
Public Types | |
typedef ShapeMap::const_iterator | ConstShapeMapIterator |
Const Map Iterator type for CollisionShape instances stored by this class. | |
typedef ShapeVector::const_iterator | ConstShapeVectorIterator |
Const Vector Iterator type for CollisionShape instances stored by this class. | |
typedef std::map< String, CollisionShape * > | ShapeMap |
Map container type for CollisionShape storage by this class. | |
typedef ShapeMap::iterator | ShapeMapIterator |
Map Iterator type for CollisionShape instances stored by this class. | |
typedef std::vector< CollisionShape * > | ShapeVector |
Vector container type for CollisionShape storage by this class. | |
typedef ShapeVector::iterator | ShapeVectorIterator |
Vector Iterator type for CollisionShape instances stored by this class. | |
Public Types inherited from Mezzanine::ManagerBase | |
enum | ManagerType { MT_Undefined = 0, MT_AudioManager = 1, MT_AnimationManager = 2, MT_CollisionShapeManager = 3, MT_CompositorManager = 4, MT_GraphicsManager = 5, MT_EventManager = 6, MT_InputManager = 7, MT_LogManager = 8, MT_MaterialManager = 9, MT_MeshManager = 10, MT_NetworkManager = 11, MT_ResourceManager = 12, MT_ScriptingManager = 13, MT_TextureManager = 14, MT_UIManager = 15, MT_ActorManager = 101, MT_AreaEffectManager = 102, MT_DebrisManager = 103, MT_PagingManager = 104, MT_PhysicsManager = 105, MT_SceneManager = 106, MT_SoundScapeManager = 107, MT_TerrainManager = 108, MT_VehicleManager = 109, MT_UserCreated = 512 } |
A listing of Manager Types. More... | |
Public Member Functions | |
CollisionShapeManager () | |
Class constructor. | |
CollisionShapeManager (const XML::Node &XMLNode) | |
XML constructor. More... | |
virtual | ~CollisionShapeManager () |
Class destructor. | |
ShapeMapIterator | BeginCollisionShape () |
Gets an Iterator to the first CollisionShape in this manager. More... | |
ConstShapeMapIterator | BeginCollisionShape () const |
Gets a Const Iterator to the first CollisionShape in this manager. More... | |
virtual void | Deinitialize () |
Removes this manager from any necessary configuration so it can be safely disposed of. More... | |
virtual void | DestroyAllShapes () |
Removes all shapes from the manager and then deletes them. | |
virtual void | DestroyShape (CollisionShape *Shape) |
Removes a shape from this manager and deletes it. More... | |
virtual void | DestroyShape (const String &Name) |
Removes a shape from this manager and deletes it. More... | |
ShapeMapIterator | EndCollisionShape () |
Gets an Iterator to one passed the last CollisionShape in this manager. More... | |
ConstShapeMapIterator | EndCollisionShape () const |
Gets a Const Iterator to one passed the last CollisionShape in this manager. More... | |
virtual ConvexHullCollisionShape * | GenerateConvexHull (const String &Name, Graphics::Mesh *ObjectMesh, Boole UseAllSubmeshes=false) |
Generates a Convex Hull from a provided mesh. More... | |
virtual ConvexHullCollisionShape * | GenerateConvexHull (const String &Name, const String &MeshName, const String &Group, Boole UseAllSubmeshes=false) |
Generates a Convex Hull from a provided mesh. More... | |
virtual DynamicMeshCollisionShape * | GenerateDynamicTriMesh (const String &Name, Graphics::Mesh *ObjectMesh, Boole UseAllSubmeshes=false) |
Generates a mesh shape for dynamic objects. More... | |
virtual DynamicMeshCollisionShape * | GenerateDynamicTriMesh (const String &Name, const String &MeshName, const String &Group, Boole UseAllSubmeshes=false) |
Generates a mesh shape for dynamic objects. More... | |
virtual StaticMeshCollisionShape * | GenerateStaticTriMesh (const String &Name, Graphics::Mesh *ObjectMesh, Boole UseAllSubmeshes=false) |
Generates a mesh shape for static objects. More... | |
virtual StaticMeshCollisionShape * | GenerateStaticTriMesh (const String &Name, const String &MeshName, const String &Group, Boole UseAllSubmeshes=false) |
Generates a mesh shape for static objects. More... | |
virtual String | GetImplementationTypeName () const |
This Allows any manager name to be sent to a stream. Primarily used for logging. More... | |
virtual ManagerBase::ManagerType | GetInterfaceType () const |
This returns the type of this manager. More... | |
virtual Whole | GetNumStoredShapes () |
Gets the number of stored shapes in this manager. More... | |
virtual CollisionShape * | GetShape (const String &Name) |
Gets a shape already stored in this manager. More... | |
ShapeVector & | GetUnnamedShapes () |
Returns a vector of unnamed shapes stored in this manager. More... | |
virtual void | Initialize () |
Configures this manager for use prior to entering the main loop. More... | |
virtual void | LoadAllShapesFromBinaryFile (const String &FileName, const String &Group) |
Loads all shapes saved in an existing binary file, and stores them in this manager. More... | |
virtual void | LoadAllShapesFromXMLFile (const String &FileName, const String &Group) |
Loads all shapes saved in an existing XML file, and stores them in this manager. More... | |
virtual CompoundCollisionShape * | PerformConvexDecomposition (const String &Name, Graphics::Mesh *ObjectMesh, Whole Depth, Real CPercent, Real PPercent, Boole UseAllSubmeshes=false) |
Generates a compound shape of Convex Hulls from a provided mesh. More... | |
virtual CompoundCollisionShape * | PerformConvexDecomposition (const String &Name, const String &MeshName, const String &Group, Whole Depth, Real CPercent, Real PPercent, Boole UseAllSubmeshes=false) |
Generates a compound shape of Convex Hulls from a provided mesh. More... | |
virtual void | RemoveAllShapes () |
Removes all shapes from the manager without deleting them. | |
virtual void | RemoveShape (CollisionShape *Shape) |
Removes a shape from this manager without deleting it. More... | |
virtual void | RemoveShape (const String &Name) |
Removes a shape from this manager without deleting it. More... | |
virtual void | SaveAllStoredShapesToBinaryFile (const String &FileName) |
Takes all the shapes currently stored this manager and saves them to a binary file. More... | |
virtual void | SaveAllStoredShapesToXMLFile (const String &FileName) |
Takes all the shapes currently stored this manager and saves them to a XML file. More... | |
virtual void | SaveShapesToBinaryFile (const String &FileName, ShapeVector &ShapesToSave) |
Saves all shapes contained in a vector and saves them to a binary file. More... | |
virtual void | SaveShapesToXMLFile (const String &FileName, ShapeVector &ShapesToSave) |
Saves all shapes contained in a vector and saves them to a XML file. More... | |
void | SetNameForUnnamedShape (const String &NewName, CollisionShape *Shape) |
Assigns a name to an unnamed shape. More... | |
virtual void | StoreShape (CollisionShape *Shape) |
Stores a pre-made shape in this manager. More... | |
Public Member Functions inherited from Mezzanine::EntresolManager | |
EntresolManager () | |
Class constructor. | |
virtual | ~EntresolManager () |
Class destructor. | |
Public Member Functions inherited from Mezzanine::ManagerBase | |
ManagerBase () | |
Class constructor. | |
virtual | ~ManagerBase () |
Class destructor. | |
virtual String | GetInterfaceTypeAsString () const |
Gets a string of the interface type of this manager. More... | |
Boole | IsInitialized () const |
Gets whether or not this manager has been initialized. More... | |
Public Member Functions inherited from Mezzanine::Singleton< CollisionShapeManager > | |
~Singleton () | |
Class destructor. | |
Static Public Attributes | |
static const String | ImplementationName = "DefaultCollisionShapeManager" |
A String containing the name of this manager implementation. | |
static const ManagerBase::ManagerType | InterfaceType = ManagerBase::MT_CollisionShapeManager |
A ManagerType enum value used to describe the type of interface/functionality this manager provides. | |
Protected Member Functions | |
btTriangleMesh * | CreateBulletTrimesh (Graphics::Mesh *ObjectMesh, Boole UseAllSubmeshes) |
Creates a TriMesh to be used in TriMesh based collision shapes. | |
CollisionShape * | WrapShape (const String &Name, btCollisionShape *InternalShape) |
Creates a wrapper for an internal bullet shape. | |
Protected Member Functions inherited from Mezzanine::Singleton< CollisionShapeManager > | |
Singleton () | |
Class constructor. | |
Protected Attributes | |
ShapeMap | CollisionShapes |
This stores the names and collision Shapes. More... | |
ShapeVector | UnnamedShapes |
Stores shapes that have not been given a name. More... | |
Protected Attributes inherited from Mezzanine::ManagerBase | |
Boole | Initialized |
Simple Boole indicating whether or not this manager has been initialized. More... | |
Entresol * | TheEntresol |
The actual pointer to the Entresol core class. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Mezzanine::ManagerBase | |
static String | GetTypeAsString (const ManagerType &ManagerType) |
Gets the string form of the type of manager. More... | |
static ManagerType | GetTypeFromString (const String &ManagerName) |
Gets the type of manager requested from a string. More... | |
Static Public Member Functions inherited from Mezzanine::Singleton< CollisionShapeManager > | |
static CollisionShapeManager * | GetSingletonPtr () |
Fetches a pointer to the singleton. More... | |
static Boole | SingletonValid () |
Checks to see if the singleton pointer is valid. More... | |
Static Protected Attributes inherited from Mezzanine::Singleton< CollisionShapeManager > | |
static CollisionShapeManager * | SingletonPtr |
The one and only pointer to the single object. More... | |
This manager is for the storage of all shapes and creation of mesh shapes.
Collision shapes do not need to be stored in this manager, but can be re-used across multiple World objects with physics representations. For performance reasons, it is recommended to store and re-use a collision shape anytime you need it in multiple objects, rather then re-creating the same shape again and again.
Definition at line 82 of file collisionshapemanager.h.
Mezzanine::Physics::CollisionShapeManager::CollisionShapeManager | ( | const XML::Node & | XMLNode | ) |
XML constructor.
XMLNode | The node of the xml document to construct from. |
Definition at line 93 of file collisionshapemanager.cpp.
CollisionShapeManager::ShapeMapIterator Mezzanine::Physics::CollisionShapeManager::BeginCollisionShape | ( | ) |
Gets an Iterator to the first CollisionShape in this manager.
Definition at line 380 of file collisionshapemanager.cpp.
CollisionShapeManager::ConstShapeMapIterator Mezzanine::Physics::CollisionShapeManager::BeginCollisionShape | ( | ) | const |
Gets a Const Iterator to the first CollisionShape in this manager.
Definition at line 386 of file collisionshapemanager.cpp.
|
virtual |
Removes this manager from any necessary configuration so it can be safely disposed of.
Implements Mezzanine::ManagerBase.
Definition at line 751 of file collisionshapemanager.cpp.
|
virtual |
Removes a shape from this manager and deletes it.
Shape | Pointer to the shape to be destroyed. |
Definition at line 356 of file collisionshapemanager.cpp.
|
virtual |
Removes a shape from this manager and deletes it.
Name | The name of the shape to be destroyed. |
Definition at line 361 of file collisionshapemanager.cpp.
CollisionShapeManager::ShapeMapIterator Mezzanine::Physics::CollisionShapeManager::EndCollisionShape | ( | ) |
Gets an Iterator to one passed the last CollisionShape in this manager.
Definition at line 383 of file collisionshapemanager.cpp.
CollisionShapeManager::ConstShapeMapIterator Mezzanine::Physics::CollisionShapeManager::EndCollisionShape | ( | ) | const |
Gets a Const Iterator to one passed the last CollisionShape in this manager.
Definition at line 389 of file collisionshapemanager.cpp.
|
virtual |
Generates a Convex Hull from a provided mesh.
Name | The name to give the created shape. |
ObjectMesh | The mesh to base this shape off of. |
UseAllSubmeshes | Whether or not you want to use all submesh information when generating this shape. |
Definition at line 395 of file collisionshapemanager.cpp.
|
virtual |
Generates a Convex Hull from a provided mesh.
Name | The name to give the created shape. |
MeshName | The name of the mesh to base this shape off of. |
Group | The resource group where the mesh can be found. |
UseAllSubmeshes | Whether or not you want to use all submesh information when generating this shape. |
Definition at line 412 of file collisionshapemanager.cpp.
|
virtual |
Generates a mesh shape for dynamic objects.
Name | The name to give the created shape. |
ObjectMesh | The mesh to base this shape off of. |
UseAllSubmeshes | Whether or not you want to use all submesh information when generating this shape. |
Definition at line 418 of file collisionshapemanager.cpp.
|
virtual |
Generates a mesh shape for dynamic objects.
Name | The name to give the created shape. |
MeshName | The name of the mesh to base this shape off of. |
Group | The resource group where the mesh can be found. |
UseAllSubmeshes | Whether or not you want to use all submesh information when generating this shape. |
Definition at line 424 of file collisionshapemanager.cpp.
|
virtual |
Generates a mesh shape for static objects.
Name | The name to give the created shape. |
ObjectMesh | The mesh to base this shape off of. |
UseAllSubmeshes | Whether or not you want to use all submesh information when generating this shape. |
Definition at line 430 of file collisionshapemanager.cpp.
|
virtual |
Generates a mesh shape for static objects.
Name | The name to give the created shape. |
MeshName | The name of the mesh to base this shape off of. |
Group | The resource group where the mesh can be found. |
UseAllSubmeshes | Whether or not you want to use all submesh information when generating this shape. |
Definition at line 436 of file collisionshapemanager.cpp.
|
virtual |
This Allows any manager name to be sent to a stream. Primarily used for logging.
Implements Mezzanine::ManagerBase.
Definition at line 760 of file collisionshapemanager.cpp.
|
virtual |
This returns the type of this manager.
This is intended to make using and casting from Manager base easier. With this is is possible to cast from ManagerBase to the correct Manager Type.
Implements Mezzanine::ManagerBase.
Definition at line 757 of file collisionshapemanager.cpp.
|
virtual |
Gets the number of stored shapes in this manager.
Definition at line 333 of file collisionshapemanager.cpp.
|
virtual |
Gets a shape already stored in this manager.
Name | the name of the desired shape. |
Definition at line 326 of file collisionshapemanager.cpp.
CollisionShapeManager::ShapeVector & Mezzanine::Physics::CollisionShapeManager::GetUnnamedShapes | ( | ) |
Returns a vector of unnamed shapes stored in this manager.
Shapes created in code require a name to be constructed. However, sometimes when loading a file a shape may not have a name, since one isn't required by the .bullet file format in order for a shape to be serialized. When that happens those shapes go here, and from there can be handled by the game programmer however they see fit.
Definition at line 721 of file collisionshapemanager.cpp.
|
virtual |
Configures this manager for use prior to entering the main loop.
Implements Mezzanine::ManagerBase.
Definition at line 748 of file collisionshapemanager.cpp.
|
virtual |
Loads all shapes saved in an existing binary file, and stores them in this manager.
FileName | The name of the binary file to load shapes from. |
Group | The resource group the .bullet file is located in. |
Definition at line 646 of file collisionshapemanager.cpp.
|
virtual |
Loads all shapes saved in an existing XML file, and stores them in this manager.
FileName | The name of the XML file to load shapes from. |
Group | The resource group the .bullet file is located in. |
Definition at line 583 of file collisionshapemanager.cpp.
|
virtual |
Generates a compound shape of Convex Hulls from a provided mesh.
Name | The name to give the created shape. |
ObjectMesh | The mesh to base this shape off of. |
UseAllSubmeshes | Whether or not you want to use all submesh information when generating this shape. |
Definition at line 442 of file collisionshapemanager.cpp.
|
virtual |
Generates a compound shape of Convex Hulls from a provided mesh.
Name | The name to give the created shape. |
MeshName | The name of the mesh to base this shape off of. |
Group | The resource group where the mesh can be found. |
UseAllSubmeshes | Whether or not you want to use all submesh information when generating this shape. |
Definition at line 574 of file collisionshapemanager.cpp.
|
virtual |
Removes a shape from this manager without deleting it.
Shape | Pointer to the shape to be removed. |
Definition at line 338 of file collisionshapemanager.cpp.
|
virtual |
Removes a shape from this manager without deleting it.
Name | The name of the shape to be removed. |
Definition at line 343 of file collisionshapemanager.cpp.
|
virtual |
Takes all the shapes currently stored this manager and saves them to a binary file.
FileName | The name of the file to save the shapes to. |
Definition at line 680 of file collisionshapemanager.cpp.
|
virtual |
Takes all the shapes currently stored this manager and saves them to a XML file.
FileName | The name of the file to save the shapes to. |
Definition at line 604 of file collisionshapemanager.cpp.
|
virtual |
Saves all shapes contained in a vector and saves them to a binary file.
FileName | The name of the file to save the shapes to. |
ShapesToSave | A vector of collisions shapes that will be saved. |
Definition at line 699 of file collisionshapemanager.cpp.
|
virtual |
Saves all shapes contained in a vector and saves them to a XML file.
FileName | The name of the file to save the shapes to. |
ShapesToSave | A vector of collisions shapes that will be saved. |
Definition at line 625 of file collisionshapemanager.cpp.
void Mezzanine::Physics::CollisionShapeManager::SetNameForUnnamedShape | ( | const String & | NewName, |
CollisionShape * | Shape | ||
) |
Assigns a name to an unnamed shape.
NewName | The new name to be assigned to a shape. |
Shape | The shape to be given the new name. This shape must be a valid shape currently stored in the set of unnamed shapes. Calling this fucntion will not remove it from that set, but will move it into the named collision shape map. If you want the shape removed from the Unnamed set, you must do it yourself. |
Definition at line 726 of file collisionshapemanager.cpp.
|
virtual |
Stores a pre-made shape in this manager.
Shape | The shape to be stored. |
Definition at line 314 of file collisionshapemanager.cpp.
|
protected |
This stores the names and collision Shapes.
Definition at line 105 of file collisionshapemanager.h.
|
protected |
Stores shapes that have not been given a name.
Definition at line 108 of file collisionshapemanager.h.