MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::Physics::RigidProxy Class Reference

This is a proxy from which rigid body proxys are handled. More...

#include <rigidproxy.h>

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

Public Member Functions

 RigidProxy (const Real Mass, PhysicsManager *Creator)
 Standard Constructor. More...
 
 RigidProxy (const XML::Node &SelfRoot, PhysicsManager *Creator)
 XML constructor. More...
 
virtual ~RigidProxy ()
 Class Destructor.
 
virtual btCollisionObject * _GetBasePhysicsObject () const
 Accessor for the internal physics object. More...
 
virtual btRigidBody * _GetPhysicsObject () const
 Accessor for the internal rigid body physics proxy. More...
 
virtual void AddSyncObject (TransformableObject *ToBeAdded)
 Adds a TransformableObject that will force it's transform to sync with this RigidProxy. More...
 
virtual void AddToWorld ()
 Performs all the necessary task to ensure this object is connected to it's respective world and ready for use. More...
 
virtual void ApplyForce (const Vector3 &Force)
 Push/Apply force to an proxy. More...
 
virtual void ApplyTorque (const Vector3 &Torque)
 Spin/Apply torque to an proxy. More...
 
virtual Real GetAngularDamping () const
 Get the Angular damping. More...
 
virtual Vector3 GetAngularMovementFactor () const
 Gets the current angular factors being applied to this actor. More...
 
virtual Vector3 GetAngularVelocity () const
 Gets the Angular Velocity of this proxy. More...
 
virtual Vector3 GetAppliedForce () const
 Get the total Force currently being applied to this proxy. More...
 
virtual Vector3 GetAppliedTorque () const
 Get the total Torque currently being applied to this proxy. More...
 
virtual String GetDerivedSerializableName () const
 Gets the most derived serializable name of this WorldProxy. More...
 
virtual Vector3 GetGravity () const
 Gets the gravity being applied to this proxy. More...
 
virtual Real GetLinearDamping () const
 Get the linear damping. More...
 
virtual Vector3 GetLinearMovementFactor () const
 Gets the current linear factors being applied to this actor. More...
 
virtual Vector3 GetLinearVelocity () const
 Gets the Linear Velocity of this proxy. More...
 
virtual Real GetMass () const
 Get the total Mass of the proxy. More...
 
virtual UInt32 GetNumSyncObjects () const
 Gets the number of WorldProxies being sync'd to this RigidProxy. More...
 
virtual Mezzanine::ProxyType GetProxyType () const
 Accessor for the type of proxy. More...
 
virtual TransformableObjectGetSyncObject (const UInt32 Index) const
 Gets a TransformableObject being sync'd to this RigidProxy by it's index. More...
 
virtual void ProtoDeSerializeProperties (const XML::Node &SelfRoot)
 Take the data stored in an XML Node and overwrite the properties of this object with it. More...
 
virtual void ProtoSerializeProperties (XML::Node &SelfRoot) const
 Convert the properties of this class to an XML::Node ready for serialization. More...
 
virtual void RemoveAllSyncObjects ()
 Removes all WorldProxies being sync'd to this RigidProxy.
 
virtual void RemoveFromWorld ()
 Unhooks this proxy from it's respective world. More...
 
virtual void RemoveSyncObject (TransformableObject *ToBeRemoved)
 Removes a proxy being sync'd, so it will no longer match it's transform with this RigidProxy. More...
 
virtual void SetAngularMovementFactor (const Vector3 &Factor)
 Restricts movement on the axis or axes of your choice. More...
 
virtual void SetAngularVelocity (const Vector3 &AngVel)
 Sets the Angular Velocity of this proxy. More...
 
virtual void SetCollisionShape (CollisionShape *Shape)
 Sets the collision shape to be used. More...
 
virtual void SetDamping (const Real LinDamping, const Real AngDamping)
 Sets the Damping for this proxy. More...
 
virtual void SetGravity (const Vector3 &Gravity)
 Sets the gravity for only this proxy. More...
 
virtual void SetLinearMovementFactor (const Vector3 &Factor)
 Restricts movement on the axis or axies of your choice. More...
 
virtual void SetLinearVelocity (const Vector3 &LinVel)
 Sets the Linear Velocity of this proxy. More...
 
virtual void SetMass (const Real Mass)
 Change the mass of the proxy. More...
 
- Public Member Functions inherited from Mezzanine::Physics::CollidableProxy
 CollidableProxy (PhysicsManager *Creator)
 Standard Constructor. More...
 
virtual ~CollidableProxy ()
 Class Destructor.
 
virtual Integer _GetBroadphaseUniqueID () const
 Gets the unique ID assigned to the internal object. More...
 
virtual Real _GetContactProcessingThreshold () const
 Gets the maximum distance to be considered for processing collisions with this object. More...
 
virtual void _SetContactProcessingThreshold (const Real Threshold)
 Sets the maximum distance to be considered for processing collisions with this object. More...
 
virtual AxisAlignedBox GetAABB () const
 Gets this proxies AABB. More...
 
virtual Physics::ActivationState GetActivationState () const
 Gets the current activation state of this proxy. More...
 
virtual Vector3 GetAnisotropicFriction () const
 Gets the anisotropic friction factor. More...
 
virtual
Physics::AnisotropicFrictionFlags 
GetAnisotropicFrictionMode () const
 Gets the current Anisotropic friction mode being applied to this proxy. More...
 
virtual Whole GetCollisionFlags () const
 Gets the collection of flags that help determine collision response for this object. More...
 
virtual Int16 GetCollisionGroup () const
 Gets the objects collision group. More...
 
virtual Int16 GetCollisionMask () const
 Gets the object's collision mask. More...
 
virtual bool GetCollisionResponse () const
 Will this respond to 3d collisions. More...
 
virtual CollisionShapeGetCollisionShape () const
 Gets the collision shape currently in use by this object. More...
 
virtual WorldManagerGetCreator () const
 Gets a pointer to this proxies creator. More...
 
virtual Real GetDeactivationTime () const
 Gets the current deactivation time for this object. More...
 
virtual Real GetFriction () const
 Gets the sliding friction coefficient. More...
 
virtual Vector3 GetLocation () const
 Gets this objects current location. More...
 
virtual Quaternion GetOrientation () const
 Gets this objects current orientation. More...
 
virtual Real GetRestitution () const
 Gets the World Object restitution coefficient. More...
 
virtual Real GetRollingFriction () const
 Gets the rolling friction coefficient. More...
 
virtual Vector3 GetScale () const
 Gets the scaling currently being applied to this object. More...
 
virtual bool IsActive () const
 Checks if the object is active in the simulation. More...
 
virtual Boolean IsAnisotropicFrictionModeSet (const Whole Mode) const
 Gets whether or not anisotropic friction is being used in a specified mode. More...
 
virtual Boolean IsInWorld () const
 Gets whether or not this object is inside of it's world. More...
 
virtual bool IsKinematic () const
 Is the object kinematic. More...
 
virtual bool IsStatic () const
 Is the object static. More...
 
virtual bool IsStaticOrKinematic () const
 Checks if the object is either static or kinematic. More...
 
virtual void Pitch (const Real Angle)
 Rotate the object around the X axis. More...
 
virtual void ProtoDeSerialize (const XML::Node &SelfRoot)
 Take the data stored in an XML Node and overwrite this object with it. More...
 
virtual void ProtoDeSerializeShape (const XML::Node &SelfRoot)
 Take the data stored in an XML Node and overwrite the shape of this object with it. More...
 
virtual void ProtoSerialize (XML::Node &ParentNode) const
 Convert this class to an XML::Node ready for serialization. More...
 
virtual void ProtoSerializeShape (XML::Node &SelfRoot) const
 Convert the shape of this class to an XML::Node ready for serialization. More...
 
virtual void Roll (const Real Angle)
 Rotate the object around the Z axis. More...
 
virtual void Rotate (const Vector3 &Axis, const Real Angle)
 Rotates the object from it's existing rotation. More...
 
virtual void Rotate (const Quaternion &Rotation)
 Rotates the object from it's existing rotation. More...
 
virtual void Scale (const Vector3 &Scale)
 Scales the object from it's current size. More...
 
virtual void Scale (const Real X, const Real Y, const Real Z)
 Scales the object from it's current size. More...
 
virtual void SetActivationState (const Physics::ActivationState State, bool Force=false)
 Sets the activation state of the world object. More...
 
virtual void SetAnisotropicFriction (const Vector3 &Friction, const Whole Mode)
 Sets the anisotropic friction factor. More...
 
virtual void SetCollisionFlags (const Whole Flags)
 Sets the collection of flags that help determine collision response for this object. More...
 
virtual void SetCollisionGroup (const Int16 Group)
 Sets which collision group this proxy belongs to, which determines it's collision behavior. More...
 
virtual void SetCollisionGroupAndMask (const Int16 Group, const Int16 Mask)
 Set the collision group and mask for the proxy to determine what it should collide with. More...
 
virtual void SetCollisionMask (const Int16 Mask)
 Sets the collision mask of this proxy, which determines which groups it will collide with. More...
 
virtual void SetCollisionResponse (bool Enable)
 Sets the World Object to be able to collide with other objects in the world. More...
 
virtual void SetDeactivationTime (const Real Time)
 Sets the amount of time this object needs to have no forces enacted upon it to be deactivated. More...
 
virtual void SetFriction (const Real Friction)
 Sets the sliding friction coefficient. More...
 
virtual void SetKinematic ()
 Sets the state of the object to Kinematic. More...
 
virtual void SetLocation (const Vector3 &Loc)
 Sets the location of this object in parent space. More...
 
virtual void SetLocation (const Real X, const Real Y, const Real Z)
 Sets the location of this object in parent space via Reals. More...
 
virtual void SetOrientation (const Quaternion &Ori)
 Sets the orientation of this object in parent space. More...
 
virtual void SetOrientation (const Real X, const Real Y, const Real Z, const Real W)
 Sets the orientation of this object in parent space via Reals. More...
 
virtual void SetRestitution (const Real &Restitution)
 Sets the restitution coefficient. More...
 
virtual void SetRollingFriction (const Real Friction)
 Sets the rolling friction coefficient. More...
 
virtual void SetScale (const Vector3 &Sc)
 Sets the scaling to be applied to this object. More...
 
virtual void SetScale (const Real X, const Real Y, const Real Z)
 Sets the scaling to be applied to this object via Reals. More...
 
virtual void SetStatic ()
 Sets the state of the object to Static. More...
 
virtual void Translate (const Vector3 &Trans)
 Moves this object from it's current location. More...
 
virtual void Translate (const Real X, const Real Y, const Real Z)
 Moves this object from it's current location. More...
 
virtual void Yaw (const Real Angle)
 Rotate the object around the Y axis. More...
 
- Public Member Functions inherited from Mezzanine::WorldProxy
 WorldProxy ()
 Class constructor.
 
virtual ~WorldProxy ()
 Class destructor.
 
void _Bind (WorldObject *NewParent)
 Binds this proxy to a WorldObject. More...
 
virtual WorldObjectGetParentObject () const
 Gets a pointer to the parent object controlling this proxy. More...
 
- Public Member Functions inherited from Mezzanine::TransformableObject
virtual ~TransformableObject ()
 Class Destructor.
 
virtual Vector3 ConvertGlobalToLocal (const Vector3 &Location) const
 Converts a point in global space to the same point in local space. More...
 
virtual Quaternion ConvertGlobalToLocal (const Quaternion &Orientation) const
 Converts a rotation in global space to the same rotation in local space. More...
 
virtual Vector3 ConvertLocalToGlobal (const Vector3 &Location) const
 Converts a point in local space to the same point in global space. More...
 
virtual Quaternion ConvertLocalToGlobal (const Quaternion &Orientation) const
 Converts a rotation in local space to the same rotation in global space. More...
 

Static Public Member Functions

static String GetSerializableName ()
 Get the name of the the XML tag the proxy class will leave behind as its instances are serialized. More...
 
- Static Public Member Functions inherited from Mezzanine::Physics::CollidableProxy
static String GetSerializableName ()
 Get the name of the the XML tag the proxy class will leave behind as its instances are serialized. More...
 
- Static Public Member Functions inherited from Mezzanine::WorldProxy
static String GetSerializableName ()
 Get the name of the the XML tag the proxy class will leave behind as its instances are serialized. More...
 

Protected Member Functions

virtual void CreateRigidObject (const Real Mass)
 Data related to sticky behavior, if any is enabled. More...
 

Protected Attributes

btRigidBody * PhysicsRigidBody
 RigidBody proxy used by the internal physics. More...
 
- Protected Attributes inherited from Mezzanine::Physics::CollidableProxy
Int16 CollisionGroup
 The classifications pertaining to this object in regards to collisions. More...
 
Int16 CollisionMask
 Stores the kind of World Objects that can collide with each other. More...
 
PhysicsManagerManager
 This is a pointer to the physics manager that created and owns this proxy. More...
 
CollisionShapeProxyShape
 A vector3 storing the scaling applied to this body. More...
 
btCollisionShape * ScalerShape
 This is an internal only shape that provides the ability for a collision shape to be scaled locally (to this object alone). More...
 
- Protected Attributes inherited from Mezzanine::WorldProxy
WorldObjectParentObject
 Pointer to the Object this proxy belongs to. More...
 

Detailed Description

This is a proxy from which rigid body proxys are handled.

This class is used to hold and configure the physics information for a rigid body. This class holds physics information from the physics sub-library and serves as a means to interact with it. Direct interaction with the internal physics proxy is discouraged.

Definition at line 102 of file rigidproxy.h.

Constructor & Destructor Documentation

Mezzanine::Physics::RigidProxy::RigidProxy ( const Real  Mass,
PhysicsManager Creator 
)

Standard Constructor.

Parameters
MassThe mass of the rigid body.
CreatorA pointer to the manager that created this proxy.

Definition at line 60 of file rigidproxy.cpp.

Mezzanine::Physics::RigidProxy::RigidProxy ( const XML::Node SelfRoot,
PhysicsManager Creator 
)

XML constructor.

Parameters
SelfRootAn XML::Node containing the data to populate this class with.
CreatorA pointer to the manager that created this proxy.

Definition at line 67 of file rigidproxy.cpp.

Member Function Documentation

btCollisionObject * Mezzanine::Physics::RigidProxy::_GetBasePhysicsObject ( ) const
virtual

Accessor for the internal physics object.

Implements Mezzanine::Physics::CollidableProxy.

Definition at line 400 of file rigidproxy.cpp.

btRigidBody * Mezzanine::Physics::RigidProxy::_GetPhysicsObject ( ) const
virtual

Accessor for the internal rigid body physics proxy.

Returns
Returns a pointer to the internal proxy this proxy is based on.

Definition at line 397 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::AddSyncObject ( TransformableObject ToBeAdded)
virtual

Adds a TransformableObject that will force it's transform to sync with this RigidProxy.

Parameters
ToBeAddedA pointer to the WorldObject being added.

Definition at line 256 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::AddToWorld ( )
virtual

Performs all the necessary task to ensure this object is connected to it's respective world and ready for use.

Implements Mezzanine::Physics::CollidableProxy.

Definition at line 108 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::ApplyForce ( const Vector3 Force)
virtual

Push/Apply force to an proxy.

Parameters
ForceThe amount and direction of the force in a Vector3

Definition at line 201 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::ApplyTorque ( const Vector3 Torque)
virtual

Spin/Apply torque to an proxy.

Parameters
TorqueThe amount and direction of the torque in a Vector3

Definition at line 207 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::CreateRigidObject ( const Real  Mass)
protectedvirtual

Data related to sticky behavior, if any is enabled.

Used to create the physics representation of the rigid body.

Parameters
MassThe mass of the rigid body to be created.

Definition at line 84 of file rigidproxy.cpp.

Real Mezzanine::Physics::RigidProxy::GetAngularDamping ( ) const
virtual

Get the Angular damping.

Returns
A Real that has the Angular damping.

Definition at line 180 of file rigidproxy.cpp.

Vector3 Mezzanine::Physics::RigidProxy::GetAngularMovementFactor ( ) const
virtual

Gets the current angular factors being applied to this actor.

Returns
Returns a Vector3 representing the factors on the 3 angular axes.

Definition at line 162 of file rigidproxy.cpp.

Vector3 Mezzanine::Physics::RigidProxy::GetAngularVelocity ( ) const
virtual

Gets the Angular Velocity of this proxy.

Returns
Returns the currently set Angular Velocity of this proxy.

Definition at line 192 of file rigidproxy.cpp.

Vector3 Mezzanine::Physics::RigidProxy::GetAppliedForce ( ) const
virtual

Get the total Force currently being applied to this proxy.

Returns
Returns a Vector3 representing the amount of linear force being applied on each axis.

Definition at line 204 of file rigidproxy.cpp.

Vector3 Mezzanine::Physics::RigidProxy::GetAppliedTorque ( ) const
virtual

Get the total Torque currently being applied to this proxy.

Returns
Returns a Vector3 representing the amount of angular force being applied on each axis.

Definition at line 210 of file rigidproxy.cpp.

String Mezzanine::Physics::RigidProxy::GetDerivedSerializableName ( ) const
virtual

Gets the most derived serializable name of this WorldProxy.

Note
When creating a new WorldProxy class verify this method has a valid return for it in order for serialization to work properly.
Returns
Returns the name of the XML tag from the most derived class of "this".

Reimplemented from Mezzanine::Physics::CollidableProxy.

Definition at line 388 of file rigidproxy.cpp.

Vector3 Mezzanine::Physics::RigidProxy::GetGravity ( ) const
virtual

Gets the gravity being applied to this proxy.

This is the gravity applied to this proxy, which may or may not be the same as the world gravity.

Returns
Returns a Vector3 representing the gravity currently being applied to this proxy.

Definition at line 198 of file rigidproxy.cpp.

Real Mezzanine::Physics::RigidProxy::GetLinearDamping ( ) const
virtual

Get the linear damping.

Returns
A Real that has the Linear damping.

Definition at line 177 of file rigidproxy.cpp.

Vector3 Mezzanine::Physics::RigidProxy::GetLinearMovementFactor ( ) const
virtual

Gets the current linear factors being applied to this actor.

Returns
Returns a Vector3 representing the factors on the 3 linear axes.

Definition at line 156 of file rigidproxy.cpp.

Vector3 Mezzanine::Physics::RigidProxy::GetLinearVelocity ( ) const
virtual

Gets the Linear Velocity of this proxy.

Returns
Returns the currently set Linear Velocity of this proxy.

Definition at line 186 of file rigidproxy.cpp.

Real Mezzanine::Physics::RigidProxy::GetMass ( ) const
virtual

Get the total Mass of the proxy.

Returns
A Real with the Mass of the proxy

Definition at line 171 of file rigidproxy.cpp.

UInt32 Mezzanine::Physics::RigidProxy::GetNumSyncObjects ( ) const
virtual

Gets the number of WorldProxies being sync'd to this RigidProxy.

Returns
Returns a UInt32 representing the number of WorldProxies being sync'd with this RigidProxy.

Definition at line 262 of file rigidproxy.cpp.

Mezzanine::ProxyType Mezzanine::Physics::RigidProxy::GetProxyType ( ) const
virtual

Accessor for the type of proxy.

Returns
Returns enum value for the type of proxy this object is.

Implements Mezzanine::WorldProxy.

Definition at line 103 of file rigidproxy.cpp.

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

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

Returns
A string containing the name of this class.

Definition at line 391 of file rigidproxy.cpp.

TransformableObject * Mezzanine::Physics::RigidProxy::GetSyncObject ( const UInt32  Index) const
virtual

Gets a TransformableObject being sync'd to this RigidProxy by it's index.

Parameters
IndexThe index of the sync object to retrieve.
Returns
Returns a pointer to the TransformableObject at the specified Index.

Definition at line 259 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::ProtoDeSerializeProperties ( const XML::Node SelfRoot)
virtual

Take the data stored in an XML Node and overwrite the properties of this object with it.

Parameters
SelfRootAn XML::Node containing the data to populate this class with.

Reimplemented from Mezzanine::Physics::CollidableProxy.

Definition at line 312 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::ProtoSerializeProperties ( XML::Node SelfRoot) const
virtual

Convert the properties of this class to an XML::Node ready for serialization.

Parameters
SelfRootThe root node containing all the serialized data for this instance.

Reimplemented from Mezzanine::Physics::CollidableProxy.

Definition at line 274 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::RemoveFromWorld ( )
virtual

Unhooks this proxy from it's respective world.

Implements Mezzanine::Physics::CollidableProxy.

Definition at line 118 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::RemoveSyncObject ( TransformableObject ToBeRemoved)
virtual

Removes a proxy being sync'd, so it will no longer match it's transform with this RigidProxy.

Parameters
ToBeRemovedA pointer to the TransformableObject to be removed.

Definition at line 265 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::SetAngularMovementFactor ( const Vector3 Factor)
virtual

Restricts movement on the axis or axes of your choice.

This function can lock or limit any and all axes you define. 0.0 means no angular movement on that axis. 1.0 means normal movement.

Parameters
FactorVector3 containing the Factors for the 3 angular axes.

Definition at line 159 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::SetAngularVelocity ( const Vector3 AngVel)
virtual

Sets the Angular Velocity of this proxy.

Parameters
AngVelVector3 representing the Angular Velocity to be set.

Definition at line 189 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::SetCollisionShape ( CollisionShape Shape)
virtual

Sets the collision shape to be used.

Parameters
ShapeThe shape to be applied.

Reimplemented from Mezzanine::Physics::CollidableProxy.

Definition at line 128 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::SetDamping ( const Real  LinDamping,
const Real  AngDamping 
)
virtual

Sets the Damping for this proxy.

Both of Linear Damping and Angular Damping default to zero. This is useful if you wish to simulate something like air resistance. Values can range from 0.0 to 1.0.

Parameters
LinDampingReal representing the amount of Linear Damping(Movement) to be applied.
AngDampingReal representing the amount of Angular Damping(Rotation) to be applied.

Definition at line 174 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::SetGravity ( const Vector3 Gravity)
virtual

Sets the gravity for only this proxy.

This value will override the world gravity.

Parameters
GravityVector3 representing the direction and strength of gravity to be applied.

Definition at line 195 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::SetLinearMovementFactor ( const Vector3 Factor)
virtual

Restricts movement on the axis or axies of your choice.

This function can lock or limit any and all axes you define. 0.0 means no linear movement on that axis. 1.0 means normal movement.

Parameters
FactorVector3 containing the Factors for the 3 linear axes.

Definition at line 153 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::SetLinearVelocity ( const Vector3 LinVel)
virtual

Sets the Linear Velocity of this proxy.

Parameters
LinVelVector3 representing the Linear Velocity to be set.

Definition at line 183 of file rigidproxy.cpp.

void Mezzanine::Physics::RigidProxy::SetMass ( const Real  Mass)
virtual

Change the mass of the proxy.

Parameters
NewMassThe amount of mass this should have.

Definition at line 168 of file rigidproxy.cpp.

Member Data Documentation

btRigidBody* Mezzanine::Physics::RigidProxy::PhysicsRigidBody
protected

RigidBody proxy used by the internal physics.

Definition at line 107 of file rigidproxy.h.


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