40 #ifndef _physicscompoundcollisionshape_cpp
41 #define _physicscompoundcollisionshape_cpp
43 #include "Physics/compoundcollisionshape.h"
44 #include "collisionshapemanager.h"
45 #include "stringtool.h"
47 #include <btBulletDynamicsCommon.h>
68 for(
Whole X = 0 ; X < NumChildren ; X++ )
98 btTransform ChildTrans;
99 ChildTrans.setIdentity();
125 for( std::vector<CollisionShape*>::iterator CSit =
ChildShapes.begin() ; CSit !=
ChildShapes.end() ; CSit++ )
138 std::vector<CollisionShape*>::iterator CSit =
ChildShapes.begin() + ChildIndex;
149 {
return static_cast<btCompoundShape*
>(
ShapeBase); }
200 if(
String(ChildNode.
Name())==
"ChildShapeFromManager")
223 {
return String(
"CompoundCollisionShape"); }
std::ostream & operator<<(std::ostream &stream, const Mezzanine::LinearInterpolator< T > &Lint)
Used to Serialize an Mezzanine::LinearInterpolator to a human readable stream.
This is the base class for all collision shapes.
virtual void ProtoDeSerialize(const XML::Node &OneNode)
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
A light-weight handle for manipulating attributes in DOM tree.
virtual void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
CompoundCollisionShape(const String &Name)
Class Constructor.
CollisionShape * CreateShape(CollisionShape::ShapeType ShapeToCreate, const String &Name_, btCollisionShape *ShapeToModel)
Create A shape of a type and optionally model it after an example.
virtual Whole GetNumChildren() const
Gets the number of children belonging to this compound shape.
Node GetFirstChild() const
Get the first child Node of this Node.
std::ostream & Serialize(std::ostream &Stream, const T &Converted, const String &Indent=String(""))
Convert any class that supports serialization or has a serializer to a string of chars in a stream...
const Char8 * AsString(const Char8 *def="") const
Attempts to convert the value of the attribute to a String and returns the results.
std::vector< CollisionShape * > ChildShapes
Storage for Child shapes.
virtual void ProtoSerialize(XML::Node &CurrentRoot) const
virtual btCollisionShape * _GetInternalShape() const
Gets the internal shape pointer this collision shape is based on.
virtual CollisionShape * GetChild(Whole Index) const
Get a specific child.
Node GetNextSibling() const
Attempt to retrieve the next sibling of this Node.
Indicates the class is a CompoundCollisionShape.
btQuaternion GetBulletQuaternion(Boole normalize=false) const
Gets a Bullet quaternion.
virtual btCompoundShape * GetBulletCompoundShape() const
bool SetValue(const Char8 *rhs)
Set the value of this.
static CollisionShapeManager * GetSingletonPtr()
Fetches a pointer to the singleton.
virtual void AddChildShape(CollisionShape *Child, const Vector3 &ChildLocation, const Quaternion &ChildRotation)
Adds a shape to this compound shape.
btVector3 GetBulletVector3() const
Gets a Bullet vector3.
A light-weight handle for manipulating nodes in DOM tree.
static String GetSerializableName()
Get the name of the the XML tag this class will leave behind as its instances are serialized...
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
virtual CollisionShape::ShapeType GetType() const
Gets the type of Collision shape this is.
ShapeType
This enum describes what kind of shape you are currently working with.
std::istream & DeSerialize(std::istream &Stream, T &Converted)
Deserialize the next xml tag in the stream into a specific in memory class instance.
virtual void ProtoDeSerialize(const XML::Node &OneNode)
Take the data stored in an XML and overwrite this instance of this object with it.
void DeSerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
virtual ~CompoundCollisionShape()
Class Destructor.
This is used to represent a point in space, or a vector through space.
virtual void RemoveChildShape(CollisionShape *Child)
Removes a Child shape from this compound shape.
String Name
Storage for the name of this class instance.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
std::istream & operator>>(std::istream &stream, Mezzanine::LinearInterpolator< T > &Lint)
Used to de-serialize an Mezzanine::LinearInterpolator from a stream.
btCollisionShape * ShapeBase
A pointer to the bullet collision this uses.
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
CollisionShape::ShapeType InternalShapeTypeToShapeType(int InternalShapeType)
Convert from a Internal Collision Shape to a CollisionShape::ShapeType.
This is used to store information about rotation in 3d space.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
std::string String
A datatype used to a series of characters.
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
A collision shape composed of many other collision shapes placed and oriented in local space...
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.
virtual const String & GetName() const
Gets the name of this shape.