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_AudioManager = 1, MT_AnimationManager, MT_CollisionShapeManager, MT_CompositorManager, MT_GraphicsManager, MT_EventManager, MT_InputManager, MT_LogManager, MT_MaterialManager, MT_MeshManager, MT_NetworkManager, MT_ResourceManager, MT_ScriptingManager, MT_UIManager, MT_ActorManager = 100, MT_AreaEffectManager, MT_CameraManager, MT_DebrisManager, MT_PagingManager, MT_PhysicsManager, MT_SceneManager, MT_SoundScapeManager, MT_TerrainManager, MT_VehicleManager, MT_UserCreated = 512 } |
Public Member Functions | |
CollisionShapeManager () | |
Class constructor. | |
CollisionShapeManager (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, bool UseAllSubmeshes=false) |
Generates a Convex Hull from a provided mesh. More... | |
virtual ConvexHullCollisionShape * | GenerateConvexHull (const String &Name, const String &MeshName, const String &Group, bool UseAllSubmeshes=false) |
Generates a Convex Hull from a provided mesh. More... | |
virtual DynamicMeshCollisionShape * | GenerateDynamicTriMesh (const String &Name, Graphics::Mesh *ObjectMesh, bool UseAllSubmeshes=false) |
Generates a mesh shape for dynamic objects. More... | |
virtual DynamicMeshCollisionShape * | GenerateDynamicTriMesh (const String &Name, const String &MeshName, const String &Group, bool UseAllSubmeshes=false) |
Generates a mesh shape for dynamic objects. More... | |
virtual StaticMeshCollisionShape * | GenerateStaticTriMesh (const String &Name, Graphics::Mesh *ObjectMesh, bool UseAllSubmeshes=false) |
Generates a mesh shape for static objects. More... | |
virtual StaticMeshCollisionShape * | GenerateStaticTriMesh (const String &Name, const String &MeshName, const String &Group, bool 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 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, bool 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, bool 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::ManagerBase | |
ManagerBase () | |
Class constructor. | |
virtual | ~ManagerBase () |
Class destructor. | |
virtual String | GetInterfaceTypeAsString () const |
Gets a string of the interface type of this manager. More... | |
bool | IsInitialized () const |
Gets whether or not this manager has been initialized. More... | |
Public Member Functions inherited from Mezzanine::Singleton< CollisionShapeManager > | |
Singleton () | |
Class constructor. | |
~Singleton () | |
Class destructor. | |
Protected Member Functions | |
btTriangleMesh * | CreateBulletTrimesh (Graphics::Mesh *ObjectMesh, bool 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 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 | |
bool | Initialized |
Simple bool 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 bool | SingletonValid () |
Checks to see if the singleton pointer is valid. More... | |
Static Protected Attributes inherited from Mezzanine::Singleton< CollisionShapeManager > | |
static CollisionShapeManager * | SingletonPtr |
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 80 of file collisionshapemanager.h.
Mezzanine::Physics::CollisionShapeManager::CollisionShapeManager | ( | XML::Node & | XMLNode) |
XML constructor.
XMLNode | The node of the xml document to construct from. |
Definition at line 90 of file collisionshapemanager.cpp.
CollisionShapeManager::ShapeMapIterator Mezzanine::Physics::CollisionShapeManager::BeginCollisionShape | ( | ) |
Gets an Iterator to the first CollisionShape in this manager.
Definition at line 379 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 385 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 750 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 355 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 360 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 382 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 388 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 394 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 411 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 417 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 423 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 429 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 435 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 759 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 756 of file collisionshapemanager.cpp.
|
virtual |
Gets the number of stored shapes in this manager.
Definition at line 332 of file collisionshapemanager.cpp.
|
virtual |
Gets a shape already stored in this manager.
Name | the name of the desired shape. |
Definition at line 325 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 720 of file collisionshapemanager.cpp.
|
virtual |
Configures this manager for use prior to entering the main loop.
Implements Mezzanine::ManagerBase.
Definition at line 747 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 645 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 582 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 441 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 573 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 337 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 342 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 679 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 603 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 698 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 624 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 725 of file collisionshapemanager.cpp.
|
virtual |
Stores a pre-made shape in this manager.
Shape | The shape to be stored. |
Definition at line 311 of file collisionshapemanager.cpp.
|
protected |
This stores the names and collision Shapes.
Definition at line 98 of file collisionshapemanager.h.
|
protected |
Stores shapes that have not been given a name.
Definition at line 101 of file collisionshapemanager.h.