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_ActorSoft = 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 * | GetBulletShape () const |
| Gets the internal shape pointer this collision shape is based on. | |
| virtual Real | GetMargin () const |
| Gets the amount of padding currently being applied to the collision shape. | |
| virtual const String & | GetName () const |
| Gets the name of this shape. | |
| virtual Vector3 | GetScaling () const |
| Gets the current scaling being applied to the collision shape. | |
| virtual CollisionShape::ShapeType | GetType () const =0 |
| Gets the type of Collision shape this is. | |
| virtual void | ProtoDeSerialize (const xml::Node &OneNode) |
| Take the data stored in an XML and overwrite this instance of this object with it. | |
| virtual void | ProtoSerialize (xml::Node &CurrentRoot) const |
| Convert this class to an xml::Node ready for serialization. | |
| virtual void | SetMargin (const Real &Margin) |
| Sets the padding that will be applied when checking for collisions. | |
| virtual void | SetScaling (const Vector3 &Scaling) |
| Scales the collision shape on each of it's axes. | |
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. | |
Protected Attributes | |
| String | Name |
| Storage for the name of this class instance. | |
| btCollisionShape * | ShapeBase |
| A pointer to the bullet collision this uses. | |
Friends | |
| class | CollisionShapeManager |
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 80 of file collisionshape.h.
This enum describes what kind of shape you are currently working with.
| 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_ActorSoft |
Indicates the class is a ActorSoftCollisionShape. |
| ST_StaticTriMesh |
Indicates the class is a StaticMeshCollisionShape. |
Definition at line 86 of file collisionshape.h.
| btCollisionShape * Mezzanine::CollisionShape::GetBulletShape | ( | ) | const [virtual] |
Gets the internal shape pointer this collision shape is based on.
Definition at line 93 of file collisionshape.cpp.
| Real Mezzanine::CollisionShape::GetMargin | ( | ) | const [virtual] |
Gets the amount of padding currently being applied to the collision shape.
Definition at line 78 of file collisionshape.cpp.
| const String & Mezzanine::CollisionShape::GetName | ( | ) | const [virtual] |
Gets the name of this shape.
Definition at line 68 of file collisionshape.cpp.
| Vector3 Mezzanine::CollisionShape::GetScaling | ( | ) | const [virtual] |
Gets the current scaling being applied to the collision shape.
Definition at line 88 of file collisionshape.cpp.
| virtual CollisionShape::ShapeType Mezzanine::CollisionShape::GetType | ( | ) | const [pure virtual] |
Gets the type of Collision shape this is.
Implemented in Mezzanine::PrimitiveCollisionShape, Mezzanine::FieldCollisionShape, Mezzanine::MeshCollisionShape, Mezzanine::CompoundCollisionShape, Mezzanine::BoxCollisionShape, Mezzanine::CapsuleCollisionShape, Mezzanine::ConeCollisionShape, Mezzanine::ConvexHullCollisionShape, Mezzanine::CylinderCollisionShape, Mezzanine::MultiSphereCollisionShape, Mezzanine::SphereCollisionShape, Mezzanine::DynamicMeshCollisionShape, Mezzanine::HeightfieldCollisionShape, Mezzanine::PlaneCollisionShape, Mezzanine::ActorSoftCollisionShape, and Mezzanine::StaticMeshCollisionShape.
| void Mezzanine::CollisionShape::ProtoDeSerialize | ( | const xml::Node & | OneNode | ) | [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::PrimitiveCollisionShape, Mezzanine::FieldCollisionShape, Mezzanine::MeshCollisionShape, Mezzanine::CompoundCollisionShape, Mezzanine::BoxCollisionShape, Mezzanine::CapsuleCollisionShape, Mezzanine::ConeCollisionShape, Mezzanine::ConvexHullCollisionShape, Mezzanine::CylinderCollisionShape, Mezzanine::MultiSphereCollisionShape, and Mezzanine::SphereCollisionShape.
Definition at line 125 of file collisionshape.cpp.
| void Mezzanine::CollisionShape::ProtoSerialize | ( | xml::Node & | CurrentRoot | ) | const [virtual] |
Convert this class to an xml::Node ready for serialization.
| CurrentRoot | The point in the XML hierarchy that all this vectorw should be appended to. |
Reimplemented in Mezzanine::PrimitiveCollisionShape, Mezzanine::FieldCollisionShape, Mezzanine::MeshCollisionShape, Mezzanine::CompoundCollisionShape, Mezzanine::BoxCollisionShape, Mezzanine::CapsuleCollisionShape, Mezzanine::ConeCollisionShape, Mezzanine::ConvexHullCollisionShape, Mezzanine::CylinderCollisionShape, Mezzanine::MultiSphereCollisionShape, and Mezzanine::SphereCollisionShape.
Definition at line 99 of file collisionshape.cpp.
| String Mezzanine::CollisionShape::SerializableName | ( | ) | [static] |
Get the name of the the XML tag this class will leave behind as its instances are serialized.
Reimplemented in Mezzanine::PrimitiveCollisionShape, Mezzanine::FieldCollisionShape, Mezzanine::MeshCollisionShape, Mezzanine::CompoundCollisionShape, Mezzanine::BoxCollisionShape, Mezzanine::CapsuleCollisionShape, Mezzanine::ConeCollisionShape, Mezzanine::ConvexHullCollisionShape, Mezzanine::CylinderCollisionShape, Mezzanine::MultiSphereCollisionShape, and Mezzanine::SphereCollisionShape.
Definition at line 147 of file collisionshape.cpp.
| void Mezzanine::CollisionShape::SetMargin | ( | const Real & | Margin | ) | [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 73 of file collisionshape.cpp.
| void Mezzanine::CollisionShape::SetScaling | ( | const Vector3 & | Scaling | ) | [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 83 of file collisionshape.cpp.
1.7.3