AnimatLab  2
Test
RoboticsAnimatSim::Environment::RbRigidBody Class Reference

A common class for all rigid body data specific to vortex. More...

#include <RbRigidBody.h>

+ Inheritance diagram for RoboticsAnimatSim::Environment::RbRigidBody:
+ Collaboration diagram for RoboticsAnimatSim::Environment::RbRigidBody:

Public Member Functions

virtual RbSimulatorGetRbSimulator ()
 
virtual void Initialize ()
 
RbMaterialTypeMaterial ()
 
virtual void Physics_AddBodyForceAtLocalPos (float fltPx, float fltPy, float fltPz, float fltFx, float fltFy, float fltFz, bool bScaleUnits)
 
virtual void Physics_AddBodyForceAtWorldPos (float fltPx, float fltPy, float fltPz, float fltFx, float fltFy, float fltFz, bool bScaleUnits)
 
virtual void Physics_AddBodyTorque (float fltTx, float fltTy, float fltTz, bool bScaleUnits)
 
virtual void Physics_ChildBodyAdded (RigidBody *lpChild)
 
virtual void Physics_ChildBodyRemoved (bool bHasStaticJoint)
 
virtual void Physics_CollectData ()
 
virtual void Physics_CollectExtraData ()
 
virtual void Physics_ContactSensorAdded (ContactSensor *lpSensor)
 
virtual void Physics_ContactSensorRemoved ()
 
virtual void Physics_DisableCollision (RigidBody *lpBody)
 
virtual void Physics_EnableCollision (RigidBody *lpBody)
 
virtual void Physics_FluidDataChanged ()
 
virtual float * Physics_GetDataPointer (const std::string &strDataType)
 
virtual float Physics_GetDensity ()
 
virtual float Physics_GetMass ()
 
virtual CStdFPoint Physics_GetVelocityAtPoint (float x, float y, float z)
 
virtual bool Physics_HasCollisionGeometry ()
 
virtual bool Physics_IsDefined ()
 
virtual bool Physics_IsGeometryDefined ()
 
virtual void Physics_ResetSimulation ()
 
virtual void Physics_SetCenterOfMass (float fltTx, float fltTy, float fltTz)
 
virtual void Physics_SetFreeze (bool bVal)
 
virtual void Physics_SetMass (float fltVal)
 
virtual void Physics_SetMaterialID (std::string strID)
 
virtual void Physics_SetVelocityDamping (float fltLinear, float fltAngular)
 
virtual void Physics_StepHydrodynamicSimulation ()
 
virtual void Physics_UpdateNode ()
 
virtual void Physics_WakeDynamics ()
 
- Public Member Functions inherited from RoboticsAnimatSim::Environment::RbBody
 RbBody ()
 Default constructor. More...
 
virtual ~RbBody ()
 Destructor. More...
 
virtual void Physics_DeleteStickyLock ()
 
virtual void Physics_ResizeSelectedReceptiveFieldVertex ()
 
virtual void Physics_SetDensity (float fltVal)
 
- Public Member Functions inherited from RoboticsAnimatSim::Environment::RbMovableItem
virtual void CreateItem ()
 
virtual void Physics_AfterResetSimulation ()
 
virtual bool Physics_CalculateLocalPosForWorldPos (float fltWorldX, float fltWorldY, float fltWorldZ, CStdFPoint &vLocalPos)
 
virtual BoundingBox Physics_GetBoundingBox ()
 
virtual float Physics_GetBoundingRadius ()
 
virtual std::string Physics_GetLocalTransformMatrixString ()
 
virtual std::string Physics_ID ()
 
virtual void Physics_LoadLocalTransformMatrix (CStdXml &oXml)
 
virtual void Physics_OrientNewPart (float fltXPos, float fltYPos, float fltZPos, float fltXNorm, float fltYNorm, float fltZNorm)
 
virtual void Physics_PositionChanged ()
 
virtual void Physics_ResetGraphicsAndPhysics ()
 
virtual void Physics_Resize (void)
 
virtual void Physics_ResizeDragHandler (float fltRadius)
 
virtual void Physics_RotationChanged ()
 
virtual void Physics_SaveLocalTransformMatrix (CStdXml &oXml)
 
virtual void Physics_Selected (bool bValue, bool bSelectMultiple)
 
virtual void Physics_SelectedVertex (float fltXPos, float fltYPos, float fltZPos)
 
virtual void Physics_SetChild (MovableItem *lpParent)
 
virtual void Physics_SetColor ()
 
virtual void Physics_SetParent (MovableItem *lpParent)
 
virtual void Physics_TextureChanged ()
 
virtual void Physics_UpdateAbsolutePosition ()
 
virtual void Physics_UpdateMatrix ()
 
virtual RbMovableItemRbParent ()
 
virtual void SetAlpha ()
 
virtual void SetVisible (bool)
 
- Public Member Functions inherited from AnimatSim::Environment::IPhysicsMovableItem
virtual void Physics_SetChild (MovableItem *lpChild)=0
 
virtual void Physics_SetParent (MovableItem *lpParent)=0
 
- Public Member Functions inherited from AnimatSim::Environment::IPhysicsBody
virtual void Physics_ChildBodyAdded (RigidBody *lpChild)=0
 
virtual void Physics_ContactSensorAdded (ContactSensor *lpSensor)=0
 
virtual void Physics_DisableCollision (RigidBody *lpBody)=0
 
virtual void Physics_EnableCollision (RigidBody *lpBody)=0
 

Protected Member Functions

CStdFPoint Physics_GetCurrentPosition ()
 
- Protected Member Functions inherited from RoboticsAnimatSim::Environment::RbBody
virtual void SetThisPointers ()
 

Protected Attributes

RbMaterialTypem_lpMaterial
 The pointer to the material for this body.
 
RbSimulatorm_lpRbSim
 
- Protected Attributes inherited from RoboticsAnimatSim::Environment::RbBody
BodyPart * m_lpThisBP
 
- Protected Attributes inherited from RoboticsAnimatSim::Environment::RbMovableItem
float m_fltReportNull
 Used to report back nulls.
 
RbMovableItemm_lpParentRbMI
 
RbSimulatorm_lpRbSim
 
AnimatBase * m_lpThisAB
 
MovableItem * m_lpThisMI
 
RbMovableItemm_lpThisRbMI
 

Friends

class RbJoint
 

Detailed Description

A common class for all rigid body data specific to vortex.

Remarks
This is a common class for the rigid body objects that specifically holds vortex data and methods. I had hoped to not have this class. However, it proved necessary. The reason is that rigid bodies like the box and cylinder all had common data items asociated with them like the m_iBodyID that need to be used in various places in order to get things done. When we are in one of the overridden virtual functions we need a way to get at these data members for a rigid body. If we have this class then we can just do a dynamic cast to convert it into a RbRigidBody and access those items that way. If we do not have this common class and instead just duplicated these items in each of the different RbBox, RbCylinder, etc. classes then we have a problem. If we put virtual accessor functions for those items in the RigidBody class then that is not appropriate because the animat library is not supposed to know anything about data elements specific to vortex. What happens if you move to a different physics engine? Do you put data elements for that one in RigidBody also. Clearly that will not work as a solution. The only other way would be to try and determine the actual type of object you have and do a specific cast to that one. So if we are looking at the parent of the current rigid body and we have it as a RigidBody pointer then we would have to find some way to determine that it was say a RbBox type of object. And then we would have to dynamic cast it to RbBox. Again, this would be horribly messy with switches and other stuff. This was the cleanest solution that I could see. With this we just always cast the RigidBody to a RbRigidBody to get access to the vortex specific data elements.
See also
RigidBody, RbBox, RbPlane, RbCylinder

Definition at line 52 of file RbRigidBody.h.


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