MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Mezzanine::Physics::CollisionShape Class Referenceabstract

This is the base class for all collision shapes. More...

#include <collisionshape.h>

+ Inheritance diagram for Mezzanine::Physics::CollisionShape:
+ Collaboration diagram for Mezzanine::Physics::CollisionShape:

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 StringGetName () 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.
 

Detailed Description

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.

Member Enumeration Documentation

This enum describes what kind of shape you are currently working with.

Note
These are number primarily for Serialization purposes. These corresponding numbers could vary wildly. Any use of corresponding raw number in serialization will be done with object serialization version in mind.
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.

Member Function Documentation

btCollisionShape * Mezzanine::Physics::CollisionShape::_GetInternalShape ( ) const
virtual

Gets the internal shape pointer this collision shape is based on.

Returns
Returns a pointer to the internal collision shape.

Definition at line 173 of file collisionshape.cpp.

void Mezzanine::Physics::CollisionShape::_SetShapeName ( const String NewName)
virtual

Sets the name of this collision shape.

Remarks
This method should be used with extreme care when it is stored by the collision shape manager.
Parameters
NewNameThe new name to be given to this shape.

Definition at line 168 of file collisionshape.cpp.

Real Mezzanine::Physics::CollisionShape::GetMargin ( ) const
virtual

Gets the amount of padding currently being applied to the collision shape.

Returns
Returns the amount of padding, in world units, is being applied to the collision shape.

Definition at line 96 of file collisionshape.cpp.

const String & Mezzanine::Physics::CollisionShape::GetName ( ) const
virtual

Gets the name of this shape.

Returns
Returns a const reference string containing the name of this collision shape.

Definition at line 83 of file collisionshape.cpp.

Vector3 Mezzanine::Physics::CollisionShape::GetScaling ( ) const
virtual

Gets the current scaling being applied to the collision shape.

Returns
Returns a vector3 representing the amount of scaling being applied to the shape.

Definition at line 106 of file collisionshape.cpp.

virtual CollisionShape::ShapeType Mezzanine::Physics::CollisionShape::GetType ( ) const
pure virtual
void Mezzanine::Physics::CollisionShape::ProtoDeSerialize ( const XML::Node OneNode)
virtual
void Mezzanine::Physics::CollisionShape::ProtoSerialize ( XML::Node CurrentRoot) const
virtual
String Mezzanine::Physics::CollisionShape::SerializableName ( )
static

Get the name of the the XML tag this class will leave behind as its instances are serialized.

Returns
A string containing "CollisionShape"

Definition at line 162 of file collisionshape.cpp.

void Mezzanine::Physics::CollisionShape::SetMargin ( const Real Margin)
virtual

Sets the padding that will be applied when checking for collisions.

Parameters
MarginA real in world units representing how much padding is to be applied to this shape.

Definition at line 91 of file collisionshape.cpp.

void Mezzanine::Physics::CollisionShape::SetScaling ( const Vector3 Scaling)
virtual

Scales the collision shape on each of it's axes.

Parameters
ScalingA vector3 representing how much scaling should be applied on each of the shapes 3 axes.

Definition at line 101 of file collisionshape.cpp.


The documentation for this class was generated from the following files: