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::MultiSphereCollisionShape Class Reference

A physics shape comprised of multiple sphere's placed in local space. More...

#include <collisionshape.h>

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

Public Member Functions

 MultiSphereCollisionShape (const String &Name, const std::vector< Vector3 > &Locations, const std::vector< Real > &Radii)
 Class Constructor. More...
 
 MultiSphereCollisionShape (const String &Name, btMultiSphereShape *BulletShape)
 Internal Constructor. More...
 
 MultiSphereCollisionShape (XML::Node OneNode)
 DeSerializing Constructor. More...
 
virtual ~MultiSphereCollisionShape ()
 Class Destructor.
 
virtual btMultiSphereShape * GetMultiSphereShape () const
 
virtual Whole GetNumSpheres () const
 Gets the number of spheres contained within this shape. More...
 
virtual Vector3 GetSphereLocation (const Whole &Index) const
 Gets the location(in local space) of the sphere at the specified index. More...
 
virtual Real GetSphereRadius (const Whole &Index) const
 Gets the radius of the sphere at the specified index. 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
 
- 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 std::vector< Vector3 > &Locations, const std::vector< Real > &Radii)
 Creates a btMultiSphereShape* from two vectors to help unify constructor logic. More...
 
void Construct (const String &Name, btMultiSphereShape *BulletShape)
 Constructs the shape when the bullet is already prepared. 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 physics shape comprised of multiple sphere's placed in local space.

It's important to note that this shape isn't just a bunch of placed sphere's, but a convex hull comprised of all the provided sphere's. You can make a capsule shape with two sphere's, one above the other(internally this is how it works).

Definition at line 59 of file multispherecollisionshape.h.

Constructor & Destructor Documentation

Mezzanine::Physics::MultiSphereCollisionShape::MultiSphereCollisionShape ( const String Name,
const std::vector< Vector3 > &  Locations,
const std::vector< Real > &  Radii 
)

Class Constructor.

Parameters
NameThe name of this Shape.

Definition at line 83 of file multispherecollisionshape.cpp.

Mezzanine::Physics::MultiSphereCollisionShape::MultiSphereCollisionShape ( const String Name,
btMultiSphereShape *  BulletShape 
)

Internal Constructor.

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

Definition at line 88 of file multispherecollisionshape.cpp.

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

DeSerializing Constructor.

Parameters
OneNodeThe node to use for constructing this shape

Definition at line 94 of file multispherecollisionshape.cpp.

Member Function Documentation

void Mezzanine::Physics::MultiSphereCollisionShape::Construct ( const String Name,
const std::vector< Vector3 > &  Locations,
const std::vector< Real > &  Radii 
)
protected

Creates a btMultiSphereShape* from two vectors to help unify constructor logic.

Parameters
NameThe name of this name
LocationsAn std::vector containing all the locations, this must have the same amount of locations as there are radii
RadiiAn std::vector containing all the Radiuses, this must have the same amount of radii as there are locations
Exceptions
Anout of bounds exception if the there are differing amounts of radii and locations.

Definition at line 56 of file multispherecollisionshape.cpp.

void Mezzanine::Physics::MultiSphereCollisionShape::Construct ( const String Name,
btMultiSphereShape *  BulletShape 
)
protected

Constructs the shape when the bullet is already prepared.

Parameters
BulletShapeThe bullet shape to use
NameThe name of this name

Definition at line 75 of file multispherecollisionshape.cpp.

btMultiSphereShape * Mezzanine::Physics::MultiSphereCollisionShape::GetMultiSphereShape ( ) const
virtual

Definition at line 150 of file multispherecollisionshape.cpp.

Whole Mezzanine::Physics::MultiSphereCollisionShape::GetNumSpheres ( ) const
virtual

Gets the number of spheres contained within this shape.

Returns
Returns a Whole representing the number of spheres in this shape.

Definition at line 140 of file multispherecollisionshape.cpp.

Vector3 Mezzanine::Physics::MultiSphereCollisionShape::GetSphereLocation ( const Whole Index) const
virtual

Gets the location(in local space) of the sphere at the specified index.

Returns
Returns a vector3 representing the location of the specified sphere.
Parameters
IndexThe index of the desired sphere.

Definition at line 129 of file multispherecollisionshape.cpp.

Real Mezzanine::Physics::MultiSphereCollisionShape::GetSphereRadius ( const Whole Index) const
virtual

Gets the radius of the sphere at the specified index.

Returns
Returns a Real representing the radius of the specified sphere.
Parameters
IndexThe index of the desired sphere.

Definition at line 135 of file multispherecollisionshape.cpp.

CollisionShape::ShapeType Mezzanine::Physics::MultiSphereCollisionShape::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 145 of file multispherecollisionshape.cpp.

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

Reimplemented from Mezzanine::Physics::PrimitiveCollisionShape.

Definition at line 182 of file multispherecollisionshape.cpp.

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

Reimplemented from Mezzanine::Physics::PrimitiveCollisionShape.

Definition at line 153 of file multispherecollisionshape.cpp.

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

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

Returns
A string containing "MultiSphereCollisionShape"

Definition at line 201 of file multispherecollisionshape.cpp.


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