40 #ifndef _physicsconecollisionshape_cpp
41 #define _physicsconecollisionshape_cpp
43 #include "Physics/conecollisionshape.h"
44 #include "collisionshapemanager.h"
45 #include "stringtool.h"
47 #include "btBulletDynamicsCommon.h"
59 btConeShape* ConeShape;
60 if(
Axis_Y == UpAxis) ConeShape =
new btConeShape(Radius,Height);
61 else if(
Axis_X == UpAxis) ConeShape =
new btConeShapeX(Radius,Height);
62 else if(
Axis_Z == UpAxis) ConeShape =
new btConeShapeZ(Radius,Height);
99 {
Construct(Name, Radius, Height, UpAxis); }
174 {
return static_cast<btConeShape*
>(
ShapeBase); }
233 {
return String(
"ConeCollisionShape"); }
std::ostream & operator<<(std::ostream &stream, const Mezzanine::LinearInterpolator< T > &Lint)
Used to Serialize an Mezzanine::LinearInterpolator to a human readable stream.
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
virtual void ProtoDeSerialize(const XML::Node &OneNode)
Take the data stored in an XML and overwrite this instance of this object with it.
A light-weight handle for manipulating attributes in DOM tree.
Indicates the class is a ConeCollisionShape.
StandardAxis
Used to identify different Axis in a 3d coordinate system.
virtual void ProtoDeSerialize(const XML::Node &OneNode)
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
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...
Real GetHeightScaling() const
Which axis is up defines which axis is used to scale height.
virtual Vector3 GetScaling() const
Gets the current scaling being applied to the collision shape.
static String GetSerializableName()
Get the name of the the XML tag this class will leave behind as its instances are serialized...
const Char8 * AsString(const Char8 *def="") const
Attempts to convert the value of the attribute to a String and returns the results.
virtual Real GetRadius() const
Gets the radius of the cone, as used for collision checking.
static String GetSerializableName()
Get the name of the the XML tag this class will leave behind as its instances are serialized...
virtual void ProtoSerialize(XML::Node &CurrentRoot) const
float Real
A Datatype used to represent a real floating point number.
virtual Real GetCleanRadius() const
Gets the radius of the cone, as originally passed in.
bool SetValue(const Char8 *rhs)
Set the value of this.
virtual CollisionShape::ShapeType GetType() const
Gets the type of Collision shape this is.
virtual Vector3 GetUpAxis() const
Gets which axis this cone is oriented along.
A light-weight handle for manipulating nodes in DOM tree.
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
void Construct(const String &Name, const Real &Radius, const Real &Height, StandardAxis UpAxis)
Performe shared contructor work.
ShapeType
This enum describes what kind of shape you are currently working with.
Integer AsInteger(Integer def=0) const
Attempts to convert the value of the attribute to a Integer and returns the results.
Real AsReal(Real def=0) const
Attempts to convert the value of the attribute to a Real and returns the results. ...
virtual ~ConeCollisionShape()
Class Destructor.
Real GetRadiusScaling() const
Which axis is up defines which 2 axis are used to scale the radius.
virtual Real GetCleanHeight() const
Gets the height of the cone, as originally passed in.
std::istream & DeSerialize(std::istream &Stream, T &Converted)
Deserialize the next xml tag in the stream into a specific in memory class instance.
void DeSerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
Thrown when parameters are checked at runtime and found invalid.
virtual StandardAxis GetUpStandardAxis() const
Gets which axis this cone is oriented along.
ConeCollisionShape(const String &Name, const Real &Radius, const Real &Height, const Vector3 &UpAxis)
Class Constructor.
virtual void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
This is used to represent a point in space, or a vector through space.
void SetPointers(btConvexInternalShape *Shape)
Sets the internal pointers on the base classes.
virtual btConeShape * GetBulletConeShape() const
Gets a pointer to the upcasted internal shape.
String Name
Storage for the name of this class instance.
The bulk of the engine components go in this namspace.
std::istream & operator>>(std::istream &stream, Mezzanine::LinearInterpolator< T > &Lint)
Used to de-serialize an Mezzanine::LinearInterpolator from a stream.
static Vector3 UnitOnAxis(StandardAxis Axis)
Get a Unit Vector along the given Axis.
virtual Real GetHeight() const
Gets the height of the cone, as used for collision checking.
btCollisionShape * ShapeBase
A pointer to the bullet collision this uses.
Vector3 GetAxisMathBS() const
Simulate some messed up the physics library does.
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
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.
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.
StandardAxis IsStandardUnitAxis() const
Get a Unit Vector along the given Axis.