A physics shape comprised of multiple sphere's placed in local space. More...
#include <collisionshape.h>
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 String & | GetName () 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... | |
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. | |
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.
Mezzanine::Physics::MultiSphereCollisionShape::MultiSphereCollisionShape | ( | const String & | Name, |
const std::vector< Vector3 > & | Locations, | ||
const std::vector< Real > & | Radii | ||
) |
Class Constructor.
Name | The name of this Shape. |
Definition at line 83 of file multispherecollisionshape.cpp.
Mezzanine::Physics::MultiSphereCollisionShape::MultiSphereCollisionShape | ( | const String & | Name, |
btMultiSphereShape * | BulletShape | ||
) |
Internal Constructor.
Name | The name of this Shape. |
BulletShape | The internal shape this shape is based on. |
Definition at line 88 of file multispherecollisionshape.cpp.
Mezzanine::Physics::MultiSphereCollisionShape::MultiSphereCollisionShape | ( | XML::Node | OneNode | ) |
DeSerializing Constructor.
OneNode | The node to use for constructing this shape |
Definition at line 94 of file multispherecollisionshape.cpp.
|
protected |
Creates a btMultiSphereShape* from two vectors to help unify constructor logic.
Name | The name of this name |
Locations | An std::vector containing all the locations, this must have the same amount of locations as there are radii |
Radii | An std::vector containing all the Radiuses, this must have the same amount of radii as there are locations |
An | out of bounds exception if the there are differing amounts of radii and locations. |
Definition at line 56 of file multispherecollisionshape.cpp.
|
protected |
Constructs the shape when the bullet is already prepared.
BulletShape | The bullet shape to use |
Name | The name of this name |
Definition at line 75 of file multispherecollisionshape.cpp.
|
virtual |
Definition at line 150 of file multispherecollisionshape.cpp.
|
virtual |
Gets the number of spheres contained within this shape.
Definition at line 140 of file multispherecollisionshape.cpp.
|
static |
Get the name of the the XML tag this class will leave behind as its instances are serialized.
Definition at line 201 of file multispherecollisionshape.cpp.
|
virtual |
Gets the location(in local space) of the sphere at the specified index.
Index | The index of the desired sphere. |
Definition at line 129 of file multispherecollisionshape.cpp.
|
virtual |
Gets the radius of the sphere at the specified index.
Index | The index of the desired sphere. |
Definition at line 135 of file multispherecollisionshape.cpp.
|
virtual |
Gets the type of Collision shape this is.
Implements Mezzanine::Physics::PrimitiveCollisionShape.
Definition at line 145 of file multispherecollisionshape.cpp.
|
virtual |
Reimplemented from Mezzanine::Physics::PrimitiveCollisionShape.
Definition at line 182 of file multispherecollisionshape.cpp.
|
virtual |
Reimplemented from Mezzanine::Physics::PrimitiveCollisionShape.
Definition at line 153 of file multispherecollisionshape.cpp.