6 #include "RbMovableItem.h"
9 #include "RbRigidBody.h"
10 #include "RbSimulator.h"
21 RbRigidBody::RbRigidBody()
27 RbRigidBody::~RbRigidBody()
34 {
Std_TraceMsg(0,
"Caught Error in desctructor of RbRigidBody\r\n",
"", -1,
false,
true);}
37 bool RbRigidBody::Physics_IsDefined()
42 bool RbRigidBody::Physics_IsGeometryDefined()
47 CStdFPoint RbRigidBody::Physics_GetCurrentPosition()
57 m_lpRbSim =
dynamic_cast<RbSimulator *
>(m_lpThisAB->GetSimulator());
59 THROW_TEXT_ERROR(Rb_Err_lThisPointerNotDefined, Rb_Err_strThisPointerNotDefined,
"m_lpRbSim, " + m_lpThisAB->Name());
64 void RbRigidBody::Physics_UpdateNode()
68 void RbRigidBody::Physics_SetFreeze(
bool bVal)
72 void RbRigidBody::Physics_SetMass(
float fltVal)
76 float RbRigidBody::Physics_GetMass()
81 float RbRigidBody::Physics_GetDensity()
86 void RbRigidBody::Physics_SetMaterialID(std::string strID)
90 void RbRigidBody::Physics_SetVelocityDamping(
float fltLinear,
float fltAngular)
94 void RbRigidBody::Physics_SetCenterOfMass(
float fltTx,
float fltTy,
float fltTz)
98 void RbRigidBody::Physics_FluidDataChanged()
102 void RbRigidBody::Physics_WakeDynamics()
106 void RbRigidBody::Physics_ContactSensorAdded(ContactSensor *lpSensor)
110 void RbRigidBody::Physics_ContactSensorRemoved()
114 void RbRigidBody::Physics_ChildBodyAdded(RigidBody *lpChild)
118 void RbRigidBody::Physics_ChildBodyRemoved(
bool bHasStaticJoint)
122 void RbRigidBody::Physics_CollectData()
126 void RbRigidBody::Physics_CollectExtraData()
130 void RbRigidBody::Physics_ResetSimulation()
134 void RbRigidBody::Physics_EnableCollision(RigidBody *lpBody)
138 void RbRigidBody::Physics_DisableCollision(RigidBody *lpBody)
142 void RbRigidBody::Physics_AddBodyForceAtLocalPos(
float fltPx,
float fltPy,
float fltPz,
float fltFx,
float fltFy,
float fltFz,
bool bScaleUnits)
146 void RbRigidBody::Physics_AddBodyForceAtWorldPos(
float fltPx,
float fltPy,
float fltPz,
float fltFx,
float fltFy,
float fltFz,
bool bScaleUnits)
150 void RbRigidBody::Physics_AddBodyTorque(
float fltTx,
float fltTy,
float fltTz,
bool bScaleUnits)
154 CStdFPoint RbRigidBody::Physics_GetVelocityAtPoint(
float x,
float y,
float z)
156 CStdFPoint linVel(0,0,0);
160 bool RbRigidBody::Physics_HasCollisionGeometry()
165 void RbRigidBody::Physics_StepHydrodynamicSimulation()
169 float *RbRigidBody::Physics_GetDataPointer(
const std::string &strDataType)
172 RigidBody *lpBody =
dynamic_cast<RigidBody *
>(
this);
174 if(strType ==
"BODYBUOYANCY")
177 if(strType ==
"BODYDRAGFORCEX")
180 if(strType ==
"BODYDRAGFORCEY")
183 if(strType ==
"BODYDRAGFORCEZ")
186 if(strType ==
"BODYDRAGTORQUEX")
189 if(strType ==
"BODYDRAGTORQUEY")
192 if(strType ==
"BODYDRAGTORQUEZ")
195 if(strType ==
"BODYTORQUEX")
198 if(strType ==
"BODYTORQUEY")
201 if(strType ==
"BODYTORQUEZ")
204 if(strType ==
"BODYFORCEX")
207 if(strType ==
"BODYFORCEY")
210 if(strType ==
"BODYFORCEZ")
213 if(strType ==
"BODYLINEARVELOCITYX")
216 if(strType ==
"BODYLINEARVELOCITYY")
219 if(strType ==
"BODYLINEARVELOCITYZ")
222 if(strType ==
"BODYANGULARVELOCITYX")
225 if(strType ==
"BODYANGULARVELOCITYY")
228 if(strType ==
"BODYANGULARVELOCITYZ")
231 if(strType ==
"BODYLINEARACCELERATIONX")
234 if(strType ==
"BODYLINEARACCELERATIONY")
237 if(strType ==
"BODYLINEARACCELERATIONZ")
240 if(strType ==
"BODYANGULARACCELERATIONX")
243 if(strType ==
"BODYANGULARACCELERATIONY")
246 if(strType ==
"BODYANGULARACCELERATIONZ")
RbMaterialType * m_lpMaterial
The pointer to the material for this body.
float m_fltReportNull
Used to report back nulls.
void Std_TraceMsg(const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bLogToFile, bool bPrintHeader)
Traces a message to the debugger window.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
Classes for implementing the cm-labs vortex physics engine for AnimatLab.