This is the base class for all collision shapes. More...
#include <collisionshape.h>
Public Types | |
enum | ShapeType { ST_Box = 0, ST_Capsule = 1, ST_Compound = 2, ST_Cone = 3, ST_ConvexHull = 4, ST_Cylinder = 5, ST_MultiSphere = 6, ST_Sphere = 7, ST_DynamicTriMesh = 8, ST_Heightfield = 9, ST_Plane = 10, ST_Soft = 11, ST_StaticTriMesh = 12 } |
This enum describes what kind of shape you are currently working with. More... | |
Public Member Functions | |
CollisionShape () | |
Class Constructor. | |
virtual | ~CollisionShape () |
Class Destructor. | |
virtual btCollisionShape * | _GetInternalShape () const |
Gets the internal shape pointer this collision shape is based on. More... | |
virtual void | _SetShapeName (const String &NewName) |
Sets the name of this collision shape. More... | |
virtual Real | GetMargin () const |
Gets the amount of padding currently being applied to the collision shape. More... | |
virtual const String & | GetName () const |
Gets the name of this shape. More... | |
virtual Vector3 | GetScaling () const |
Gets the current scaling being applied to the collision shape. More... | |
virtual CollisionShape::ShapeType | GetType () const =0 |
Gets the type of Collision shape this is. More... | |
virtual void | ProtoDeSerialize (const XML::Node &OneNode) |
Take the data stored in an XML and overwrite this instance of this object with it. More... | |
virtual void | ProtoSerialize (XML::Node &CurrentRoot) const |
Convert this class to an XML::Node ready for serialization. More... | |
virtual void | SetMargin (const Real &Margin) |
Sets the padding that will be applied when checking for collisions. More... | |
virtual void | SetScaling (const Vector3 &Scaling) |
Scales the collision shape on each of it's axes. More... | |
Static Public Member Functions | |
static String | SerializableName () |
Get the name of the the XML tag this class will leave behind as its instances are serialized. More... | |
Protected Attributes | |
String | Name |
Storage for the name of this class instance. | |
btCollisionShape * | ShapeBase |
A pointer to the bullet collision this uses. | |
This is the base class for all collision shapes.
Currently there are a total of 13 collision shape classes inheriting from 3 other base classes. Collision shapes are shape representations for Actors, AreaEffects, and other classes with bodies in the physics engine.
It's important to note that Collision shapes can be created and then re-used in as many World objects(at the same time) as you need, and it is encouraged to do this.
Definition at line 63 of file collisionshape.h.
This enum describes what kind of shape you are currently working with.
Enumerator | |
---|---|
ST_Box |
Indicates the class is a BoxCollisionShape. |
ST_Capsule |
Indicates the class is a CapsuleCollisionShape. |
ST_Compound |
Indicates the class is a CompoundCollisionShape. |
ST_Cone |
Indicates the class is a ConeCollisionShape. |
ST_ConvexHull |
Indicates the class is a ConvexHullCollisionShape. |
ST_Cylinder |
Indicates the class is a CylinderCollisionShape. |
ST_MultiSphere |
Indicates the class is a MultiSphereCollisionShape. |
ST_Sphere |
Indicates the class is a SphereCollisionShape. |
ST_DynamicTriMesh |
Indicates the class is a DynamicMeshCollisionShape. |
ST_Heightfield |
Indicates the class is a HeightfieldCollisionShape. |
ST_Plane |
Indicates the class is a PlaneCollisionShape. |
ST_Soft |
Indicates the class is a SoftCollisionShape. |
ST_StaticTriMesh |
Indicates the class is a StaticMeshCollisionShape. |
Definition at line 69 of file collisionshape.h.
|
virtual |
Gets the internal shape pointer this collision shape is based on.
Definition at line 173 of file collisionshape.cpp.
|
virtual |
Sets the name of this collision shape.
NewName | The new name to be given to this shape. |
Definition at line 168 of file collisionshape.cpp.
|
virtual |
Gets the amount of padding currently being applied to the collision shape.
Definition at line 96 of file collisionshape.cpp.
|
virtual |
Gets the name of this shape.
Definition at line 83 of file collisionshape.cpp.
|
virtual |
Gets the current scaling being applied to the collision shape.
Definition at line 106 of file collisionshape.cpp.
|
pure virtual |
Gets the type of Collision shape this is.
Implemented in Mezzanine::Physics::CylinderCollisionShape, Mezzanine::Physics::ConeCollisionShape, Mezzanine::Physics::CapsuleCollisionShape, Mezzanine::Physics::CompoundCollisionShape, Mezzanine::Physics::ConvexHullCollisionShape, Mezzanine::Physics::MultiSphereCollisionShape, Mezzanine::Physics::BoxCollisionShape, Mezzanine::Physics::SphereCollisionShape, Mezzanine::Physics::HeightfieldCollisionShape, Mezzanine::Physics::SoftCollisionShape, Mezzanine::Physics::DynamicMeshCollisionShape, Mezzanine::Physics::FieldCollisionShape, Mezzanine::Physics::StaticMeshCollisionShape, Mezzanine::Physics::MeshCollisionShape, Mezzanine::Physics::PlaneCollisionShape, and Mezzanine::Physics::PrimitiveCollisionShape.
|
virtual |
Take the data stored in an XML and overwrite this instance of this object with it.
OneNode | and XML::Node containing the data. |
Reimplemented in Mezzanine::Physics::CylinderCollisionShape, Mezzanine::Physics::ConeCollisionShape, Mezzanine::Physics::CapsuleCollisionShape, Mezzanine::Physics::CompoundCollisionShape, Mezzanine::Physics::ConvexHullCollisionShape, Mezzanine::Physics::MultiSphereCollisionShape, Mezzanine::Physics::BoxCollisionShape, Mezzanine::Physics::SphereCollisionShape, Mezzanine::Physics::FieldCollisionShape, Mezzanine::Physics::MeshCollisionShape, and Mezzanine::Physics::PrimitiveCollisionShape.
Definition at line 140 of file collisionshape.cpp.
|
virtual |
Convert this class to an XML::Node ready for serialization.
CurrentRoot | The point in the XML hierarchy that all this collision shape should be appended to. |
Reimplemented in Mezzanine::Physics::CylinderCollisionShape, Mezzanine::Physics::ConeCollisionShape, Mezzanine::Physics::CapsuleCollisionShape, Mezzanine::Physics::CompoundCollisionShape, Mezzanine::Physics::ConvexHullCollisionShape, Mezzanine::Physics::MultiSphereCollisionShape, Mezzanine::Physics::BoxCollisionShape, Mezzanine::Physics::SphereCollisionShape, Mezzanine::Physics::FieldCollisionShape, Mezzanine::Physics::MeshCollisionShape, and Mezzanine::Physics::PrimitiveCollisionShape.
Definition at line 114 of file collisionshape.cpp.
|
static |
Get the name of the the XML tag this class will leave behind as its instances are serialized.
Definition at line 162 of file collisionshape.cpp.
|
virtual |
Sets the padding that will be applied when checking for collisions.
Margin | A real in world units representing how much padding is to be applied to this shape. |
Definition at line 91 of file collisionshape.cpp.
|
virtual |
Scales the collision shape on each of it's axes.
Scaling | A vector3 representing how much scaling should be applied on each of the shapes 3 axes. |
Definition at line 101 of file collisionshape.cpp.