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

A box physics shape. More...

#include <collisionshape.h>

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

Public Member Functions

 BoxCollisionShape (const String &Name, const Vector3 &HalfExtents)
 Class Constructor. More...
 
 BoxCollisionShape (const String &Name, btBoxShape *BulletShape)
 Internal Constructor. More...
 
 BoxCollisionShape (XML::Node OneNode)
 DeSerializing Constructor. More...
 
virtual ~BoxCollisionShape ()
 Class Destructor.
 
virtual btBoxShape * GetBulletBoxShape () const
 
virtual Vector3 GetCleanHalfExtents () const
 Gets the half extents used to construct this box. More...
 
virtual Vector3 GetHalfExtents () const
 Gets the current half extents used in collision checking. More...
 
virtual Vector3 GetHalfExtentsWithMargin () const
 Gets the half extents with padding, this is the size the shape will appear to be. More...
 
virtual CollisionShape::ShapeType GetType () const
 Gets the type of Collision shape this is. More...
 
virtual bool IsInside (const Vector3 &Location, const Real &Tolerance) const
 Checks to see if a point in local space is inside this shape. 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...
 

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 Member Functions inherited from Mezzanine::Physics::PrimitiveCollisionShape
void SetPointers (btConvexInternalShape *Shape)
 Sets the internal pointers on the base classes.
 
- 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 box physics shape.

This is exactly what it sounds like. A primitive shape of a box that is constructed by it's half extents. Half extents can't be negative, but otherwise can be any value. The margin value is subtracted from the total size rather than added for this shape.

Warning
This does not fully implement ProtoDeSerialize, this must be deserialized with the Appropriate Deserializer.

Definition at line 60 of file boxcollisionshape.h.

Constructor & Destructor Documentation

Mezzanine::Physics::BoxCollisionShape::BoxCollisionShape ( const String Name,
const Vector3 HalfExtents 
)

Class Constructor.

Parameters
NameThe name of this shape.
HalfExtentsA vector3 representing half the shapes size on each axis.

Definition at line 56 of file boxcollisionshape.cpp.

Mezzanine::Physics::BoxCollisionShape::BoxCollisionShape ( const String Name,
btBoxShape *  BulletShape 
)

Internal Constructor.

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

Definition at line 62 of file boxcollisionshape.cpp.

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

DeSerializing Constructor.

Parameters
OneNodeThe node to use for constructing this shape

Definition at line 68 of file boxcollisionshape.cpp.

Member Function Documentation

btBoxShape * Mezzanine::Physics::BoxCollisionShape::GetBulletBoxShape ( ) const
virtual

Definition at line 118 of file boxcollisionshape.cpp.

Vector3 Mezzanine::Physics::BoxCollisionShape::GetCleanHalfExtents ( ) const
virtual

Gets the half extents used to construct this box.

Returns
Returns a vector3 containing the half extents of this box, with no scaling or margin (Original value).

Definition at line 93 of file boxcollisionshape.cpp.

Vector3 Mezzanine::Physics::BoxCollisionShape::GetHalfExtents ( ) const
virtual

Gets the current half extents used in collision checking.

Returns
Returns a vector3 containing the half extents of this box, with scaling applied, minus the size of the margin(Original value * Scaling - margin).

Definition at line 98 of file boxcollisionshape.cpp.

Vector3 Mezzanine::Physics::BoxCollisionShape::GetHalfExtentsWithMargin ( ) const
virtual

Gets the half extents with padding, this is the size the shape will appear to be.

Returns
Returns a vector3 containing the half extents, with scaling applied, with the margin added to each axis (Original value * Scaling).

Definition at line 103 of file boxcollisionshape.cpp.

CollisionShape::ShapeType Mezzanine::Physics::BoxCollisionShape::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 113 of file boxcollisionshape.cpp.

bool Mezzanine::Physics::BoxCollisionShape::IsInside ( const Vector3 Location,
const Real Tolerance 
) const
virtual

Checks to see if a point in local space is inside this shape.

Returns
Returns a bool indicating whether or not the specified point is inside the shape.
Parameters
LocationThe specified point to perform the check.
ToleranceThe amount of leeway to give in the check. If the distance from the specified point is equal or less then the Tolerance provided then this will return true.

Definition at line 108 of file boxcollisionshape.cpp.

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

Reimplemented from Mezzanine::Physics::PrimitiveCollisionShape.

Definition at line 142 of file boxcollisionshape.cpp.

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

Reimplemented from Mezzanine::Physics::PrimitiveCollisionShape.

Definition at line 121 of file boxcollisionshape.cpp.

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

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

Returns
A string containing "BoxCollisionShape"

Definition at line 160 of file boxcollisionshape.cpp.


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