205 virtual RigidBody *LoadRigidBody(CStdXml &oXml);
206 virtual Joint *LoadJoint(CStdXml &oXml);
208 virtual void LoadPosition(CStdXml &oXml);
210 virtual RigidBody *AddRigidBody(std::string strXml);
211 virtual void RemoveRigidBody(std::string strID,
bool bThrowError =
true);
212 virtual int FindChildListPos(std::string strID,
bool bThrowError =
true);
214 virtual void AddContactSensor(std::string strXml);
215 virtual void RemoveContactSensor(std::string strID,
bool bThrowError =
true);
216 virtual void LoadContactSensor(CStdXml &oXml);
218 virtual Odor *LoadOdor(CStdXml &oXml);
219 virtual void AddOdor(
Odor *lpOdor);
220 virtual void AddOdor(std::string strXml,
bool bDoNotInit);
221 virtual void RemoveOdor(std::string strID,
bool bThrowError =
true);
223 virtual void Mass(
float fltVal,
bool bUseScaling,
bool bPhysicsCallback);
224 virtual void CenterOfMass(CStdFPoint &vPoint,
bool bUseScaling,
bool bPhysicsCallback);
225 virtual void Freeze(
bool bVal,
bool bPhysicsCallback);
227 virtual void RemoveCollisionExclusions();
235 #pragma region AccessorMutators
237 virtual CStdFPoint Position();
238 virtual void Position(CStdFPoint &oPoint,
bool bUseScaling =
true,
bool bFireChangeEvent =
false,
bool bUpdateMatrix =
true);
240 virtual int VisualSelectionType();
242 virtual CStdFPoint CenterOfMass();
243 virtual CStdFPoint CenterOfMassWithStaticChildren();
244 virtual void CenterOfMass(CStdFPoint &vPoint,
bool bUseScaling =
true);
245 virtual void CenterOfMass(
float fltX,
float fltY,
float fltZ,
bool bUseScaling =
true);
246 virtual void CenterOfMass(std::string strXml,
bool bUseScaling =
true);
248 virtual CStdPtrArray<RigidBody>* ChildParts();
250 virtual Joint *JointToParent();
251 virtual void JointToParent(
Joint *lpValue);
255 virtual float Density();
256 virtual void Density(
float fltVal,
bool bUseScaling =
true);
258 virtual float Mass();
259 virtual void Mass(
float fltVal,
bool bUseScaling =
true);
260 virtual float MassWithChildren();
262 virtual float Volume();
263 virtual void Volume(
float fltVal,
bool bUseScaling =
true);
265 virtual bool Freeze();
266 virtual void Freeze(
bool bVal);
268 virtual bool IsContactSensor();
269 virtual void IsContactSensor(
bool bVal);
271 virtual bool IsCollisionObject();
272 virtual void IsCollisionObject(
bool bVal);
274 virtual bool IsStickyPart();
275 virtual void IsStickyPart(
bool bVal);
277 virtual float StickyOn();
278 virtual void StickyOn(
float fltVal);
281 virtual void StickyChild(
RigidBody *lpChild);
283 virtual bool IsRoot();
284 virtual bool HasStaticJoint();
285 virtual bool HasStaticChildren();
286 virtual float StaticChildrenMass();
288 virtual bool IsFoodSource();
289 virtual void IsFoodSource(
bool bVal);
291 virtual float FoodQuantity();
292 virtual void FoodQuantity(
float fltVal);
294 virtual float FoodEaten();
295 virtual void FoodEaten(
float fltVal);
297 virtual float FoodReplenishRate();
298 virtual void FoodReplenishRate(
float fltVal);
300 virtual float FoodEnergyContent();
301 virtual void FoodEnergyContent(
float fltVal);
303 virtual float MaxFoodQuantity();
304 virtual void MaxFoodQuantity(
float fltVal);
306 virtual float LinearVelocityDamping();
307 virtual void LinearVelocityDamping(
float fltVal,
bool bUseScaling =
true);
309 virtual float AngularVelocityDamping();
310 virtual void AngularVelocityDamping(
float fltVal,
bool bUseScaling =
true);
312 virtual std::string MaterialID();
313 virtual void MaterialID(std::string strID);
315 virtual CStdFPoint BuoyancyCenter();
316 virtual void BuoyancyCenter(CStdFPoint &oPoint,
bool bUseScaling =
true);
317 virtual void BuoyancyCenter(
float fltX,
float fltY,
float fltZ,
bool bUseScaling =
true);
318 virtual void BuoyancyCenter(std::string strXml,
bool bUseScaling =
true);
320 virtual float BuoyancyScale();
321 virtual void BuoyancyScale(
float fltVal);
323 virtual CStdFPoint LinearDrag();
324 virtual void LinearDrag(CStdFPoint &oPoint);
325 virtual void LinearDrag(
float fltX,
float fltY,
float fltZ);
326 virtual void LinearDrag(std::string strXml);
328 virtual CStdFPoint AngularDrag();
329 virtual void AngularDrag(CStdFPoint &oPoint);
330 virtual void AngularDrag(
float fltX,
float fltY,
float fltZ);
331 virtual void AngularDrag(std::string strXml);
333 virtual float MaxHydroForce();
334 virtual void MaxHydroForce(
float fltVal,
bool bUseScaling =
true);
336 virtual float MaxHydroTorque();
337 virtual void MaxHydroTorque(
float fltVal,
bool bUseScaling =
true);
339 virtual float Magnus();
340 virtual void Magnus(
float fltVal);
342 virtual bool EnableFluids();
343 virtual void EnableFluids(
bool bVal);
345 virtual bool HasCollisionGeometry();
347 virtual bool DisplayDebugCollisionGraphic() {
return m_bDisplayDebugCollisionGraphic;}
348 virtual void DisplayDebugCollisionGraphic(
bool bVal) {m_bDisplayDebugCollisionGraphic = bVal;}
350 virtual std::unordered_set<RigidBody *> *GetExclusionCollisionSet() {
return &m_aryExcludeCollisionSet;};
351 virtual bool FindCollisionExclusionBody(RigidBody *lpBody,
bool bThrowError =
true);
355 virtual float SurfaceContactCount();
357 virtual void Eat(
float fltBiteSize,
long lTimeSlice);
358 virtual void AddSurfaceContact(RigidBody *lpContactedSurface);
359 virtual void RemoveSurfaceContact(RigidBody *lpContactedSurface);
360 virtual void SetSurfaceContactCount(
int iCount);
361 virtual void AddForceAtLocalPos(
float fltPx,
float fltPy,
float fltPz,
float fltFx,
float fltFy,
float fltFz,
bool bScaleUnits);
362 virtual void AddForceAtWorldPos(
float fltPx,
float fltPy,
float fltPz,
float fltFx,
float fltFy,
float fltFz,
bool bScaleUnits);
363 virtual void AddTorque(
float fltTx,
float fltTy,
float fltTz,
bool bScaleUnits);
364 virtual CStdFPoint GetVelocityAtPoint(
float x,
float y,
float z);
365 virtual float GetMassValueWithStaticChildren();
366 virtual float GetDensity();
367 virtual float GetMass();
368 virtual float GetVolume();
369 virtual void UpdatePhysicsPosFromGraphics();
370 virtual void UpdateChildPhysicsPosFromGraphics();
372 virtual RigidBody *ParentWithCollisionGeometry();
374 virtual void EnableCollision(RigidBody *lpBody);
375 virtual void DisableCollision(RigidBody *lpBody);
377 virtual void CreateParts();
378 virtual void CreateChildParts();
379 virtual void CreateJoints();
380 virtual void CreateChildJoints();
382 #pragma region DataAccesMethods
384 virtual float *GetDataPointer(
const std::string &strDataType);
385 virtual bool SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError =
true);
386 virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
387 virtual bool AddItem(
const std::string &strItemType,
const std::string &strXml,
bool bThrowError =
true,
bool bDoNotInit =
false);
388 virtual bool RemoveItem(
const std::string &strItemType,
const std::string &strID,
bool bThrowError =
true);
392 virtual void SimPausing();
393 virtual int GetTargetDataTypeIndex(
const std::string &strDataType);
394 virtual void AddExternalNodeInput(
int iTargetDataType,
float fltInput);
395 virtual void StepSimulation();
396 virtual void ResetSimulation();
397 virtual void AfterResetSimulation();
398 virtual void Kill(
bool bState =
true);
399 virtual void Load(CStdXml &oXml);
The base class for all of the joint type of objects.
ContactSensor * m_lpContactSensor
float m_fltAngularVelocityDamping
The angular velocity damping for this part.
std::string m_strMaterialID
Identifier for the material type this part will use.
Root namespace for the base simulation library for AnimatLab.
CStdFPoint m_vBuoyancyCenter
This is the relative position to the center of the buoyancy in the body.
float m_fltMass
The mass of the object.
float m_fltVolume
The volume for the rigid body.
float m_fltStickyOn
If this is a suction part then this controls when stickness is on.
bool m_bFoodSource
Tells if this body is considered a food source.
float m_fltSurfaceContactCount
long m_lEatTime
Keeps track of how many time slices this part can eat.
float m_fltFoodEnergyContent
The energy content of the food in calories.
bool m_bDisplayDebugCollisionGraphic
CStdFPoint m_vLinearDrag
This is the drag coefficients for the three axises for the body.
float m_fltMaxHydroForce
The maximum hyrdodynamic force that can be applied.
float m_fltReportVolume
The volume of the object to report to GUI.
bool m_bEnableFluids
true to enable fluid interactions.
float m_fltMaxHydroTorque
The maximum hyrdodynamic torque that can be applied.
float m_fltDensity
Uniform density for the rigid body.
float m_fltFoodReplenishRate
The rate at which food is replenished.
float m_fltReportDensity
The density value reported to the GUI.
float m_fltMagnus
The Magnus coefficient for the body. This is defaulted to zero because it almost always negligble for...
float m_fltReportMass
The mass of the object to report to GUI.
CStdPtrArray< RigidBody > m_aryChildParts
Base class for all body parts and joints.
RigidBody * m_lpStickyChild
If we are doing a sticky lock then this is the child part that was locked on.
float m_fltFoodQuantityInit
The initial food quantity to use when simulation is reset.
CStdFPoint m_vCenterOfMass
float m_fltLinearVelocityDamping
The linear velocity damping for this body part.
CStdFPoint m_vAngularDrag
This is the drag coefficients for the three axises for the body.
float m_fltFoodQuantity
The quantity of food that this part contains.
std::unordered_set< RigidBody * > m_aryExcludeCollisionSet
This is the list of other parts that this part is excluded from colliding with.
Joint * m_lpJointToParent
CStdPtrMap< std::string, Odor > m_aryOdorSources
The array odor sources attached to this part.
float m_fltMaxFoodQuantity
The maximum food quantity that this part can contain.
float m_fltFoodEaten
Tells how much food is being eaten.
bool m_bIsCollisionObject
This determines whether the object is a collision geometry object.
The base class for all of the basic rigid body type of objects.