Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Mezzanine::Physics::CompoundCollisionShape Class Reference

A collision shape composed of many other collision shapes placed and oriented in local space. More...

#include <collisionshape.h>

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

Public Member Functions

 CompoundCollisionShape (const String &Name)
 Class Constructor. More...
 
 CompoundCollisionShape (const String &Name, btCompoundShape *BulletShape)
 Internal Constructor. More...
 
virtual ~CompoundCollisionShape ()
 Class Destructor.
 
virtual void AddChildShape (CollisionShape *Child, const Vector3 &ChildLocation, const Quaternion &ChildRotation)
 Adds a shape to this compound shape. More...
 
virtual void AddChildShape (CollisionShape *Child, const Vector3 &ChildLocation)
 Adds a shape to this compound shape. More...
 
virtual void AddChildShape (CollisionShape *Child, const Transform &ChildLocation)
 Adds a shape to this compound shape. More...
 
virtual btCompoundShape * GetBulletCompoundShape () const
 
virtual CollisionShapeGetChild (Whole Index) const
 Get a specific child. More...
 
virtual Whole GetNumChildren () const
 Gets the number of children belonging to this compound shape. More...
 
virtual CollisionShape::ShapeType GetType () const
 Gets the type of Collision shape this is. More...
 
virtual void ProtoDeSerialize (const XML::Node &OneNode)
 
virtual void ProtoSerialize (XML::Node &CurrentRoot) const
 
virtual void RemoveChildShape (CollisionShape *Child)
 Removes a Child shape from this compound shape. More...
 
virtual void RemoveChildShape (const Whole &ChildIndex)
 Removed a Child shape from this compound shape by index. More...
 
- Public Member Functions inherited from Mezzanine::Physics::CollisionShape
 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 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 GetSerializableName ()
 Get the name of the the XML tag this class will leave behind as its instances are serialized. More...
 
- Static Public Member Functions inherited from Mezzanine::Physics::CollisionShape
static String GetSerializableName ()
 Get the name of the the XML tag this class will leave behind as its instances are serialized. More...
 

Protected Attributes

std::vector< CollisionShape * > ChildShapes
 Storage for Child shapes.
 
- Protected Attributes inherited from Mezzanine::Physics::CollisionShape
String Name
 Storage for the name of this class instance.
 
btCollisionShape * ShapeBase
 A pointer to the bullet collision this uses.
 

Additional Inherited Members

- Public Types inherited from Mezzanine::Physics::CollisionShape
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...
 

Detailed Description

A collision shape composed of many other collision shapes placed and oriented in local space.

This shape is the sum of all it's child shapes. Unlike the MultiSphereCollisionShape and the ConvexHullCollisionShape, this shape does not form a convex hull of it's children. When populating with primitives, Compound shapes offer the most flexibility with the best performace that you can get.

When deleted a CompoundCollisionShape will clean up all of it's child shapes.

Definition at line 60 of file compoundcollisionshape.h.

Constructor & Destructor Documentation

Mezzanine::Physics::CompoundCollisionShape::CompoundCollisionShape ( const String Name)

Class Constructor.

Parameters
NameThe name of this Shape.

Definition at line 56 of file compoundcollisionshape.cpp.

Mezzanine::Physics::CompoundCollisionShape::CompoundCollisionShape ( const String Name,
btCompoundShape *  BulletShape 
)

Internal Constructor.

Parameters
NameThe name of this Shape.
BulletShapeThe internal shape this shape is based on.

Definition at line 62 of file compoundcollisionshape.cpp.

Member Function Documentation

void Mezzanine::Physics::CompoundCollisionShape::AddChildShape ( CollisionShape Child,
const Vector3 ChildLocation,
const Quaternion ChildRotation 
)
virtual

Adds a shape to this compound shape.

Parameters
ChildThe shape to be added to this shape.
ChildLocationThe location this child is to have in local space.
ChildRotationThe rotation to apply to this child in local space.

Definition at line 88 of file compoundcollisionshape.cpp.

void Mezzanine::Physics::CompoundCollisionShape::AddChildShape ( CollisionShape Child,
const Vector3 ChildLocation 
)
virtual

Adds a shape to this compound shape.

Parameters
ChildThe shape to be added to this shape.
ChildLocationThe location this child is to have in local space.

Definition at line 96 of file compoundcollisionshape.cpp.

void Mezzanine::Physics::CompoundCollisionShape::AddChildShape ( CollisionShape Child,
const Transform ChildLocation 
)
virtual

Adds a shape to this compound shape.

Parameters
ChildThe shape to be added to this shape.
ChildLocationThe location and Rotation this child is to have in local space.

Definition at line 106 of file compoundcollisionshape.cpp.

btCompoundShape * Mezzanine::Physics::CompoundCollisionShape::GetBulletCompoundShape ( ) const
virtual

Definition at line 148 of file compoundcollisionshape.cpp.

CollisionShape * Mezzanine::Physics::CompoundCollisionShape::GetChild ( Whole  Index) const
virtual

Get a specific child.

Parameters
IndexA number indicating which CollisionShape you want a pointer to.
Returns
A pointer to the Specified CollisionShape

Definition at line 118 of file compoundcollisionshape.cpp.

Whole Mezzanine::Physics::CompoundCollisionShape::GetNumChildren ( ) const
virtual

Gets the number of children belonging to this compound shape.

Returns
Returns the number of children belonging to this shape.

Definition at line 113 of file compoundcollisionshape.cpp.

String Mezzanine::Physics::CompoundCollisionShape::GetSerializableName ( )
static

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

Returns
A string containing "CompoundCollisionShape"

Definition at line 222 of file compoundcollisionshape.cpp.

CollisionShape::ShapeType Mezzanine::Physics::CompoundCollisionShape::GetType ( ) const
virtual

Gets the type of Collision shape this is.

Returns
Returns an enum value indicating the type of collision shape this is.

Implements Mezzanine::Physics::CollisionShape.

Definition at line 143 of file compoundcollisionshape.cpp.

void Mezzanine::Physics::CompoundCollisionShape::ProtoDeSerialize ( const XML::Node OneNode)
virtual

Reimplemented from Mezzanine::Physics::CollisionShape.

Definition at line 182 of file compoundcollisionshape.cpp.

void Mezzanine::Physics::CompoundCollisionShape::ProtoSerialize ( XML::Node CurrentRoot) const
virtual

Reimplemented from Mezzanine::Physics::CollisionShape.

Definition at line 151 of file compoundcollisionshape.cpp.

void Mezzanine::Physics::CompoundCollisionShape::RemoveChildShape ( CollisionShape Child)
virtual

Removes a Child shape from this compound shape.

Parameters
ChildThe child shape to be removed.

Definition at line 123 of file compoundcollisionshape.cpp.

void Mezzanine::Physics::CompoundCollisionShape::RemoveChildShape ( const Whole ChildIndex)
virtual

Removed a Child shape from this compound shape by index.

Parameters
ChildIndexThe index of the child shape to be removed.

Definition at line 136 of file compoundcollisionshape.cpp.


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