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

A simple convex shape built from a low number of points in local space. More...

#include <collisionshape.h>

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

Public Member Functions

 ConvexHullCollisionShape (const String &Name, const std::vector< Vector3 > &Points)
 Class Constructor. More...
 
 ConvexHullCollisionShape (const String &Name, btConvexHullShape *BulletShape)
 Internal Constructor. More...
 
 ConvexHullCollisionShape (XML::Node OneNode)
 DeSerializing Constructor. More...
 
virtual ~ConvexHullCollisionShape ()
 Class Destructor.
 
virtual void AddPoint (const Vector3 &Point)
 Adds a point to this shape. More...
 
virtual btConvexHullShape * GetBulletHullShape () const
 
virtual Whole GetNumPoints () const
 Gets the total number of points being stored in this shape. More...
 
virtual Vector3 GetPoint (const Whole &Index) const
 Gets a stored point as it is scaled in this ConvexHull. More...
 
virtual CollisionShape::ShapeType GetType () const
 Gets the type of Collision shape this is. More...
 
virtual Vector3 GetUnscaledPoint (const Whole &Index) const
 Gets an unscaled stored point in this ConvexHull. More...
 
virtual Boole 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 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::PrimitiveCollisionShape
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...
 

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 simple convex shape built from a low number of points in local space.

A convex hull is commonly used to generate a simple approximation of another, and more complicated, shape. Usually the number of points in a convex hull doesn't exceed 32.

When a convex hull is generated automatically from an algorithm, the best way to think of the resulting shape in relation to the original shape is if you were to wrap a rubber band around it on one plane. Then do this for all planes and all surfaces. The resulting shape looks and behaves similar to that.

Definition at line 62 of file convexhullcollisionshape.h.

Constructor & Destructor Documentation

Mezzanine::Physics::ConvexHullCollisionShape::ConvexHullCollisionShape ( const String Name,
const std::vector< Vector3 > &  Points 
)

Class Constructor.

Parameters
NameThe name of this Shape.
PointsA vector of vector3's containing all the points in local space to construct this shape from.

Definition at line 56 of file convexhullcollisionshape.cpp.

Mezzanine::Physics::ConvexHullCollisionShape::ConvexHullCollisionShape ( const String Name,
btConvexHullShape *  BulletShape 
)

Internal Constructor.

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

Definition at line 72 of file convexhullcollisionshape.cpp.

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

DeSerializing Constructor.

Parameters
OneNodeThe node to use for constructing this shape

Definition at line 79 of file convexhullcollisionshape.cpp.

Member Function Documentation

void Mezzanine::Physics::ConvexHullCollisionShape::AddPoint ( const Vector3 Point)
virtual

Adds a point to this shape.

Parameters
PointThe location in local space to be added.

Definition at line 101 of file convexhullcollisionshape.cpp.

btConvexHullShape * Mezzanine::Physics::ConvexHullCollisionShape::GetBulletHullShape ( ) const
virtual

Definition at line 132 of file convexhullcollisionshape.cpp.

Whole Mezzanine::Physics::ConvexHullCollisionShape::GetNumPoints ( void  ) const
virtual

Gets the total number of points being stored in this shape.

Returns
Returns a whole representing the current number of points in this shape.

Definition at line 117 of file convexhullcollisionshape.cpp.

Vector3 Mezzanine::Physics::ConvexHullCollisionShape::GetPoint ( const Whole Index) const
virtual

Gets a stored point as it is scaled in this ConvexHull.

Returns
Returns a Vector3 representing the scaled location in local space of the specified point.
Parameters
IndexThe index of the point desired.

Definition at line 112 of file convexhullcollisionshape.cpp.

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

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

Returns
A string containing "ConeCollisionShape"

Definition at line 187 of file convexhullcollisionshape.cpp.

CollisionShape::ShapeType Mezzanine::Physics::ConvexHullCollisionShape::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 127 of file convexhullcollisionshape.cpp.

Vector3 Mezzanine::Physics::ConvexHullCollisionShape::GetUnscaledPoint ( const Whole Index) const
virtual

Gets an unscaled stored point in this ConvexHull.

Returns
Returns a Vector3 representing the unscaled location in local space of the specified point.
Parameters
IndexThe index of the point desired.

Definition at line 106 of file convexhullcollisionshape.cpp.

Boole Mezzanine::Physics::ConvexHullCollisionShape::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 Boole 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 Tolorance provided then this will return true.

Definition at line 122 of file convexhullcollisionshape.cpp.

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

Reimplemented from Mezzanine::Physics::PrimitiveCollisionShape.

Definition at line 157 of file convexhullcollisionshape.cpp.

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

Reimplemented from Mezzanine::Physics::PrimitiveCollisionShape.

Definition at line 135 of file convexhullcollisionshape.cpp.


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