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

A capsule physics shape. More...

#include <collisionshape.h>

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

Public Member Functions

 CapsuleCollisionShape (const String &Name, const Real &Radius, const Real &Height, const Vector3 &UpAxis)
 Class Constructor. More...
 
 CapsuleCollisionShape (const String &Name, const Real &Radius, const Real &Height, StandardAxis UpAxis)
 Class Constructor. More...
 
 CapsuleCollisionShape (XML::Node OneNode)
 DeSerializing Constructor. More...
 
 CapsuleCollisionShape (const String &Name, btCapsuleShape *BulletShape)
 Internal Constructor. More...
 
virtual ~CapsuleCollisionShape ()
 Class Destructor.
 
virtual btCapsuleShape * GetBulletCapsuleShape () const
 
virtual Real GetCleanHeight () const
 Gets the height of the capsule, as the original value passed, without scaling and margin applied. More...
 
virtual Real GetCleanRadius () const
 Gets the radius of the capsule, as the original value passed, without scaling and margin applied. More...
 
virtual Real GetHeight () const
 Gets the height of the capsule, as used in collision checking, with scaling and margin subtracted. More...
 
virtual Real GetRadius () const
 Gets the radius of the capsule, as used in collision checking, with scaling and margin subtracted. More...
 
virtual CollisionShape::ShapeType GetType () const
 Gets the type of Collision shape this is. More...
 
virtual Vector3 GetUpAxis () const
 Gets which axis this capsule is oriented along. More...
 
virtual StandardAxis GetUpStandardAxis () const
 Gets which axis this capsule is oriented along. More...
 
virtual void ProtoDeSerialize (const XML::Node &OneNode)
 
virtual void ProtoSerialize (XML::Node &CurrentRoot) const
 
- Public Member Functions inherited from Mezzanine::Physics::PrimitiveCollisionShape
 PrimitiveCollisionShape ()
 Class Constructor.
 
virtual ~PrimitiveCollisionShape ()
 Class Destructor.
 
virtual btConvexInternalShape * GetBulletConvexShape () const
 
- 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 SerializableName ()
 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::PrimitiveCollisionShape
static String SerializableName ()
 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 SerializableName ()
 Get the name of the the XML tag this class will leave behind as its instances are serialized. More...
 

Protected Member Functions

void Construct (const String &Name, const Real &Radius, const Real &Height, StandardAxis UpAxis)
 Performed share contructor work. More...
 
- Protected Member Functions inherited from Mezzanine::Physics::PrimitiveCollisionShape
void SetPointers (btConvexInternalShape *Shape)
 Sets the internal pointers on the base classes.
 

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...
 
- 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.
 

Detailed Description

A capsule physics shape.

This shape is commonly used for characters. Keep in mind the total height of any capsule is height+2*radius, since the height provided only applies to the cylinder portion of the capsule. Like Cones and Cylinders, Capsules can be aligned to any of the 3 linear axes(X, Y, or Z).

Definition at line 60 of file capsulecollisionshape.h.

Constructor & Destructor Documentation

Mezzanine::Physics::CapsuleCollisionShape::CapsuleCollisionShape ( const String Name,
const Real Radius,
const Real Height,
const Vector3 UpAxis 
)

Class Constructor.

Parameters
NameThe name of this Shape.
RadiusThe radius of the capsule.
HeightThe height of the cylindrical portion of the capsule. Total height would be Height+2*radius.
UpAxisWhich axis the Capsule is to be oriented along. Typical usage is for a capsule to be oriented on the Y axis(0,1,0), which would make it stand upright.

Definition at line 67 of file capsulecollisionshape.cpp.

Mezzanine::Physics::CapsuleCollisionShape::CapsuleCollisionShape ( const String Name,
const Real Radius,
const Real Height,
StandardAxis  UpAxis 
)

Class Constructor.

Parameters
NameThe name of this Shape.
RadiusThe radius of the capsule.
HeightThe height of the cylindrical portion of the capsule. Total height would be Height+2*radius.
UpAxisWhich axis the Capsule is to be oriented along. Uses StandardAxis enum, Axis_Y to make a vertical capsule

Definition at line 70 of file capsulecollisionshape.cpp.

Mezzanine::Physics::CapsuleCollisionShape::CapsuleCollisionShape ( XML::Node  OneNode)

DeSerializing Constructor.

Parameters
OneNodeThe node to use for constructing this shape

Definition at line 73 of file capsulecollisionshape.cpp.

Mezzanine::Physics::CapsuleCollisionShape::CapsuleCollisionShape ( const String Name,
btCapsuleShape *  BulletShape 
)

Internal Constructor.

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

Definition at line 100 of file capsulecollisionshape.cpp.

Member Function Documentation

void Mezzanine::Physics::CapsuleCollisionShape::Construct ( const String Name,
const Real Radius,
const Real Height,
StandardAxis  UpAxis 
)
protected

Performed share contructor work.

Parameters
NameThe name of this Shape.
RadiusThe radius of the capsule.
HeightThe height of the cylindrical portion of the capsule. Total height would be Height+2*radius.
UpAxisWhich axis the Capsule is to be oriented along. Typical usage is for a capsule to be oriented on the Y axis(0,1,0), which would make it stand upright.

Definition at line 56 of file capsulecollisionshape.cpp.

btCapsuleShape * Mezzanine::Physics::CapsuleCollisionShape::GetBulletCapsuleShape ( ) const
virtual

Definition at line 136 of file capsulecollisionshape.cpp.

Real Mezzanine::Physics::CapsuleCollisionShape::GetCleanHeight ( ) const
virtual

Gets the height of the capsule, as the original value passed, without scaling and margin applied.

Returns
Returns a real representing the length of the cylindrical portion of the capsule.

Definition at line 119 of file capsulecollisionshape.cpp.

Real Mezzanine::Physics::CapsuleCollisionShape::GetCleanRadius ( ) const
virtual

Gets the radius of the capsule, as the original value passed, without scaling and margin applied.

Returns
Returns a real representing the radius of the capsule.

Definition at line 116 of file capsulecollisionshape.cpp.

Real Mezzanine::Physics::CapsuleCollisionShape::GetHeight ( ) const
virtual

Gets the height of the capsule, as used in collision checking, with scaling and margin subtracted.

Returns
Returns a real representing the length of the cylindrical portion of the capsule.

Definition at line 113 of file capsulecollisionshape.cpp.

Real Mezzanine::Physics::CapsuleCollisionShape::GetRadius ( ) const
virtual

Gets the radius of the capsule, as used in collision checking, with scaling and margin subtracted.

Returns
Returns a real representing the radius of the capsule.

Definition at line 111 of file capsulecollisionshape.cpp.

CollisionShape::ShapeType Mezzanine::Physics::CapsuleCollisionShape::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::PrimitiveCollisionShape.

Definition at line 131 of file capsulecollisionshape.cpp.

Vector3 Mezzanine::Physics::CapsuleCollisionShape::GetUpAxis ( ) const
virtual

Gets which axis this capsule is oriented along.

Returns
Returns a Vector3 representing which local axis is oriented along the world up axis.

Definition at line 125 of file capsulecollisionshape.cpp.

StandardAxis Mezzanine::Physics::CapsuleCollisionShape::GetUpStandardAxis ( ) const
virtual

Gets which axis this capsule is oriented along.

Returns
Returns a StandardAxis representing which local axis is oriented along the world up axis.

Definition at line 128 of file capsulecollisionshape.cpp.

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

Reimplemented from Mezzanine::Physics::PrimitiveCollisionShape.

Definition at line 171 of file capsulecollisionshape.cpp.

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

Reimplemented from Mezzanine::Physics::PrimitiveCollisionShape.

Definition at line 139 of file capsulecollisionshape.cpp.

String Mezzanine::Physics::CapsuleCollisionShape::SerializableName ( )
static

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

Returns
A string containing "CapsuleCollisionShape"

Definition at line 189 of file capsulecollisionshape.cpp.


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