AnimatLab  2
Test
AnimatSim::Environment::RigidBody Class Reference

The base class for all of the basic rigid body type of objects. More...

#include <RigidBody.h>

+ Inheritance diagram for AnimatSim::Environment::RigidBody:
+ Collaboration diagram for AnimatSim::Environment::RigidBody:

Public Member Functions

 RigidBody ()
 Default constructor. More...
 
virtual ~RigidBody ()
 Destructor. More...
 
virtual void AddExternalNodeInput (int iTargetDataType, float fltInput)
 Adds an external node input. More...
 
virtual void AddForceAtLocalPos (float fltPx, float fltPy, float fltPz, float fltFx, float fltFy, float fltFz, bool bScaleUnits)
 Adds a world-coordinate based force vector to this body at a specified local body position. More...
 
virtual void AddForceAtWorldPos (float fltPx, float fltPy, float fltPz, float fltFx, float fltFy, float fltFz, bool bScaleUnits)
 Adds a world-coordinate based force vector to this body at a specified world-coordinate body position. More...
 
virtual bool AddItem (const std::string &strItemType, const std::string &strXml, bool bThrowError=true, bool bDoNotInit=false)
 Adds a new object to this parent. More...
 
virtual void AddSurfaceContact (RigidBody *lpContactedSurface)
 Increments the surface contact count when this part collides with something in the virtual world. More...
 
virtual void AddTorque (float fltTx, float fltTy, float fltTz, bool bScaleUnits)
 Adds a torque to this body about its center. More...
 
virtual void AfterResetSimulation ()
 Called after a simulation reset for some objects. More...
 
virtual CStdFPoint AngularDrag ()
 Gets the angular drag coefficients for the three axises for the body. More...
 
virtual void AngularDrag (CStdFPoint &oPoint)
 Sets the angular drag coefficients for the three axises for the body. More...
 
virtual void AngularDrag (float fltX, float fltY, float fltZ)
 Sets the angular drag coefficients for the three axises for the body. More...
 
virtual void AngularDrag (std::string strXml)
 Sets the angular drag coefficients for the three axises for the body. This method is primarily used by the GUI to reset the local position using an xml data packet. More...
 
virtual float AngularVelocityDamping ()
 Gets the angular velocity damping. More...
 
virtual void AngularVelocityDamping (float fltVal, bool bUseScaling=true)
 Sets the angular velocity damping. More...
 
virtual CStdFPoint BuoyancyCenter ()
 Gets the relative position to the center of the buoyancy in the body. More...
 
virtual void BuoyancyCenter (CStdFPoint &oPoint, bool bUseScaling=true)
 Sets the relative position to the center of the buoyancy in the body. More...
 
virtual void BuoyancyCenter (float fltX, float fltY, float fltZ, bool bUseScaling=true)
 Sets the relative position to the center of the buoyancy in the body. More...
 
virtual void BuoyancyCenter (std::string strXml, bool bUseScaling=true)
 Sets tthe relative position to the center of the buoyancy in the body. This method is primarily used by the GUI to reset the local position using an xml data packet. More...
 
virtual float BuoyancyScale ()
 Gets the scale used to calculate the buoyancy value. More...
 
virtual void BuoyancyScale (float fltVal)
 Sets the scale used to calculate the buoyancy value. More...
 
virtual CStdFPoint CenterOfMass ()
 Gets the user specified center of mass. More...
 
virtual void CenterOfMass (CStdFPoint &vPoint, bool bUseScaling=true)
 Sets the user specified center of mass for this part. (m_vCenterOfMass). If COM is (0,0,0) then it is not used. More...
 
virtual void CenterOfMass (float fltX, float fltY, float fltZ, bool bUseScaling=true)
 Sets the center of mass position. (m_vCenterOfMass). If COM is (0,0,0) then it is not used. More...
 
virtual void CenterOfMass (std::string strXml, bool bUseScaling=true)
 Sets the center of mass position for the body. (m_vCenterOfMass). This method is primarily used by the GUI to reset the local position using an xml data packet. If COM is (0,0,0) then it is not used. More...
 
virtual CStdFPoint CenterOfMassWithStaticChildren ()
 Gets the center of mass of this part with any static children added. More...
 
virtual CStdPtrArray< RigidBody > * ChildParts ()
 Gets the array of child parts. More...
 
virtual void CreateChildJoints ()
 Loops through all the child parts of this rigid body and call CreateJoints. More...
 
virtual void CreateChildParts ()
 Loops through all the child parts of this rigid body and call CreateParts. More...
 
virtual void CreateJoints ()
 Allows the rigid body to create its joints using the chosen physics engine. More...
 
virtual void CreateParts ()
 Allows the rigid body to create its parts using the chosen physics engine. More...
 
virtual float Density ()
 Gets the uniform density. More...
 
virtual void Density (float fltVal, bool bUseScaling=true)
 Sets the uniform density of this part. More...
 
virtual void DisableCollision (RigidBody *lpBody)
 Disables collision between the past-in object and this object. More...
 
virtual bool DisplayDebugCollisionGraphic ()
 
virtual void DisplayDebugCollisionGraphic (bool bVal)
 
virtual void Eat (float fltBiteSize, long lTimeSlice)
 This item is eating the specified amount of food. More...
 
virtual void EnableCollision (RigidBody *lpBody)
 Enables collision between the past-in object and this object. More...
 
virtual bool EnableFluids ()
 Query if this object has fluid interactions turned on. More...
 
virtual void EnableFluids (bool bVal)
 Sets whether this object has fluid interactions turned on. More...
 
virtual bool FindCollisionExclusionBody (RigidBody *lpBody, bool bThrowError=true)
 Searches the exclusion collision list to see if the specified part is already present. More...
 
virtual float FoodEaten ()
 Gets the amount of food eaten. More...
 
virtual void FoodEaten (float fltVal)
 Sets the amount of food eaten. More...
 
virtual float FoodEnergyContent ()
 Gets the food energy content. More...
 
virtual void FoodEnergyContent (float fltVal)
 Sets the food energy content. More...
 
virtual float FoodQuantity ()
 Gets the food quantity. More...
 
virtual void FoodQuantity (float fltVal)
 Sets the Food quantity. More...
 
virtual float FoodReplenishRate ()
 Gets the food replenish rate. More...
 
virtual void FoodReplenishRate (float fltVal)
 Sets the food replenish rate. More...
 
virtual bool Freeze ()
 Tells if this part is frozen or not. More...
 
virtual void Freeze (bool bVal)
 Freezes. More...
 
virtual ContactSensorGetContactSensor ()
 Gets the receptive field contact sensor. More...
 
virtual float * GetDataPointer (const std::string &strDataType)
 
virtual float GetDensity ()
 Gets the density of this part. More...
 
virtual std::unordered_set< RigidBody * > * GetExclusionCollisionSet ()
 
virtual float GetMass ()
 Gets the mass of this part. More...
 
virtual float GetMassValueWithStaticChildren ()
 Gets the mass of this part and all static children. More...
 
virtual int GetTargetDataTypeIndex (const std::string &strDataType)
 Used to convert a string target data type into an integer index. More...
 
virtual CStdFPoint GetVelocityAtPoint (float x, float y, float z)
 Gets a velocity of this body at specified point in the body. More...
 
virtual float GetVolume ()
 Gets the volume of this part. More...
 
virtual bool HasCollisionGeometry ()
 
virtual bool HasStaticChildren ()
 Query if this rigid body has any static children. More...
 
virtual bool HasStaticJoint ()
 Query if this object has a static joint. More...
 
virtual bool IsCollisionObject ()
 Query if this object is collision object. More...
 
virtual void IsCollisionObject (bool bVal)
 Sets whether this part is a collision object. More...
 
virtual bool IsContactSensor ()
 Query if this object is contact sensor. More...
 
virtual void IsContactSensor (bool bVal)
 Sets whether this is a contact sensor. More...
 
virtual bool IsFoodSource ()
 Query if this object is food source. More...
 
virtual void IsFoodSource (bool bVal)
 Sets if this is a food source. More...
 
virtual bool IsRoot ()
 Query if this is the root rigid body of the structure or not. More...
 
virtual bool IsStickyPart ()
 Query if this object acts as a sticky part. This only applies to contact sensors. If it is set to true and StickOn is true then when this part touches something else it will create a locked joint between those two parts. When StickOn goes to false then that joint will be removed. This allows the contact sensor to act as a kind of sticky pick up pad. More...
 
virtual void IsStickyPart (bool bVal)
 Sets whether this part is a sticky part or not. More...
 
virtual JointJointToParent ()
 Gets the joint to parent. More...
 
virtual void JointToParent (Joint *lpValue)
 Sets the joint to parent. More...
 
virtual void Kill (bool bState=true)
 Kills. More...
 
virtual CStdFPoint LinearDrag ()
 Gets the linear drag coefficients for the three axises for the body. More...
 
virtual void LinearDrag (CStdFPoint &oPoint)
 Sets the linear drag coefficients for the three axises for the body. More...
 
virtual void LinearDrag (float fltX, float fltY, float fltZ)
 Sets the linear drag coefficients for the three axises for the body. More...
 
virtual void LinearDrag (std::string strXml)
 Sets the linear drag coefficients for the three axises for the body. This method is primarily used by the GUI to reset the local position using an xml data packet. More...
 
virtual float LinearVelocityDamping ()
 Gets the linear velocity damping for this body part. More...
 
virtual void LinearVelocityDamping (float fltVal, bool bUseScaling=true)
 Sets the Linear velocity damping. More...
 
virtual void Load (CStdXml &oXml)
 
virtual float Magnus ()
 Gets the Magnus coefficient for the body. More...
 
virtual void Magnus (float fltVal)
 Sets the Magnus coefficient for the body. More...
 
virtual float Mass ()
 
virtual void Mass (float fltVal, bool bUseScaling=true)
 
virtual float MassWithChildren ()
 
virtual std::string MaterialID ()
 Gets the material ID for this part. More...
 
virtual void MaterialID (std::string strID)
 Sets the Material ID for this part. More...
 
virtual float MaxFoodQuantity ()
 Gets the maximum food quantity. More...
 
virtual void MaxFoodQuantity (float fltVal)
 Sets the maximum Food quantity. More...
 
virtual float MaxHydroForce ()
 Gets the maximum linear hydrodynamic force that can be applied to this part. More...
 
virtual void MaxHydroForce (float fltVal, bool bUseScaling=true)
 Sets the maximum linear hydrodynamic force that can be applied to this part. More...
 
virtual float MaxHydroTorque ()
 Gets the maximum angular hydrodynamic torque that can be applied to this part. More...
 
virtual void MaxHydroTorque (float fltVal, bool bUseScaling=true)
 Sets the maximum angular hydrodynamic torque that can be applied to this part. More...
 
virtual RigidBodyParentWithCollisionGeometry ()
 Gets a parent that has collision geometry. More...
 
virtual CStdFPoint Position ()
 Gets the local position. (m_oPosition) More...
 
virtual void Position (CStdFPoint &oPoint, bool bUseScaling=true, bool bFireChangeEvent=false, bool bUpdateMatrix=true)
 
virtual void QueryProperties (CStdPtrArray< TypeProperty > &aryProperties)
 
virtual bool RemoveItem (const std::string &strItemType, const std::string &strID, bool bThrowError=true)
 Removes a child item from this parent. More...
 
virtual void RemoveSurfaceContact (RigidBody *lpContactedSurface)
 Decrements the surface contact count when this part stops colliding with something in the virtual world. More...
 
virtual void ResetSimulation ()
 Resets the simulation back to time 0. More...
 
virtual bool SetData (const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
 
virtual void SetSurfaceContactCount (int iCount)
 Direclty sets the surface contact count for when this part is contacting another rigid body part. More...
 
virtual void SimPausing ()
 Called just before the simulation pauses. More...
 
virtual float StaticChildrenMass ()
 Gets the mass of all static children. More...
 
virtual void StepSimulation ()
 Step the simulation for this object. More...
 
virtual RigidBodyStickyChild ()
 Gets the child body part we are stuck to for a sticky part. More...
 
virtual void StickyChild (RigidBody *lpChild)
 Sets the child part that we are stuck to if this is a sticky part. More...
 
virtual float StickyOn ()
 Query if this stickyness is turned on or not. This only applies to contact sensors that also have IsStickyPart true. More...
 
virtual void StickyOn (float fltVal)
 Sets whether this part has sticky on or not. More...
 
virtual float SurfaceContactCount ()
 Gets the surface contact count. More...
 
virtual void UpdateChildPhysicsPosFromGraphics ()
 
virtual void UpdatePhysicsPosFromGraphics ()
 Updates the physics position from graphics. More...
 
virtual int VisualSelectionType ()
 Gets the visual selection type for this part. More...
 
virtual float Volume ()
 
virtual void Volume (float fltVal, bool bUseScaling=true)
 
- Public Member Functions inherited from AnimatSim::Environment::BodyPart
 BodyPart (void)
 Default constructor. More...
 
virtual ~BodyPart (void)
 Destructor. More...
 
virtual void AddBodyClicked (float fltPosX, float fltPosY, float fltPosZ, float fltNormX, float fltNormY, float fltNormZ)
 Called when the user clicks on this object while the AddBody mode is active. More...
 
virtual void AddRobotPartInterface (RobotPartInterface *lpPart)
 
virtual int FindRobotPartListIndex (std::string strID, bool bThrowError=true)
 Finds the index of a robot part attached to this body part with the matching ID. More...
 
virtual CStdArray< RobotPartInterface * > * GetRobotPartInterfaces ()
 Gets a pointer to the roboto part interface associated with this body part. More...
 
virtual void Initialize ()
 Initializes this object. More...
 
virtual bool NeedsRobotSynch ()
 
virtual IPhysicsBodyPhysicsBody ()
 Gets the physics body interface pointer. This is an interface reference to the Vs version of this object. It will allow us to call methods directly in the Vs (OSG) version of the object directly without having to overload a bunch of methods in each box, sphere, etc.. More...
 
virtual void PhysicsBody (IPhysicsBody *lpBody)
 Sets the physics body interface pointer. This is an interface reference to the Vs version of this object. It will allow us to call methods directly in the Vs (OSG) version of the object directly without having to overload a bunch of methods in each box, sphere, etc.. More...
 
virtual void RemoveRobotPartInterface (RobotPartInterface *lpPart)
 
virtual void Resize ()
 Called when this object has been resized. More...
 
virtual void Selected (bool bValue, bool bSelectMultiple)
 
virtual void SetSystemPointers (Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify)
 
virtual float SynchUpdateInterval ()
 This is how often we need to update this particular adapter. More...
 
virtual void SynchUpdateInterval (float fltVal)
 Determines how often we need to update this particular adapter. More...
 
virtual bool SynchWithRobot ()
 Gets whether the m_bRobotAdpaterSynch flag applies to this adapter. More...
 
virtual void SynchWithRobot (bool bVal)
 Determines whether the m_bRobotAdpaterSynch flag applies to this adapter. More...
 
virtual void TimeStepModified ()
 If the time step is modified then we need to recalculate the length of the delay buffer. More...
 
virtual void UpdateExtraData ()
 UpdateData is called during this body parts sim update call, and before any of its child updates because those children may need import information like this parts position. However, there are a number of pieces of information that are not critical to the part itself, but that a user may have asked for. I do not want to collect that info for every part if it is not needed. So instead, if a user asks for it then this part is added to a list on the simulation. After all parts have been updated for a simulation step then we loop through the list of just the necessary parts and call UpdateExtraData to collect this additional data. It is important that this be done after all parts have stepped becasue some of this data will only be correct at the end. An example of this is force applied to a part. Forces can be added by any child parts, so it is only at the end that these values are valid. More...
 
virtual void VisualSelectionModeChanged (int iNewMode)
 Called when the visual selection mode changed in GUI. More...
 
virtual void WakeDynamics ()
 
- Public Member Functions inherited from AnimatSim::Node
 Node ()
 Default constructor. More...
 
virtual ~Node ()
 Destructor. More...
 
virtual void Copy (CStdSerialize *lpSource)
 
virtual bool Enabled ()
 Tells whether this node is enabled. More...
 
virtual void Enabled (bool bValue)
 Enables the node. More...
 
virtual void SetSystemPointers (Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify)
 Sets the system pointers. More...
 
virtual void VerifySystemPointers ()
 Verify that system pointers have been set correctly. More...
 
- Public Member Functions inherited from AnimatSim::AnimatBase
 AnimatBase ()
 Constructs an AnimatBase object. More...
 
virtual ~AnimatBase ()
 Destroys the AnimatBase object.. More...
 
virtual long CalculateSnapshotByteSize ()
 Calculates the snapshot byte size. More...
 
virtual NeuralModuleGetNeuralModule ()
 Gets the neural module. More...
 
virtual NodeGetNode ()
 Gets the node. More...
 
virtual SimulatorGetSimulator ()
 Gets the simulator pointer. More...
 
virtual StructureGetStructure ()
 Gets the structure for this node. More...
 
virtual bool HasProperty (const std::string &strName)
 Queries this object if it has a property with the given name. More...
 
virtual std::string ID ()
 Gets the unique GUID ID of this object. More...
 
virtual void ID (std::string strValue)
 Sets the unique GUID ID of the object. More...
 
virtual void Load (StdUtils::CStdXml &oXml)
 Loads the item using an XML data packet. More...
 
virtual void LoadKeyFrameSnapshot (byte *aryBytes, long &lIndex)
 Loads a key frame snapshot. More...
 
virtual std::string Name ()
 Gets the name of this object. More...
 
virtual void Name (std::string strValue)
 Sets the name of the object. Blank is acceptable. More...
 
virtual AnimatPropertyType PropertyType (const std::string &strName)
 
virtual void ReInitialize ()
 Re-initialize this object. More...
 
virtual void Reset ()
 Resets this object. More...
 
virtual void RigidBodyAdded (std::string strID)
 
virtual void RigidBodyRemoved (std::string strID)
 
virtual void SaveKeyFrameSnapshot (byte *aryBytes, long &lIndex)
 Saves a key frame snapshot. More...
 
virtual bool Selected ()
 Tells if this items is selected or not. More...
 
virtual bool SetData (const std::string &strDataType, const float fltValue, bool bThrowError=true)
 Set a variable based on a string data type name. More...
 
virtual bool SetData (const std::string &strDataType, const long lValue, bool bThrowError=true)
 Set a variable based on a string data type name. More...
 
virtual void SimStarting ()
 Called just before the simulation starts. More...
 
virtual void SimStopping ()
 Called just before the simulation stops. More...
 
virtual std::string Type ()
 returns the string type name of this object. More...
 
virtual void Type (std::string strValue)
 Sets the class type for this object. More...
 
- Public Member Functions inherited from AnimatSim::Environment::MovableItem
 MovableItem (void)
 Default constructor. More...
 
virtual ~MovableItem (void)
 Destructor. More...
 
virtual CStdFPoint AbsolutePosition ()
 Gets the absolute position of this body part. More...
 
virtual void AbsolutePosition (CStdFPoint &oPoint)
 Sets the absolute position of this body part. (m_oAbsPosition) More...
 
virtual void AbsolutePosition (float fltX, float fltY, float fltZ)
 Sets the absolute position of this body part. (m_oAbsPosition) More...
 
virtual bool AllowMouseManipulation ()
 Tells if a given part can be manipulated using the mouse and draggers. More...
 
virtual bool AllowRotateDragX ()
 Gets whether this body part can be rotated along the x-axis by the user with the drag handlers. More...
 
virtual bool AllowRotateDragY ()
 Gets whether this body part can be rotated along the y-axis by the user with the drag handlers. More...
 
virtual bool AllowRotateDragZ ()
 Gets whether this body part can be rotated along the z-axis by the user with the drag handlers. More...
 
virtual bool AllowTranslateDragX ()
 Gets whether this body part can be translated along the x-axis by the user with the drag handlers. More...
 
virtual bool AllowTranslateDragY ()
 Gets whether this body part can be translated along the y-axis by the user with the drag handlers. More...
 
virtual bool AllowTranslateDragZ ()
 Gets whether this body part can be translated along the z-axis by the user with the drag handlers. More...
 
virtual float Alpha ()
 Gets the current alpha. More...
 
virtual void Alpha (float fltAlpha)
 Sets the current alpha. More...
 
virtual CStdColorAmbient ()
 Gets the ambient color value. More...
 
virtual void Ambient (CStdColor &aryColor)
 
virtual void Ambient (float *aryColor)
 Sets the Ambient color. More...
 
virtual void Ambient (std::string strXml)
 Loads the Ambient color from an XML data packet. More...
 
virtual bool CalculateLocalPosForWorldPos (float fltWorldX, float fltWorldY, float fltWorldZ, CStdFPoint &vLocalPos)
 Calculates the local position values for matrix transform for the part to be in a specific world position. More...
 
virtual IMovableItemCallbackCallback ()
 Gets the callback interface pointer. This is an interface pointer to a callback class that allows us to notify the GUI of events that occur within the simulation. More...
 
virtual void Callback (IMovableItemCallback *lpCallback)
 Sets the callback interface pointer. This is an interface pointer to a callback class that allows us to notify the GUI of events that occur within the simulation. More...
 
virtual float CollisionsAlpha ()
 Gets the collisions alpha. More...
 
virtual void CollisionsAlpha (float fltVal)
 Sets the collisions alpha. More...
 
virtual CStdColorDiffuse ()
 Gets the diffuse color. More...
 
virtual void Diffuse (CStdColor &aryColor)
 
virtual void Diffuse (float *aryColor)
 Sets the Diffuse color. More...
 
virtual void Diffuse (std::string strXml)
 Loads the Diffuse color from an XML data packet. More...
 
virtual BoundingBox GetBoundingBox ()
 Gets the bounding box for this part. More...
 
virtual float GetBoundingRadius ()
 Gets the bounding radius of this part. More...
 
virtual CStdFPoint GetCurrentPosition ()
 Gets the current position of this part. More...
 
virtual float GraphicsAlpha ()
 Gets the graphics alpha. More...
 
virtual void GraphicsAlpha (float fltVal)
 Sets the graphics alpha. More...
 
virtual bool IsSelected ()
 Query if this object is selected. More...
 
virtual bool IsVisible ()
 Query if this object is visible. More...
 
virtual void IsVisible (bool bVal)
 Sets whether this part is visible or not. More...
 
virtual float JointsAlpha ()
 Gets the joints alpha. More...
 
virtual void JointsAlpha (float fltVal)
 Sets the joints alpha. More...
 
virtual std::string LocalTransformationMatrixString ()
 Returns a string representation of the transformation matrix of this object. This is primarily used to save off the transform matrix into the project file. More...
 
virtual void OrientNewPart (float fltXPos, float fltYPos, float fltZPos, float fltXNorm, float fltYNorm, float fltZNorm)
 Orients a new part based on where the parent was clicked and the normal of the surface face. More...
 
RigidBodyParent ()
 Gets the parent RigidBody of this part. More...
 
void Parent (RigidBody *lpValue)
 Sets the parent RigidBody of this part. More...
 
virtual IPhysicsMovableItemPhysicsMovableItem ()
 Gets the physics body interface pointer. This is an interface reference to the Vs version of this object. It will allow us to call methods directly in the Vs (OSG) version of the object directly without having to overload a bunch of methods in each box, sphere, etc.. More...
 
virtual void PhysicsMovableItem (IPhysicsMovableItem *lpBase)
 Sets the physics body interface pointer. This is an interface reference to the Vs version of this object. It will allow us to call methods directly in the Vs (OSG) version of the object directly without having to overload a bunch of methods in each box, sphere, etc.. More...
 
virtual void Position (float fltX, float fltY, float fltZ, bool bUseScaling=true, bool bFireChangeEvent=false, bool bUpdateMatrix=true)
 Sets the local position. (m_oPosition) More...
 
virtual void Position (std::string strXml, bool bUseScaling=true, bool bFireChangeEvent=false, bool bUpdateMatrix=true)
 Sets the local position. (m_oPosition). This method is primarily used by the GUI to reset the local position using an xml data packet. More...
 
virtual float ReceptiveFieldsAlpha ()
 Gets the receptive fields alpha. More...
 
virtual void ReceptiveFieldsAlpha (float fltVal)
 Sets the receptive fields alpha. More...
 
virtual CStdFPoint ReportPosition ()
 Gets the reported local position. (m_oReportPosition). More...
 
virtual void ReportPosition (CStdFPoint &oPoint)
 Sets the reported local position. (m_oReportPosition). More...
 
virtual void ReportPosition (float fltX, float fltY, float fltZ)
 Sets the reported local position. (m_oReportPosition). More...
 
virtual CStdFPoint ReportRotation ()
 Gets the reported rotation of this part. (m_oReportRotation) More...
 
virtual void ReportRotation (CStdFPoint &oPoint)
 Sets the reported rotation of this part. (m_oReportRotation) More...
 
virtual void ReportRotation (float fltX, float fltY, float fltZ)
 Sets the reported rotation of this part. (m_oReportRotation) More...
 
virtual CStdFPoint ReportWorldPosition ()
 Gets the reported world position. (m_oReportWorldPosition) More...
 
virtual void ReportWorldPosition (CStdFPoint &oPoint)
 Sets the reported world position (m_oReportWorldPosition) More...
 
virtual void ReportWorldPosition (float fltX, float fltY, float fltZ)
 Sets the reported world position (m_oReportWorldPosition) More...
 
virtual CStdFPoint Rotation ()
 Gets the rotation of this body in radians. More...
 
virtual void Rotation (CStdFPoint &oPoint, bool bFireChangeEvent=false, bool bUpdateMatrix=true)
 Sets the rotation of this body in radians. (m_oRotation) More...
 
virtual void Rotation (float fltX, float fltY, float fltZ, bool bFireChangeEvent=false, bool bUpdateMatrix=true)
 Sets the rotation of this body in radians. (m_oRotation) More...
 
virtual void Rotation (std::string strXml, bool bFireChangeEvent=false, bool bUpdateMatrix=true)
 Sets the rotation of this body in radians. (m_oRotation). This method is primarily used by the GUI to reset the rotation using an xml data packet. More...
 
virtual CStdFPoint SelectedVertex ()
 Gets the relative position of the selected vertex. (m_vSelectedVertex) More...
 
virtual void SelectedVertex (CStdFPoint &vPoint, bool bFireChangeEvent=false, bool bUpdatePhysics=true)
 Sets the relative position of the selected vertex. (m_vSelectedVertex) More...
 
virtual void SelectedVertex (float fltX, float fltY, float fltZ, bool bFireChangeEvent=false, bool bUpdatePhysics=true)
 Sets the relative position of the selected vertex. (m_vSelectedVertex) More...
 
virtual void SetBoundingBox (int iIdx, float fltVal)
 Sets one dimension of the bounding box. This does nothing for all parts except a mesh. More...
 
virtual float Shininess ()
 Gets the shininess. More...
 
virtual void Shininess (float fltVal)
 Sets the shininess value. More...
 
virtual float SimulationAlpha ()
 Gets the simulation alpha. More...
 
virtual void SimulationAlpha (float fltVal)
 Sets the simulation alpha. More...
 
virtual CStdColorSpecular ()
 Gets the specular color. More...
 
virtual void Specular (CStdColor &aryColor)
 
virtual void Specular (float *aryColor)
 Sets the Specular color. More...
 
virtual void Specular (std::string strXml)
 Loads the Specular color from an XML data packet. More...
 
virtual std::string Texture ()
 Gets the texture filename. More...
 
virtual void Texture (std::string strValue)
 Sets the Texture filename. More...
 
virtual CStdFPoint UpdateAbsolutePosition ()
 
virtual void UserDefinedDraggerRadius (float fltRadius)
 User defined dragger radius. More...
 
virtual float UserDefinedDraggerRadius ()
 Gets the user defined dragger radius. More...
 

Static Public Member Functions

static RigidBodyCastToDerived (AnimatBase *lpBase)
 
- Static Public Member Functions inherited from AnimatSim::Environment::BodyPart
static BodyPartCastToDerived (AnimatBase *lpBase)
 
- Static Public Member Functions inherited from AnimatSim::Node
static NodeCastToDerived (AnimatBase *lpBase)
 

Protected Member Functions

virtual void AddContactSensor (std::string strXml)
 Creates and adds a ContactSensor. More...
 
virtual void AddOdor (Odor *lpOdor)
 Adds an odor source to this body part. More...
 
virtual void AddOdor (std::string strXml, bool bDoNotInit)
 
virtual RigidBodyAddRigidBody (std::string strXml)
 Creates and adds a rigid body. More...
 
virtual void CenterOfMass (CStdFPoint &vPoint, bool bUseScaling, bool bPhysicsCallback)
 
virtual int FindChildListPos (std::string strID, bool bThrowError=true)
 Finds the array index for the child part with the specified ID. More...
 
virtual void Freeze (bool bVal, bool bPhysicsCallback)
 
virtual void LoadContactSensor (CStdXml &oXml)
 
virtual JointLoadJoint (CStdXml &oXml)
 Loads a child joint. More...
 
virtual OdorLoadOdor (CStdXml &oXml)
 Loads an odor source. More...
 
virtual void LoadPosition (CStdXml &oXml)
 Loads the items position. More...
 
virtual RigidBodyLoadRigidBody (CStdXml &oXml)
 Loads a child rigid body. More...
 
virtual void Mass (float fltVal, bool bUseScaling, bool bPhysicsCallback)
 
virtual void RemoveCollisionExclusions ()
 Called by the desctructor. It removes this object from all other collision exclusion lists. This prevents any attempt to reference this deleted object while looping through collision exclusions. More...
 
virtual void RemoveContactSensor (std::string strID, bool bThrowError=true)
 Removes the ContactSensor. More...
 
virtual void RemoveOdor (std::string strID, bool bThrowError=true)
 
virtual void RemoveRigidBody (std::string strID, bool bThrowError=true)
 Removes the rigid body with the specified ID. More...
 
- Protected Member Functions inherited from AnimatSim::Environment::BodyPart
virtual void UpdateData ()
 Called to collect any body data for this part. More...
 
- Protected Member Functions inherited from AnimatSim::Environment::MovableItem
virtual void LoadRotation (CStdXml &oXml)
 Loads the items rotation. More...
 

Protected Attributes

CStdPtrArray< RigidBodym_aryChildParts
 
std::unordered_set< RigidBody * > m_aryExcludeCollisionSet
 This is the list of other parts that this part is excluded from colliding with.
 
CStdPtrMap< std::string, Odorm_aryOdorSources
 The array odor sources attached to this part.
 
bool m_bDisplayDebugCollisionGraphic
 
bool m_bEnableFluids
 true to enable fluid interactions.
 
bool m_bFoodSource
 Tells if this body is considered a food source.
 
bool m_bFreeze
 
bool m_bIsCollisionObject
 This determines whether the object is a collision geometry object.
 
bool m_bIsContactSensor
 
bool m_bIsStickyPart
 
bool m_bUsesJoint
 
float m_fltAngularVelocityDamping
 The angular velocity damping for this part.
 
float m_fltBuoyancyScale
 
float m_fltDensity
 Uniform density for the rigid body.
 
float m_fltFoodEaten
 Tells how much food is being eaten.
 
float m_fltFoodEnergyContent
 The energy content of the food in calories.
 
float m_fltFoodQuantity
 The quantity of food that this part contains.
 
float m_fltFoodQuantityInit
 The initial food quantity to use when simulation is reset.
 
float m_fltFoodReplenishRate
 The rate at which food is replenished.
 
float m_fltLinearVelocityDamping
 The linear velocity damping for this body part.
 
float m_fltMagnus
 The Magnus coefficient for the body. This is defaulted to zero because it almost always negligble for most body parts.
 
float m_fltMass
 The mass of the object.
 
float m_fltMaxFoodQuantity
 The maximum food quantity that this part can contain.
 
float m_fltMaxHydroForce
 The maximum hyrdodynamic force that can be applied.
 
float m_fltMaxHydroTorque
 The maximum hyrdodynamic torque that can be applied.
 
float m_fltReportDensity
 The density value reported to the GUI.
 
float m_fltReportMass
 The mass of the object to report to GUI.
 
float m_fltReportVolume
 The volume of the object to report to GUI.
 
float m_fltStickyOn
 If this is a suction part then this controls when stickness is on.
 
float m_fltSurfaceContactCount
 
float m_fltVolume
 The volume for the rigid body.
 
long m_lEatTime
 Keeps track of how many time slices this part can eat.
 
ContactSensorm_lpContactSensor
 
Jointm_lpJointToParent
 
RigidBodym_lpStickyChild
 If we are doing a sticky lock then this is the child part that was locked on.
 
std::string m_strMaterialID
 Identifier for the material type this part will use.
 
CStdFPoint m_vAngularDrag
 This is the drag coefficients for the three axises for the body.
 
CStdFPoint m_vBuoyancyCenter
 This is the relative position to the center of the buoyancy in the body.
 
CStdFPoint m_vCenterOfMass
 
CStdFPoint m_vLinearDrag
 This is the drag coefficients for the three axises for the body.
 
- Protected Attributes inherited from AnimatSim::Environment::BodyPart
CStdArray< RobotPartInterface * > m_aryRobotParts
 Array of pointers to robot part interfaces connected to this body part.
 
bool m_bSynchWithRobot
 
float m_fltSynchUpdateInterval
 This is how often we need to update this particular adapter.
 
int m_iSynchCount
 Keeps track of the last time we did a synch for the robot.
 
int m_iSynchUpdateInterval
 The number of ticks between each call to update for this adapter till the next update time.
 
IPhysicsBodym_lpPhysicsBody
 
- Protected Attributes inherited from AnimatSim::Node
bool m_bInitEnabled
 Keeps track of the enabled state at sim startup.
 
float m_fltEnabled
 This is used for reporting the enabled state in a GetDataPointer call.
 
Organism * m_lpOrganism
 The pointer to this node's organism.
 
- Protected Attributes inherited from AnimatSim::AnimatBase
bool m_bEnabled
 Tells if this item is enabled or not. If it is not enabled then it is not run.
 
bool m_bSelected
 Tells whether the object is selected or not.
 
AnimatSim::Behavior::NeuralModulem_lpModule
 The pointer to this items parentNeuralModule. If this is not relevant for this object then this is NULL.
 
Nodem_lpNode
 The pointer to this items parent Node. If this is not relevant for this object then this is NULL.
 
Simulatorm_lpSim
 The pointer to a Simulation.
 
AnimatSim::Environment::Structurem_lpStructure
 The pointer to this items parent Structure. If this is not relevant for this object then this is NULL.
 
std::string m_strID
 The unique Id for this object.
 
std::string m_strName
 The name for this object.
 
std::string m_strType
 The type for this object. Examples are Box, Plane, Neuron, etc..
 
- Protected Attributes inherited from AnimatSim::Environment::MovableItem
bool m_bIsSelected
 Keeps track of whether this movable item has been selected or not.
 
bool m_bIsVisible
 
float m_fltAlpha
 The current alpha transparency for this body part.
 
float m_fltCollisionsAlpha
 The alpha transparency used in the Collisions VisualSelectionMode.
 
float m_fltGraphicsAlpha
 The alpha transparency used in the Graphics VisualSelectionMode.
 
float m_fltJointsAlpha
 The alpha transparency used in the Joints VisualSelectionMode.
 
float m_fltReceptiveFieldsAlpha
 The alpha transparency used in the Receptive Fields VisualSelectionMode.
 
float m_fltReportIsVisible
 
float m_fltShininess
 The shininess of the part. A value between 0 and 128.
 
float m_fltSimulationAlpha
 The alpha transparency used in the Simulation VisualSelectionMode.
 
float m_fltUserDefinedDraggerRadius
 User defined drag handle radius. If this is -1 then the user has not set the value and the default is used.
 
IMovableItemCallbackm_lpCallback
 
Simulatorm_lpMovableSim
 The pointer to a Simulation.
 
RigidBodym_lpParent
 
IPhysicsMovableItemm_lpPhysicsMovableItem
 
CStdFPoint m_oAbsPosition
 
CStdFPoint m_oPosition
 These are rotation and position coords relative to the parent if this is a body part.
 
CStdFPoint m_oReportPosition
 This is used for reporting the position back to the GUI. It is the position scaled for distance units.
 
CStdFPoint m_oReportRotation
 
CStdFPoint m_oReportWorldPosition
 This is used for reporting the position back to the GUI. It is the world position scaled for distance units.
 
CStdFPoint m_oRotation
 
std::string m_strTexture
 An optional texture to apply to the rigid body.
 
CStdColor m_vAmbient
 The ambient color to apply to this part. It is specified as red, green, blue, and alpha.
 
CStdColor m_vDiffuse
 The diffuse color to apply to this part. It is specified as red, green, blue, and alpha.
 
CStdFPoint m_vSelectedVertex
 The relative position of the selected vertex.
 
CStdColor m_vSpecular
 The specular color to apply to this part. It is specified as red, green, blue, and alpha.
 

Detailed Description

The base class for all of the basic rigid body type of objects.

This class provides the base functionality for a rigid body. Each structure/Organism is made up of a heirarchcal tree of rigid bodies that are connected by Joint objects. The base structure has a root rigid body. That root body has a list of child rigid bodies that are connected to the root through a joint. Each of those child bodies can then have other children connected to them and so on.

Each rigid body within a structure/organism has a unique string identifier that is specifed for it. Whenever you are attempting to find a given part through a function like Simulator::FindRigidBody it is this identifier that is used as the key in the search. This class also contains a number of parameters that are common for all rigid bodies. These include things like the colors of the object and the uniform density of the body. All rigid bodies have these properties.

This is a virtual base class and can not be directly created. You must override this class to provide specific functionality in order to create a real rigid body. For example, the Box and Cylinder are two examples of subclasses of a rigid body that add more parameters specific for their body type. Box has the x,y, and z widths for the box, whereas cylinder has the radius and height of the cylinder to create. The purpose of RigidBody and its subclasses like Box are to try and implement as much of the functionality as can be accomplished in this library, yet leave it flexible enough that a new physics engine could be easily swapped in for later use. This means that a lot of the mundane things like loading the data for the different rigid body and joint types is done for you automatically by the Body and Joint classes. But these classes can still not really implement all of the functionality necessary for the rigid body. The reason for this is that the overridable functions to create the actual implementation for those parts in your chosen physics engine must still be implemented. The two main functions related to that are CreateParts and CreateJoints. Since AnimatSim is generalized so that it is not tightly coupled to any one physics engine then that coupling must be done in the layer above this library where the chosen physics engine like Vortex is actually used.

Author
dcofer
Date
3/2/2011

Definition at line 66 of file RigidBody.h.

Constructor & Destructor Documentation

AnimatSim::Environment::RigidBody::~RigidBody ( )
virtual

Member Function Documentation

void AnimatSim::Environment::RigidBody::AddContactSensor ( std::string  strXml)
protectedvirtual

Creates and adds a ContactSensor.

Author
dcofer
Date
3/2/2011
Parameters
strXmlThe xml data packet for loading the body.

Definition at line 2065 of file RigidBody.cpp.

References StdUtils::CStdXml::Deserialize(), StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), m_lpContactSensor, and AnimatSim::Environment::BodyPart::m_lpPhysicsBody.

Referenced by AddItem().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::AddExternalNodeInput ( int  iTargetDataType,
float  fltInput 
)
virtual

Adds an external node input.

This is used by the adapter to add a new external value to this node. It is up to the node to interpret what that value means. For example, if it is a neuron then it can interpret it to be a current. This value is added to the current total so that multiple adapters can call this in a given time step. It is cleared out to zero at the beginning of the time step. You can now also specify which data you are adding to for this method call. This allows adapters to be setup to change multiple different variables in the system.

Author
dcofer
Date
6/16/2014
Parameters
iTargetDataTypeThe index of the target data type we are adding to.
fltInputThe new input.

Implements AnimatSim::Node.

Reimplemented in AnimatSim::Environment::Bodies::Spring, AnimatSim::Environment::Bodies::MuscleBase, AnimatSim::Environment::Bodies::Stomach, and AnimatSim::Environment::Bodies::Mouth.

Definition at line 1618 of file RigidBody.cpp.

References m_fltStickyOn.

void AnimatSim::Environment::RigidBody::AddForceAtLocalPos ( float  fltPx,
float  fltPy,
float  fltPz,
float  fltFx,
float  fltFy,
float  fltFz,
bool  bScaleUnits 
)
virtual

Adds a world-coordinate based force vector to this body at a specified local body position.

Author
dcofer
Date
2/9/2014
Parameters
fltPxThe x position relative to the COM in local part coordinates.
fltPyThe y position relative to the COM in local part coordinates.
fltPzThe z position relative to the COM in local part coordinates.
fltFxThe x force in world coordinates.
fltFyThe y force in world coordinates.
fltFzThe z force in world coordinates.
bScaleUnitsIf true then the force and value is scaled by the ScaleUnits, otherwise it is applied as provided.

Definition at line 2461 of file RigidBody.cpp.

References AnimatSim::Environment::BodyPart::m_lpPhysicsBody.

Referenced by AnimatSim::ExternalStimuli::ForceStimulus::StepSimulation().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::AddForceAtWorldPos ( float  fltPx,
float  fltPy,
float  fltPz,
float  fltFx,
float  fltFy,
float  fltFz,
bool  bScaleUnits 
)
virtual

Adds a world-coordinate based force vector to this body at a specified world-coordinate body position.

Author
dcofer
Date
2/9/2014
Parameters
fltPxThe x position in world coordinates.
fltPyThe y position in world coordinates.
fltPzThe z position in world coordinates.
fltFxThe x force in world coordinates.
fltFyThe y force in world coordinates.
fltFzThe z force in world coordinates.
bScaleUnitsIf true then the force and value is scaled by the ScaleUnits, otherwise it is applied as provided.

Definition at line 2483 of file RigidBody.cpp.

References AnimatSim::Environment::BodyPart::m_lpPhysicsBody.

bool AnimatSim::Environment::RigidBody::AddItem ( const std::string &  strItemType,
const std::string &  strXml,
bool  bThrowError = true,
bool  bDoNotInit = false 
)
virtual

Adds a new object to this parent.

Generic method to add a new child item to this parent by specifying a string item type descriptor and an xml packet that can be used to load in the new object. The GUI uses this method to create new items that were added with the user interface. The item type lets the method determine what type of item is being created, like synapse, neuron, body part, etc.. It then gets the modulename, classname, and type from the xml and calls CreateObject to create the appropriate type of object. Then it passes in the xml packet to the new objects load method and does any needed initialization and adds it to the parent.

Author
dcofer
Date
2/22/2011
Parameters
strItemTypeString descriptor of the type of item that is being created.
strXmlXML packet that is used to create and load the new item.
bThrowErrorIf true then throw an error if there is a problem, otherwise return false.
Returns
true if it succeeds, false if it fails.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 1907 of file RigidBody.cpp.

References AddContactSensor(), AddOdor(), AddRigidBody(), and StdUtils::Std_CheckString().

+ Here is the call graph for this function:

void AnimatSim::Environment::RigidBody::AddOdor ( Odor lpOdor)
protectedvirtual

Adds an odor source to this body part.

Author
dcofer
Date
3/2/2011
Parameters
[in,out]lpOdorThe pointer to an odor source to add.

Definition at line 2370 of file RigidBody.cpp.

References AnimatSim::AnimatBase::ID(), m_aryOdorSources, and StdUtils::CStdErrorInfo::m_strError.

Referenced by AddItem(), and LoadOdor().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

RigidBody * AnimatSim::Environment::RigidBody::AddRigidBody ( std::string  strXml)
protectedvirtual

Creates and adds a rigid body.

Author
dcofer
Date
3/2/2011
Parameters
strXmlThe xml data packet for loading the body.

Definition at line 1973 of file RigidBody.cpp.

References CreateJoints(), CreateParts(), StdUtils::CStdXml::Deserialize(), StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), AnimatSim::AnimatBase::ID(), AnimatSim::Environment::BodyPart::Initialize(), LoadRigidBody(), AnimatSim::Environment::BodyPart::m_lpPhysicsBody, and AnimatSim::AnimatBase::m_lpSim.

Referenced by AddItem().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::AddSurfaceContact ( RigidBody lpContactedSurface)
virtual

Increments the surface contact count when this part collides with something in the virtual world.

If this item is setup to be a contact sensor then when the physics engine detects a collision between two objects it will provide this back to us. We then call this method to update the number of contacts that this object is undergoing. This value can then be used to detect whether, and how many, contacts are currently happening.

Author
dcofer
Date
3/2/2011
Parameters
[in,out]lpContactedSurfaceThe pointer to the other contacted surface.

Definition at line 1261 of file RigidBody.cpp.

References m_fltSurfaceContactCount.

void AnimatSim::Environment::RigidBody::AddTorque ( float  fltTx,
float  fltTy,
float  fltTz,
bool  bScaleUnits 
)
virtual

Adds a torque to this body about its center.

Author
dcofer
Date
3/2/2011
Parameters
fltTxThe torque about the x axis.
fltTyThe torque about the y axis.
fltTzThe torque about the z axis.
bScaleUnitsIf true then the force and value is scaled by the ScaleUnits, otherwise it is applied as provided.

Definition at line 2501 of file RigidBody.cpp.

References AnimatSim::Environment::BodyPart::m_lpPhysicsBody.

Referenced by AnimatSim::ExternalStimuli::ForceStimulus::StepSimulation().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::AfterResetSimulation ( )
virtual

Called after a simulation reset for some objects.

This method is only used by some objects because they need to do some processing after the simulation has been reset.

Author
dcofer
Date
3/4/2011

Reimplemented from AnimatSim::AnimatBase.

Reimplemented in AnimatSim::Environment::Bodies::LinearHillMuscle, AnimatSim::Environment::Bodies::LineBase, VortexAnimatSim::Environment::Bodies::VsLinearHillMuscle, BulletAnimatSim::Environment::Bodies::BlLinearHillMuscle, and RoboticsAnimatSim::Environment::Bodies::RbLinearHillMuscle.

Definition at line 1503 of file RigidBody.cpp.

References AnimatSim::Environment::Joint::AfterResetSimulation(), m_aryChildParts, and m_lpJointToParent.

Referenced by AnimatSim::Environment::Bodies::LineBase::AfterResetSimulation(), and AnimatSim::Environment::Structure::ResetSimulation().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

CStdFPoint AnimatSim::Environment::RigidBody::AngularDrag ( )
virtual

Gets the angular drag coefficients for the three axises for the body.

Author
dcofer
Date
3/2/2011
Returns
returns m_vLinearDrag.

Definition at line 1060 of file RigidBody.cpp.

References m_vAngularDrag.

Referenced by AngularDrag().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::AngularDrag ( CStdFPoint &  oPoint)
virtual

Sets the angular drag coefficients for the three axises for the body.

Author
dcofer
Date
3/2/2011
Parameters
[in,out]oPointThe new point to use to set the drag.

Definition at line 1070 of file RigidBody.cpp.

References AnimatSim::Environment::BodyPart::m_lpPhysicsBody, and m_vAngularDrag.

void AnimatSim::Environment::RigidBody::AngularDrag ( float  fltX,
float  fltY,
float  fltZ 
)
virtual

Sets the angular drag coefficients for the three axises for the body.

Author
dcofer
Date
3/2/2011
Parameters
fltXThe x coordinate.
fltYThe y coordinate.
fltZThe z coordinate.

Definition at line 1088 of file RigidBody.cpp.

References AngularDrag().

+ Here is the call graph for this function:

void AnimatSim::Environment::RigidBody::AngularDrag ( std::string  strXml)
virtual

Sets the angular drag coefficients for the three axises for the body. This method is primarily used by the GUI to reset the local position using an xml data packet.

Author
dcofer
Date
3/2/2011
Parameters
strXmlThe xml string with the data to load in the position.

Definition at line 1103 of file RigidBody.cpp.

References AngularDrag(), StdUtils::CStdXml::Deserialize(), StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), and StdUtils::Std_LoadPoint().

+ Here is the call graph for this function:

float AnimatSim::Environment::RigidBody::AngularVelocityDamping ( )
virtual

Gets the angular velocity damping.

Author
dcofer
Date
3/2/2011
Returns
Angular velocity damping for this part.

Definition at line 829 of file RigidBody.cpp.

References m_fltAngularVelocityDamping.

void AnimatSim::Environment::RigidBody::AngularVelocityDamping ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the angular velocity damping.

Author
dcofer
Date
3/2/2011
Parameters
fltValThe new value.
Exceptions
Valuemust be zero or greater.

Definition at line 840 of file RigidBody.cpp.

References AnimatSim::Simulator::DisplayMassUnits(), m_fltAngularVelocityDamping, m_fltLinearVelocityDamping, AnimatSim::Environment::BodyPart::m_lpPhysicsBody, AnimatSim::AnimatBase::m_lpSim, and StdUtils::Std_InValidRange().

+ Here is the call graph for this function:

CStdFPoint AnimatSim::Environment::RigidBody::BuoyancyCenter ( )
virtual

Gets the relative position to the center of the buoyancy in the body.

Author
dcofer
Date
3/2/2011
Returns
returns m_vBuoyancyCenter.

Definition at line 896 of file RigidBody.cpp.

References m_vBuoyancyCenter.

Referenced by BuoyancyCenter().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::BuoyancyCenter ( CStdFPoint &  oPoint,
bool  bUseScaling = true 
)
virtual

Sets the relative position to the center of the buoyancy in the body.

Author
dcofer
Date
3/2/2011
Parameters
[in,out]oPointThe new point to use to set the local position.
bUseScalingIf true then the position values that are passed in will be scaled by the unit scaling values.

Definition at line 908 of file RigidBody.cpp.

References AnimatSim::Simulator::InverseDistanceUnits(), AnimatSim::Environment::MovableItem::m_lpMovableSim, AnimatSim::Environment::BodyPart::m_lpPhysicsBody, and m_vBuoyancyCenter.

+ Here is the call graph for this function:

void AnimatSim::Environment::RigidBody::BuoyancyCenter ( float  fltX,
float  fltY,
float  fltZ,
bool  bUseScaling = true 
)
virtual

Sets the relative position to the center of the buoyancy in the body.

Author
dcofer
Date
3/2/2011
Parameters
fltXThe x coordinate.
fltYThe y coordinate.
fltZThe z coordinate.
bUseScalingIf true then the position values that are passed in will be scaled by the unit scaling values.

Definition at line 931 of file RigidBody.cpp.

References BuoyancyCenter().

+ Here is the call graph for this function:

void AnimatSim::Environment::RigidBody::BuoyancyCenter ( std::string  strXml,
bool  bUseScaling = true 
)
virtual

Sets tthe relative position to the center of the buoyancy in the body. This method is primarily used by the GUI to reset the local position using an xml data packet.

Author
dcofer
Date
3/2/2011
Parameters
strXmlThe xml string with the data to load in the position.
bUseScalingIf true then the position values that are passed in will be scaled by the unit scaling values.

Definition at line 948 of file RigidBody.cpp.

References BuoyancyCenter(), StdUtils::CStdXml::Deserialize(), StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), and StdUtils::Std_LoadPoint().

+ Here is the call graph for this function:

float AnimatSim::Environment::RigidBody::BuoyancyScale ( )
virtual

Gets the scale used to calculate the buoyancy value.

Author
dcofer
Date
3/2/2011
Returns
scale value.

Definition at line 968 of file RigidBody.cpp.

References m_fltBuoyancyScale.

void AnimatSim::Environment::RigidBody::BuoyancyScale ( float  fltVal)
virtual

Sets the scale used to calculate the buoyancy value.

Author
dcofer
Date
3/2/2011
Parameters
fltValThe new scale value greater than or equal to 0.
Exceptions
Ifvalue not greater than or equal to 0.

Definition at line 979 of file RigidBody.cpp.

References m_fltBuoyancyScale, AnimatSim::Environment::BodyPart::m_lpPhysicsBody, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

CStdFPoint AnimatSim::Environment::RigidBody::CenterOfMass ( )
virtual

Gets the user specified center of mass.

If this is (0, 0, 0) then the default COM is used for the part. This is only used if the user sets it to something.

Author
dcofer
Date
3/2/2011
Returns
COM point.

Definition at line 169 of file RigidBody.cpp.

References m_vCenterOfMass.

Referenced by CenterOfMass().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::CenterOfMass ( CStdFPoint &  vPoint,
bool  bUseScaling = true 
)
virtual

Sets the user specified center of mass for this part. (m_vCenterOfMass). If COM is (0,0,0) then it is not used.

Author
dcofer
Date
3/2/2011
Parameters
[in,out]oPointThe point.

Definition at line 216 of file RigidBody.cpp.

References CenterOfMass().

+ Here is the call graph for this function:

void AnimatSim::Environment::RigidBody::CenterOfMass ( float  fltX,
float  fltY,
float  fltZ,
bool  bUseScaling = true 
)
virtual

Sets the center of mass position. (m_vCenterOfMass). If COM is (0,0,0) then it is not used.

Author
dcofer
Date
3/2/2011
Parameters
fltXThe x coordinate.
fltYThe y coordinate.
fltZThe z coordinate.
bUseScalingIf true then the position values that are passed in will be scaled by the unit scaling values.

Definition at line 245 of file RigidBody.cpp.

References CenterOfMass().

+ Here is the call graph for this function:

void AnimatSim::Environment::RigidBody::CenterOfMass ( std::string  strXml,
bool  bUseScaling = true 
)
virtual

Sets the center of mass position for the body. (m_vCenterOfMass). This method is primarily used by the GUI to reset the local position using an xml data packet. If COM is (0,0,0) then it is not used.

Author
dcofer
Date
3/2/2011
Parameters
strXmlThe xml string with the data to load in the position.
bUseScalingIf true then the position values that are passed in will be scaled by the unit scaling values.

Definition at line 262 of file RigidBody.cpp.

References CenterOfMass(), StdUtils::CStdXml::Deserialize(), StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), and StdUtils::Std_LoadPoint().

+ Here is the call graph for this function:

CStdFPoint AnimatSim::Environment::RigidBody::CenterOfMassWithStaticChildren ( )
virtual

Gets the center of mass of this part with any static children added.

Author
David Cofer
Date
10/10/2013
Returns
resultant center of mass of all static parts of this part.

Definition at line 179 of file RigidBody.cpp.

References HasStaticChildren(), HasStaticJoint(), m_aryChildParts, m_vCenterOfMass, and Position().

+ Here is the call graph for this function:

CStdPtrArray< RigidBody > * AnimatSim::Environment::RigidBody::ChildParts ( )
virtual

Gets the array of child parts.

Author
dcofer
Date
3/2/2011
Returns
pointer to array of child parts.

Definition at line 283 of file RigidBody.cpp.

References m_aryChildParts.

void AnimatSim::Environment::RigidBody::CreateChildJoints ( )
virtual

Loops through all the child parts of this rigid body and call CreateJoints.

This is called by CreateJoints method to recursively call CreateJoints for all children.

Author
dcofer
Date
10/7/2013

Definition at line 1585 of file RigidBody.cpp.

References CreateJoints(), and m_aryChildParts.

Referenced by CreateJoints().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::CreateChildParts ( )
virtual

Loops through all the child parts of this rigid body and call CreateParts.

This is called by CreateParts method to recursively call CreateParts for all children.

Author
dcofer
Date
10/7/2013

Definition at line 1548 of file RigidBody.cpp.

References CreateParts(), and m_aryChildParts.

Referenced by CreateParts().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::CreateJoints ( )
virtual

Allows the rigid body to create its joints using the chosen physics engine.

This function can not be truly implemented in the Animat library. It must be implemented in the next layer sitting above it. The reason for this is that the Animat library was made to be generalized so it could work with a number of different physics engines. Therefore it is not tightly coupled with any one engine. This in turn means that we can not implement the code in this library neccessary to create a part or joint in the chosen engine. Several overridable functions have been provided that allow you to do this. The two that will always have to be overridden are the CreateParts and CreateJoints methods. CreateJoints makes the API calls to the physics engine to create the joint and constraints and motors. You should still call the base class method at the end of your overridden method so the rigid body can walk down the tree and create the joints for its children.

Author
dcofer
Date
3/2/2011

Reimplemented in AnimatSim::Environment::Bodies::LinearHillMuscle, AnimatSim::Environment::Bodies::LineBase, AnimatSim::Environment::Bodies::Sensor, VortexAnimatSim::Environment::Bodies::VsSpring, BulletAnimatSim::Environment::Bodies::BlTerrain, VortexAnimatSim::Environment::Bodies::VsBoxTest, VortexAnimatSim::Environment::Bodies::VsCone, VortexAnimatSim::Environment::Bodies::VsCylinder, VortexAnimatSim::Environment::Bodies::VsSphere, VortexAnimatSim::Environment::Bodies::VsBox, BulletAnimatSim::Environment::Bodies::BlBox, BulletAnimatSim::Environment::Bodies::BlMesh, VortexAnimatSim::Environment::Bodies::VsEllipsoid, BulletAnimatSim::Environment::Bodies::BlEllipsoid, VortexAnimatSim::Environment::Bodies::VsTerrain, VortexAnimatSim::Environment::Bodies::VsTorus, BulletAnimatSim::Environment::Bodies::BlCone, BulletAnimatSim::Environment::Bodies::BlTorus, VortexAnimatSim::Environment::Bodies::VsLinearHillMuscle, VortexAnimatSim::Environment::Bodies::VsLinearHillStretchReceptor, BulletAnimatSim::Environment::Bodies::BlCylinder, RoboticsAnimatSim::Environment::Bodies::RbBox, BulletAnimatSim::Environment::Bodies::BlSphere, VortexAnimatSim::Environment::Bodies::VsMesh, RoboticsAnimatSim::Environment::Bodies::RbEllipsoid, RoboticsAnimatSim::Environment::Bodies::RbTorus, RoboticsAnimatSim::Environment::Bodies::RbCone, BulletAnimatSim::Environment::Bodies::BlLinearHillMuscle, RoboticsAnimatSim::Environment::Bodies::RbCylinder, RoboticsAnimatSim::Environment::Bodies::RbLinearHillMuscle, BulletAnimatSim::Environment::Bodies::BlLinearHillStretchReceptor, RoboticsAnimatSim::Environment::Bodies::RbLinearHillStretchReceptor, RoboticsAnimatSim::Environment::Bodies::RbSphere, BulletAnimatSim::Environment::Bodies::BlSpring, RoboticsAnimatSim::Environment::Bodies::RbMesh, and RoboticsAnimatSim::Environment::Bodies::RbSpring.

Definition at line 1572 of file RigidBody.cpp.

References CreateChildJoints().

Referenced by AddRigidBody(), AnimatSim::Environment::Structure::AddRoot(), and CreateChildJoints().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::CreateParts ( )
virtual

Allows the rigid body to create its parts using the chosen physics engine.

This function can not be truly implemented in the Animat library. It must be implemented in the next layer sitting above it. The reason for this is that the Animat library was made to be generalized so it could work with a number of different physics engines. Therefore it is not tightly coupled with any one engine. This in turn means that we can not implement the code in this library neccessary to create a part or joint in the chosen engine. Several overridable functions have been provided that allow you to do this. The two that will always have to be overridden are the CreateParts and CreateJoints methods. CreateParts makes the API calls to the physics engine to create the collision models, graphics models and so on. You should still call the base class method at the end of your overridden method so the rigid body can walk down the tree and create the parts for its children.

Author
dcofer
Date
3/2/2011

Reimplemented in AnimatSim::Environment::Bodies::Spring, AnimatSim::Environment::Bodies::Stomach, AnimatSim::Environment::Bodies::LineBase, AnimatSim::Environment::Bodies::Sensor, BulletAnimatSim::Environment::Bodies::BlTerrain, OsgAnimatSim::Environment::Bodies::OsgMouth, OsgAnimatSim::Environment::Bodies::OsgOdorSensor, OsgAnimatSim::Environment::Bodies::OsgAttachment, VortexAnimatSim::Environment::Bodies::VsFluidPlane, BulletAnimatSim::Environment::Bodies::BlFluidPlane, VortexAnimatSim::Environment::Bodies::VsBoxTest, VortexAnimatSim::Environment::Bodies::VsCone, VortexAnimatSim::Environment::Bodies::VsCylinder, VortexAnimatSim::Environment::Bodies::VsSphere, VortexAnimatSim::Environment::Bodies::VsAttachment, VortexAnimatSim::Environment::Bodies::VsBox, BulletAnimatSim::Environment::Bodies::BlBox, VortexAnimatSim::Environment::Bodies::VsPlaneTest, BulletAnimatSim::Environment::Bodies::BlMesh, BulletAnimatSim::Environment::Bodies::BlPlane, VortexAnimatSim::Environment::Bodies::VsEllipsoid, BulletAnimatSim::Environment::Bodies::BlEllipsoid, VortexAnimatSim::Environment::Bodies::VsTerrain, VortexAnimatSim::Environment::Bodies::VsTorus, BulletAnimatSim::Environment::Bodies::BlCone, BulletAnimatSim::Environment::Bodies::BlTorus, VortexAnimatSim::Environment::Bodies::VsMouth, VortexAnimatSim::Environment::Bodies::VsOdorSensor, VortexAnimatSim::Environment::Bodies::VsPlane, BulletAnimatSim::Environment::Bodies::BlCylinder, RoboticsAnimatSim::Environment::Bodies::RbBox, BulletAnimatSim::Environment::Bodies::BlSphere, VortexAnimatSim::Environment::Bodies::VsMesh, RoboticsAnimatSim::Environment::Bodies::RbEllipsoid, RoboticsAnimatSim::Environment::Bodies::RbMouth, RoboticsAnimatSim::Environment::Bodies::RbOdorSensor, RoboticsAnimatSim::Environment::Bodies::RbTorus, RoboticsAnimatSim::Environment::Bodies::RbCone, RoboticsAnimatSim::Environment::Bodies::RbCylinder, RoboticsAnimatSim::Environment::Bodies::RbSphere, and RoboticsAnimatSim::Environment::Bodies::RbMesh.

Definition at line 1531 of file RigidBody.cpp.

References CreateChildParts(), m_bFoodSource, m_fltFoodReplenishRate, AnimatSim::AnimatBase::m_lpSim, and AnimatSim::Simulator::PhysicsTimeStep().

Referenced by AddRigidBody(), AnimatSim::Environment::Structure::AddRoot(), and CreateChildParts().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float AnimatSim::Environment::RigidBody::Density ( )
virtual

Gets the uniform density.

Author
dcofer
Date
3/2/2011
Returns
Uniform density value of this part.

Definition at line 323 of file RigidBody.cpp.

References m_fltDensity.

void AnimatSim::Environment::RigidBody::Density ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the uniform density of this part.

Author
dcofer
Date
3/2/2011
Parameters
fltValThe new density value.
Exceptions
Densitymust be greater than zero.

Definition at line 334 of file RigidBody.cpp.

References AnimatSim::Simulator::DenominatorDistanceUnits(), AnimatSim::Simulator::DisplayMassUnits(), m_fltDensity, m_fltReportDensity, AnimatSim::Environment::BodyPart::m_lpPhysicsBody, AnimatSim::AnimatBase::m_lpSim, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

void AnimatSim::Environment::RigidBody::DisableCollision ( RigidBody lpBody)
virtual

Disables collision between the past-in object and this object.

This method disables collision responses between the rigid body being past in and this rigid body. This is a virtual method that should be overridden in the simulator system. You need to call physics engine API's to disable the collision responses between these two objects. This method does nothing by default.

Author
dcofer
Date
3/2/2011
Parameters
[in,out]lpBodyThe pointer to a body.

Definition at line 1374 of file RigidBody.cpp.

References FindCollisionExclusionBody(), m_aryExcludeCollisionSet, and AnimatSim::Environment::BodyPart::m_lpPhysicsBody.

Referenced by AnimatSim::Environment::Structure::DisableCollision().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::Eat ( float  fltBiteSize,
long  lTimeSlice 
)
virtual

This item is eating the specified amount of food.

Author
dcofer
Date
3/2/2011
Parameters
fltValThe amount of food to eat.
lTimeSliceThe time slice during which the eating is occuring.

Definition at line 1320 of file RigidBody.cpp.

References m_fltFoodEaten, m_fltFoodQuantity, and m_lEatTime.

Referenced by AnimatSim::Environment::Bodies::Mouth::StepSimulation().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::EnableCollision ( RigidBody lpBody)
virtual

Enables collision between the past-in object and this object.

This method enables collision responses between the rigid body being past in and this rigid body. This is a virtual method that should be overridden in the simulator system. You need to call physics engine API's to enable the collision responses between these two objects. This method does nothing by default.

Author
dcofer
Date
3/2/2011
Parameters
[in,out]lpBodyThe pointer to a body.

Definition at line 1343 of file RigidBody.cpp.

References FindCollisionExclusionBody(), m_aryExcludeCollisionSet, and AnimatSim::Environment::BodyPart::m_lpPhysicsBody.

Referenced by AnimatSim::Environment::Structure::EnableCollision().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool AnimatSim::Environment::RigidBody::EnableFluids ( )
virtual

Query if this object has fluid interactions turned on.

Author
dcofer
Date
3/2/2011
Returns
true if on, false if not.

Definition at line 1210 of file RigidBody.cpp.

References m_bEnableFluids.

void AnimatSim::Environment::RigidBody::EnableFluids ( bool  bVal)
virtual

Sets whether this object has fluid interactions turned on.

Author
dcofer
Date
3/2/2011
Parameters
bValtrue to turn on, false to turn off.

Definition at line 1220 of file RigidBody.cpp.

References m_bEnableFluids, and AnimatSim::Environment::BodyPart::m_lpPhysicsBody.

int AnimatSim::Environment::RigidBody::FindChildListPos ( std::string  strID,
bool  bThrowError = true 
)
protectedvirtual

Finds the array index for the child part with the specified ID.

Author
dcofer
Date
3/2/2011
Parameters
strIDID of part to find
bThrowErrorIf true and ID is not found then it will throw an error, else return NULL
Exceptions
IfbThrowError is true and ID is not found.
Returns
If bThrowError is false and ID is not found returns NULL, else returns the pointer to the found part.

Definition at line 2042 of file RigidBody.cpp.

References AnimatSim::AnimatBase::ID(), m_aryChildParts, StdUtils::Std_ToUpper(), and StdUtils::Std_Trim().

Referenced by RemoveRigidBody().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool AnimatSim::Environment::RigidBody::FindCollisionExclusionBody ( RigidBody lpBody,
bool  bThrowError = true 
)
virtual

Searches the exclusion collision list to see if the specified part is already present.

Author
dcofer
Date
3/28/2011
Parameters
lpBodyBody part to find in the exclusion list.
bThrowErrortrue to throw error if there is a problem.
Returns
index of found body part, or -1 if not found
Exceptions
IfbThrowError=True and no part is found it throws an exception.

Definition at line 1404 of file RigidBody.cpp.

References AnimatSim::AnimatBase::ID(), and m_aryExcludeCollisionSet.

Referenced by DisableCollision(), EnableCollision(), and RemoveCollisionExclusions().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float AnimatSim::Environment::RigidBody::FoodEaten ( )
virtual

Gets the amount of food eaten.

Author
dcofer
Date
3/2/2011
Returns
Amount of food eaten.

Definition at line 705 of file RigidBody.cpp.

References m_fltFoodEaten.

void AnimatSim::Environment::RigidBody::FoodEaten ( float  fltVal)
virtual

Sets the amount of food eaten.

Author
dcofer
Date
3/2/2011
Parameters
fltValThe amount of food eaten.

Definition at line 715 of file RigidBody.cpp.

References m_fltFoodEaten.

float AnimatSim::Environment::RigidBody::FoodEnergyContent ( )
virtual

Gets the food energy content.

Author
dcofer
Date
3/2/2011
Returns
Food energy content.

Definition at line 749 of file RigidBody.cpp.

References m_fltFoodEnergyContent.

Referenced by AnimatSim::Environment::Bodies::Mouth::StepSimulation().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::FoodEnergyContent ( float  fltVal)
virtual

Sets the food energy content.

Author
dcofer
Date
3/2/2011
Parameters
fltValThe new food energy content value.
Exceptions
FoodQuantity must be zero or greater.

Definition at line 760 of file RigidBody.cpp.

References m_fltFoodEnergyContent, and StdUtils::Std_InValidRange().

+ Here is the call graph for this function:

float AnimatSim::Environment::RigidBody::FoodQuantity ( )
virtual

Gets the food quantity.

Author
dcofer
Date
3/2/2011
Returns
Food Quantity.

Definition at line 676 of file RigidBody.cpp.

References m_fltFoodQuantity.

Referenced by AnimatSim::Environment::Odor::Quantity(), and AnimatSim::Environment::Bodies::Mouth::StepSimulation().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::FoodQuantity ( float  fltVal)
virtual

Sets the Food quantity.

Author
dcofer
Date
3/2/2011
Parameters
fltValThe new food quantity value.
Exceptions
FoodQuantity must be zero or greater.

Definition at line 687 of file RigidBody.cpp.

References m_fltFoodQuantity, m_fltFoodQuantityInit, AnimatSim::AnimatBase::m_lpSim, AnimatSim::Simulator::SimRunning(), and StdUtils::Std_InValidRange().

+ Here is the call graph for this function:

float AnimatSim::Environment::RigidBody::FoodReplenishRate ( )
virtual

Gets the food replenish rate.

Author
dcofer
Date
3/2/2011
Returns
Food replenish rate.

Definition at line 725 of file RigidBody.cpp.

References m_fltFoodReplenishRate.

void AnimatSim::Environment::RigidBody::FoodReplenishRate ( float  fltVal)
virtual

Sets the food replenish rate.

Author
dcofer
Date
3/2/2011
Parameters
fltValThe new replenish rate.

Definition at line 735 of file RigidBody.cpp.

References m_fltFoodReplenishRate, and StdUtils::Std_InValidRange().

+ Here is the call graph for this function:

bool AnimatSim::Environment::RigidBody::Freeze ( )
virtual

Tells if this part is frozen or not.

Specifies if the part should frozen in place to the world. If a rigid body is frozen then it is as if it is nailed in place and can not move. Gravity and and other forces will not act on it.

Author
dcofer
Date
3/2/2011
Returns
true if frozen, false if else.

Reimplemented in BulletAnimatSim::Environment::Bodies::BlMesh.

Definition at line 413 of file RigidBody.cpp.

References m_bFreeze.

Referenced by Freeze().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::Freeze ( bool  bVal)
virtual

Freezes.

Specifies if the part should frozen in place to the world. If a rigid body is frozen then it is as if it is nailed in place and can not move. Gravity and and other forces will not act on it.

Author
dcofer
Date
3/2/2011
Parameters
bValtrue to freeze.

Definition at line 427 of file RigidBody.cpp.

References Freeze().

+ Here is the call graph for this function:

ContactSensor * AnimatSim::Environment::RigidBody::GetContactSensor ( )
virtual

Gets the receptive field contact sensor.

Author
dcofer
Date
3/2/2011
Returns
Pointer to the receptive field contact sensor object.

Definition at line 313 of file RigidBody.cpp.

References m_lpContactSensor.

float AnimatSim::Environment::RigidBody::GetDensity ( )
virtual

Gets the density of this part.

Author
dcofer
Date
3/2/2011
Returns
The density.

Definition at line 2555 of file RigidBody.cpp.

References AnimatSim::Simulator::DenominatorDistanceUnits(), AnimatSim::Simulator::DisplayMassUnits(), m_fltDensity, m_fltReportDensity, AnimatSim::Environment::BodyPart::m_lpPhysicsBody, and AnimatSim::AnimatBase::m_lpSim.

+ Here is the call graph for this function:

float AnimatSim::Environment::RigidBody::GetMass ( )
virtual

Gets the mass of this part.

Author
dcofer
Date
3/2/2011
Returns
The mass.

Definition at line 2537 of file RigidBody.cpp.

References AnimatSim::Simulator::DisplayMassUnits(), m_fltMass, m_fltReportMass, AnimatSim::Environment::BodyPart::m_lpPhysicsBody, and AnimatSim::AnimatBase::m_lpSim.

+ Here is the call graph for this function:

float AnimatSim::Environment::RigidBody::GetMassValueWithStaticChildren ( )
virtual

Gets the mass of this part and all static children.

Author
David Cofer
Date
10/10/2013
Returns
The mass value of this part with static children.

Definition at line 2575 of file RigidBody.cpp.

References HasStaticChildren(), m_fltMass, and StaticChildrenMass().

+ Here is the call graph for this function:

int AnimatSim::Environment::RigidBody::GetTargetDataTypeIndex ( const std::string &  strDataType)
virtual

Used to convert a string target data type into an integer index.

We do not want to be doing any string comparisons within the main simulation loop. To avoid this we need to convert the target data type into an index to use when AddExternalNodeInput is called so it knows to which input we are adding.

Author
dcofer
Date
6/16/2014
Parameters
strDataTypeString descriptor of the target data we want.
Returns
index. Zero is the default.

Reimplemented from AnimatSim::Node.

Definition at line 1599 of file RigidBody.cpp.

References StdUtils::Std_CheckString().

+ Here is the call graph for this function:

CStdFPoint AnimatSim::Environment::RigidBody::GetVelocityAtPoint ( float  x,
float  y,
float  z 
)
virtual

Gets a velocity of this body at specified point in the body.

Author
dcofer
Date
3/2/2011
Parameters
xThe x coordinate.
yThe y coordinate.
zThe z coordinate.
Returns
The velocity at point.

Definition at line 2519 of file RigidBody.cpp.

References AnimatSim::Environment::BodyPart::m_lpPhysicsBody.

float AnimatSim::Environment::RigidBody::GetVolume ( )
virtual

Gets the volume of this part.

Author
dcofer
Date
3/2/2011
Returns
The volume.

Definition at line 2592 of file RigidBody.cpp.

References AnimatSim::Simulator::DistanceUnits(), m_fltDensity, m_fltReportVolume, AnimatSim::Environment::BodyPart::m_lpPhysicsBody, and AnimatSim::AnimatBase::m_lpSim.

+ Here is the call graph for this function:

bool AnimatSim::Environment::RigidBody::HasStaticChildren ( )
virtual

Query if this rigid body has any static children.

This looks through all of the immediate children of this part to see if they have a static joint. If they do it returns true, if not it returns false. It does not look beyond its immediate children because static parts cannot be nested. They must be placed on a non-static part.

Author
dcofer
Date
9/7/2013
Returns
true if has static children, false if not.

Definition at line 607 of file RigidBody.cpp.

References HasStaticJoint(), and m_aryChildParts.

Referenced by CenterOfMassWithStaticChildren(), and GetMassValueWithStaticChildren().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool AnimatSim::Environment::RigidBody::HasStaticJoint ( )
virtual

Query if this object has a static joint.

Author
dcofer
Date
7/2/2011
Returns
true if has static joint, false if not.

Reimplemented in AnimatSim::Environment::Bodies::Stomach, AnimatSim::Environment::Bodies::Sensor, and AnimatSim::Environment::Bodies::LineBase.

Definition at line 587 of file RigidBody.cpp.

References IsCollisionObject(), IsContactSensor(), IsRoot(), and JointToParent().

Referenced by CenterOfMassWithStaticChildren(), HasStaticChildren(), RemoveRigidBody(), and StaticChildrenMass().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool AnimatSim::Environment::RigidBody::IsCollisionObject ( )
virtual

Query if this object is collision object.

Author
dcofer
Date
3/2/2011
Returns
true if collision object, false if not.

Definition at line 468 of file RigidBody.cpp.

References m_bIsCollisionObject.

Referenced by HasStaticJoint(), and VisualSelectionType().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::IsCollisionObject ( bool  bVal)
virtual

Sets whether this part is a collision object.

Author
dcofer
Date
3/2/2011
Parameters
bValtrue if collision object, false else.

Definition at line 478 of file RigidBody.cpp.

References m_bIsCollisionObject.

bool AnimatSim::Environment::RigidBody::IsContactSensor ( )
virtual

Query if this object is contact sensor.

Author
dcofer
Date
3/2/2011
Returns
true if contact sensor, false if not.

Definition at line 448 of file RigidBody.cpp.

References m_bIsContactSensor.

Referenced by HasStaticJoint().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::IsContactSensor ( bool  bVal)
virtual

Sets whether this is a contact sensor.

Author
dcofer
Date
3/2/2011
Parameters
bValtrue if it is a contact sensor.

Definition at line 458 of file RigidBody.cpp.

References m_bIsContactSensor.

bool AnimatSim::Environment::RigidBody::IsFoodSource ( )
virtual

Query if this object is food source.

Author
dcofer
Date
3/2/2011
Returns
true if food source, false if not.

Definition at line 645 of file RigidBody.cpp.

References m_bFoodSource.

void AnimatSim::Environment::RigidBody::IsFoodSource ( bool  bVal)
virtual

Sets if this is a food source.

Author
dcofer
Date
3/2/2011
Parameters
bValtrue if food source, else false.

Definition at line 655 of file RigidBody.cpp.

References m_bFoodSource, and AnimatSim::AnimatBase::m_lpSim.

bool AnimatSim::Environment::RigidBody::IsRoot ( )
virtual

Query if this is the root rigid body of the structure or not.

Author
dcofer
Date
5/11/2011
Returns
true if root, false if not.

Definition at line 571 of file RigidBody.cpp.

References AnimatSim::Environment::Structure::Body(), and AnimatSim::AnimatBase::m_lpStructure.

Referenced by HasStaticJoint(), LoadPosition(), and Position().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool AnimatSim::Environment::RigidBody::IsStickyPart ( )
virtual

Query if this object acts as a sticky part. This only applies to contact sensors. If it is set to true and StickOn is true then when this part touches something else it will create a locked joint between those two parts. When StickOn goes to false then that joint will be removed. This allows the contact sensor to act as a kind of sticky pick up pad.

Author
dcofer
Date
8/9/2014
Returns
true if sticky object, false if not.

Definition at line 491 of file RigidBody.cpp.

References m_bIsStickyPart.

void AnimatSim::Environment::RigidBody::IsStickyPart ( bool  bVal)
virtual

Sets whether this part is a sticky part or not.

Author
dcofer
Date
8/9/2014
Parameters
bValtrue if sticky object, false else.

Definition at line 501 of file RigidBody.cpp.

References m_bIsStickyPart, AnimatSim::Environment::BodyPart::m_lpPhysicsBody, and StickyOn().

+ Here is the call graph for this function:

Joint * AnimatSim::Environment::RigidBody::JointToParent ( )
virtual

Gets the joint to parent.

Author
dcofer
Date
3/2/2011
Returns
Pointer to joint that connects this part to its parent.

Definition at line 293 of file RigidBody.cpp.

References m_lpJointToParent.

Referenced by HasStaticJoint().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::JointToParent ( Joint lpValue)
virtual

Sets the joint to parent.

Author
dcofer
Date
3/2/2011
Parameters
[in,out]lpValueThe pointer to the joint.

Definition at line 303 of file RigidBody.cpp.

References m_lpJointToParent.

void AnimatSim::Environment::RigidBody::Kill ( bool  bState = true)
virtual

Kills.

Called to kill the organism, nervous system, neurons, and body parts. All neural items are disabled to prevent any further neural activity, and all joints are disabled to allow free rotation, and all biomechancical components are disabled so they can no longer produce forces. This method is only relevant to these types of objects, but I am putting the definition in the base class because a variety of different types of classes all need this method and I want it consolidated. Those classes that do not need it do not have to call it or do anything when it is called.

Author
dcofer
Date
3/3/2011
Parameters
bStatetrue to state.

Reimplemented from AnimatSim::Node.

Definition at line 1461 of file RigidBody.cpp.

References AnimatSim::Node::Kill(), m_aryChildParts, and m_lpJointToParent.

Referenced by AnimatSim::Environment::Organism::Kill().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

CStdFPoint AnimatSim::Environment::RigidBody::LinearDrag ( )
virtual

Gets the linear drag coefficients for the three axises for the body.

Author
dcofer
Date
3/2/2011
Returns
returns m_vLinearDrag.

Definition at line 997 of file RigidBody.cpp.

References m_vLinearDrag.

Referenced by LinearDrag().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::LinearDrag ( CStdFPoint &  oPoint)
virtual

Sets the linear drag coefficients for the three axises for the body.

Author
dcofer
Date
3/2/2011
Parameters
[in,out]oPointThe new point to use to set the drag.

Definition at line 1007 of file RigidBody.cpp.

References AnimatSim::Environment::BodyPart::m_lpPhysicsBody, and m_vLinearDrag.

void AnimatSim::Environment::RigidBody::LinearDrag ( float  fltX,
float  fltY,
float  fltZ 
)
virtual

Sets the linear drag coefficients for the three axises for the body.

Author
dcofer
Date
3/2/2011
Parameters
fltXThe x coordinate.
fltYThe y coordinate.
fltZThe z coordinate.

Definition at line 1025 of file RigidBody.cpp.

References LinearDrag().

+ Here is the call graph for this function:

void AnimatSim::Environment::RigidBody::LinearDrag ( std::string  strXml)
virtual

Sets the linear drag coefficients for the three axises for the body. This method is primarily used by the GUI to reset the local position using an xml data packet.

Author
dcofer
Date
3/2/2011
Parameters
strXmlThe xml string with the data to load in the position.

Definition at line 1040 of file RigidBody.cpp.

References StdUtils::CStdXml::Deserialize(), StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), LinearDrag(), and StdUtils::Std_LoadPoint().

+ Here is the call graph for this function:

float AnimatSim::Environment::RigidBody::LinearVelocityDamping ( )
virtual

Gets the linear velocity damping for this body part.

Author
dcofer
Date
3/2/2011
Returns
Linear velocity damping value.

Definition at line 798 of file RigidBody.cpp.

References m_fltLinearVelocityDamping.

void AnimatSim::Environment::RigidBody::LinearVelocityDamping ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the Linear velocity damping.

Author
dcofer
Date
3/2/2011
Parameters
fltValThe new value.
Exceptions
Valuemust be zero or greater.

Definition at line 809 of file RigidBody.cpp.

References AnimatSim::Simulator::DisplayMassUnits(), m_fltAngularVelocityDamping, m_fltLinearVelocityDamping, AnimatSim::Environment::BodyPart::m_lpPhysicsBody, AnimatSim::AnimatBase::m_lpSim, and StdUtils::Std_InValidRange().

+ Here is the call graph for this function:

Joint * AnimatSim::Environment::RigidBody::LoadJoint ( CStdXml oXml)
protectedvirtual
Odor * AnimatSim::Environment::RigidBody::LoadOdor ( CStdXml oXml)
protectedvirtual

Loads an odor source.

Author
dcofer
Date
3/2/2011
Parameters
[in,out]oXmlThe xml data to use when loading the odor.
Returns
Pointer to the new odor.

Definition at line 2416 of file RigidBody.cpp.

References AddOdor(), AnimatSim::AnimatBase::m_lpSim, AnimatSim::AnimatBase::m_lpStructure, and AnimatSim::AnimatBase::SetSystemPointers().

+ Here is the call graph for this function:

void AnimatSim::Environment::RigidBody::LoadPosition ( CStdXml oXml)
protectedvirtual

Loads the items position.

I have split this off into its own virtual class because some derived classes may need to override this function. For example, RigidBody needs to override it to not set the position if it is the root body.

Author
dcofer
Date
5/14/2011
Parameters
[in,out]oXmlThe xml.

Reimplemented from AnimatSim::Environment::MovableItem.

Definition at line 2120 of file RigidBody.cpp.

References IsRoot(), AnimatSim::AnimatBase::m_lpStructure, AnimatSim::Environment::MovableItem::Position(), AnimatSim::Environment::Structure::Position(), Position(), and StdUtils::Std_LoadPoint().

+ Here is the call graph for this function:

RigidBody * AnimatSim::Environment::RigidBody::LoadRigidBody ( CStdXml oXml)
protectedvirtual

Loads a child rigid body.

Author
dcofer
Date
3/2/2011
Parameters
[in,out]oXmlThe xml data definition of the part to load.
Returns
null if it fails, else the rigid body.

Definition at line 2268 of file RigidBody.cpp.

References AnimatSim::Environment::Structure::AddRigidBody(), AnimatSim::Simulator::CreateObject(), StdUtils::CStdXml::GetChildString(), StdUtils::CStdXml::IntoElem(), m_aryChildParts, AnimatSim::AnimatBase::m_lpSim, AnimatSim::AnimatBase::m_lpStructure, StdUtils::CStdXml::OutOfElem(), and AnimatSim::Environment::MovableItem::Parent().

Referenced by AddRigidBody().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float AnimatSim::Environment::RigidBody::Magnus ( )
virtual

Gets the Magnus coefficient for the body.

Author
dcofer
Date
3/2/2011
Returns
Magnus value.

Definition at line 1181 of file RigidBody.cpp.

References m_fltMagnus.

void AnimatSim::Environment::RigidBody::Magnus ( float  fltVal)
virtual

Sets the Magnus coefficient for the body.

Author
dcofer
Date
3/2/2011
Parameters
fltValThe new Magnus value greater than or equal to 0.
Exceptions
Ifvalue not greater than or equal to 0.

Definition at line 1192 of file RigidBody.cpp.

References m_fltMagnus, AnimatSim::Environment::BodyPart::m_lpPhysicsBody, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

std::string AnimatSim::Environment::RigidBody::MaterialID ( )
virtual

Gets the material ID for this part.

Each rigid body part can be associated with a specific type of material. For example, a material like wood, or concrete. The material specifies things like the frictional resistance between that part and parts of other materials. Each material is defined in the GUI and this is a unique ID string that specifies which one to use for this part.

Author
dcofer
Date
3/2/2011
Returns
.

Definition at line 865 of file RigidBody.cpp.

References m_strMaterialID.

void AnimatSim::Environment::RigidBody::MaterialID ( std::string  strID)
virtual

Sets the Material ID for this part.

Each rigid body part can be associated with a specific type of material. For example, a material like wood, or concrete. The material specifies things like the frictional resistance between that part and parts of other materials. Each material is defined in the GUI and this is a unique ID string that specifies which one to use for this part.

Author
dcofer
Date
3/2/2011
Parameters
strIDID of the material to use.

Definition at line 880 of file RigidBody.cpp.

References AnimatSim::Environment::BodyPart::m_lpPhysicsBody, m_strMaterialID, and StdUtils::Std_ToUpper().

+ Here is the call graph for this function:

float AnimatSim::Environment::RigidBody::MaxFoodQuantity ( )
virtual

Gets the maximum food quantity.

Author
dcofer
Date
3/2/2011
Returns
Food Quantity.

Definition at line 773 of file RigidBody.cpp.

References m_fltMaxFoodQuantity.

void AnimatSim::Environment::RigidBody::MaxFoodQuantity ( float  fltVal)
virtual

Sets the maximum Food quantity.

Author
dcofer
Date
3/2/2011
Parameters
fltValThe new food quantity value.
Exceptions
FoodQuantity must be zero or greater.

Definition at line 784 of file RigidBody.cpp.

References m_fltMaxFoodQuantity, and StdUtils::Std_InValidRange().

+ Here is the call graph for this function:

float AnimatSim::Environment::RigidBody::MaxHydroForce ( )
virtual

Gets the maximum linear hydrodynamic force that can be applied to this part.

Author
dcofer
Date
3/23/2011
Returns
max hydrodyanmic force that can be applied.

Definition at line 1123 of file RigidBody.cpp.

References m_fltMaxHydroForce.

void AnimatSim::Environment::RigidBody::MaxHydroForce ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the maximum linear hydrodynamic force that can be applied to this part.

Author
dcofer
Date
3/23/2011
Parameters
fltValThe new value.
bUseScalingtrue to use unit scaling.

Definition at line 1134 of file RigidBody.cpp.

References AnimatSim::Simulator::InverseDistanceUnits(), AnimatSim::Simulator::InverseMassUnits(), m_fltMaxHydroForce, AnimatSim::AnimatBase::m_lpSim, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

float AnimatSim::Environment::RigidBody::MaxHydroTorque ( )
virtual

Gets the maximum angular hydrodynamic torque that can be applied to this part.

Author
dcofer
Date
3/23/2011
Returns
max hydrodyanmic torque that can be applied.

Definition at line 1152 of file RigidBody.cpp.

References m_fltMaxHydroTorque.

void AnimatSim::Environment::RigidBody::MaxHydroTorque ( float  fltVal,
bool  bUseScaling = true 
)
virtual

Sets the maximum angular hydrodynamic torque that can be applied to this part.

Author
dcofer
Date
3/23/2011
Parameters
fltValThe new value.
bUseScalingtrue to use unit scaling.

Definition at line 1163 of file RigidBody.cpp.

References AnimatSim::Simulator::InverseDistanceUnits(), AnimatSim::Simulator::InverseMassUnits(), m_fltMaxHydroTorque, AnimatSim::AnimatBase::m_lpSim, and StdUtils::Std_IsAboveMin().

+ Here is the call graph for this function:

RigidBody * AnimatSim::Environment::RigidBody::ParentWithCollisionGeometry ( )
virtual

Gets a parent that has collision geometry.

This is used for static joints. We need to add the new collision geometry to a parent part that actually has collision geometry as well.

Author
dcofer
Date
5/20/2012
Returns
null if it fails, else pointer to RigidBody with geometry.

Definition at line 1451 of file RigidBody.cpp.

References AnimatSim::Environment::MovableItem::m_lpParent, and ParentWithCollisionGeometry().

Referenced by ParentWithCollisionGeometry().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

CStdFPoint AnimatSim::Environment::RigidBody::Position ( )
virtual

Gets the local position. (m_oPosition)

Author
dcofer
Date
3/2/2011
Returns
returns m_oPosition.

Reimplemented from AnimatSim::Environment::MovableItem.

Definition at line 131 of file RigidBody.cpp.

References IsRoot(), AnimatSim::AnimatBase::m_lpStructure, AnimatSim::Environment::MovableItem::Position(), and AnimatSim::Environment::Structure::Position().

Referenced by CenterOfMassWithStaticChildren(), VortexAnimatSim::Environment::Bodies::VsBoxTest::CreateParts(), and LoadPosition().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::Position ( CStdFPoint &  oPoint,
bool  bUseScaling = true,
bool  bFireChangeEvent = false,
bool  bUpdateMatrix = true 
)
virtual

For the RigidBody if it is the root then we are going to set the position of the structure.

Reimplemented from AnimatSim::Environment::MovableItem.

Reimplemented in AnimatSim::Environment::Bodies::LineBase, VortexAnimatSim::Environment::Bodies::VsFluidPlane, and BulletAnimatSim::Environment::Bodies::BlFluidPlane.

Definition at line 142 of file RigidBody.cpp.

References IsRoot(), AnimatSim::AnimatBase::m_lpStructure, AnimatSim::Environment::MovableItem::Position(), and AnimatSim::Environment::Structure::Position().

+ Here is the call graph for this function:

void AnimatSim::Environment::RigidBody::RemoveCollisionExclusions ( )
protectedvirtual

Called by the desctructor. It removes this object from all other collision exclusion lists. This prevents any attempt to reference this deleted object while looping through collision exclusions.

Author
David Cofer
Date
1/14/2014

Definition at line 1424 of file RigidBody.cpp.

References FindCollisionExclusionBody(), m_aryExcludeCollisionSet, and AnimatSim::Environment::BodyPart::m_lpPhysicsBody.

Referenced by ~RigidBody().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::RemoveContactSensor ( std::string  strID,
bool  bThrowError = true 
)
protectedvirtual

Removes the ContactSensor.

Author
dcofer
Date
3/2/2011
Parameters
strIDID of the contact senosr to remove
bThrowErrorIf true and ID is not found then it will throw an error.
Exceptions
IfbThrowError is true and ID is not found.

Definition at line 2088 of file RigidBody.cpp.

References m_lpContactSensor, and AnimatSim::Environment::BodyPart::m_lpPhysicsBody.

Referenced by RemoveItem().

+ Here is the caller graph for this function:

bool AnimatSim::Environment::RigidBody::RemoveItem ( const std::string &  strItemType,
const std::string &  strID,
bool  bThrowError = true 
)
virtual

Removes a child item from this parent.

This is a generic method that is used to delete a child object from this parent. The GUI uses this method to remove objects from the simulation that have been deleted in the UI. The item type lets the method determine what type of item is being deleted, like synapse, neuron, body part, etc.. The ID is then used to delete that specific item.

Author
dcofer
Date
2/22/2011
Parameters
strItemTypeString descriptor of the type of item that is being created.
strIDUnique ID of the item that will be removed.
bThrowErrorIf true then throw an error if there is a problem, otherwise return false.
Returns
true if it succeeds, false if it fails.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 1936 of file RigidBody.cpp.

References RemoveContactSensor(), RemoveRigidBody(), and StdUtils::Std_CheckString().

+ Here is the call graph for this function:

void AnimatSim::Environment::RigidBody::RemoveRigidBody ( std::string  strID,
bool  bThrowError = true 
)
protectedvirtual

Removes the rigid body with the specified ID.

Author
dcofer
Date
3/2/2011
Parameters
strIDID of the body to remove
bThrowErrorIf true and ID is not found then it will throw an error.
Exceptions
IfbThrowError is true and ID is not found.

Definition at line 2010 of file RigidBody.cpp.

References FindChildListPos(), HasStaticJoint(), m_aryChildParts, AnimatSim::Environment::BodyPart::m_lpPhysicsBody, AnimatSim::AnimatBase::m_lpSim, AnimatSim::AnimatBase::m_lpStructure, and AnimatSim::Environment::Structure::RemoveRigidBody().

Referenced by RemoveItem().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::RemoveSurfaceContact ( RigidBody lpContactedSurface)
virtual

Decrements the surface contact count when this part stops colliding with something in the virtual world.

If this item is setup to be a contact sensor then when the physics engine detects when a collision between two objects stops, and it will provide this back to us. We then call this method to update the number of contacts that this object is undergoing. This value can then be used to detect whether, and how many, contacts are currently happening.

Author
dcofer
Date
3/2/2011
Parameters
[in,out]lpContactedSurfaceIf non-null, the pointer to a contacted surface.

Definition at line 1280 of file RigidBody.cpp.

References m_fltSurfaceContactCount.

void AnimatSim::Environment::RigidBody::ResetSimulation ( )
virtual

Resets the simulation back to time 0.

This method calls the ResetSimulation method on all subitems in order to reset the simulation back to the beginning.

Author
dcofer
Date
3/1/2011

It is very important that the physcis of the rigid body is reset

before the joint and the child parts. The reason is that we want the position of this part to be rest first and then child parts because if we do not then when we do an UpdateFromNode on the physcis object it will be in the wrong location. We must reset the position from the root out, not leafs in.

Reimplemented from AnimatSim::Environment::BodyPart.

Reimplemented in AnimatSim::Environment::Bodies::LinearHillMuscle, AnimatSim::Environment::Bodies::Spring, AnimatSim::Environment::Bodies::MuscleBase, AnimatSim::Environment::Bodies::LinearHillStretchReceptor, AnimatSim::Environment::Bodies::Stomach, AnimatSim::Environment::Bodies::Mouth, VortexAnimatSim::Environment::Bodies::VsSpring, AnimatSim::Environment::Bodies::OdorSensor, VortexAnimatSim::Environment::Bodies::VsLinearHillMuscle, VortexAnimatSim::Environment::Bodies::VsLinearHillStretchReceptor, BulletAnimatSim::Environment::Bodies::BlLinearHillMuscle, RoboticsAnimatSim::Environment::Bodies::RbLinearHillMuscle, BulletAnimatSim::Environment::Bodies::BlLinearHillStretchReceptor, RoboticsAnimatSim::Environment::Bodies::RbLinearHillStretchReceptor, BulletAnimatSim::Environment::Bodies::BlSpring, and RoboticsAnimatSim::Environment::Bodies::RbSpring.

Definition at line 1473 of file RigidBody.cpp.

References m_aryChildParts, m_fltFoodEaten, m_fltFoodQuantity, m_fltFoodQuantityInit, m_fltSurfaceContactCount, m_lpJointToParent, AnimatSim::Environment::MovableItem::m_lpPhysicsMovableItem, AnimatSim::Environment::BodyPart::ResetSimulation(), AnimatSim::Environment::Joint::ResetSimulation(), and StickyOn().

Referenced by AnimatSim::Environment::Bodies::OdorSensor::ResetSimulation(), AnimatSim::Environment::Bodies::Mouth::ResetSimulation(), AnimatSim::Environment::Bodies::Stomach::ResetSimulation(), AnimatSim::Environment::Bodies::MuscleBase::ResetSimulation(), AnimatSim::Environment::Bodies::Spring::ResetSimulation(), and AnimatSim::Environment::Structure::ResetSimulation().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::SetSurfaceContactCount ( int  iCount)
virtual

Direclty sets the surface contact count for when this part is contacting another rigid body part.

If this item is setup to be a contact sensor then when the physics engine detects when a collision between two objects stops, and it will provide this back to us. We then call this method to update the number of contacts that this object is undergoing. This value can then be used to detect whether, and how many, contacts are currently happening.

Author
dcofer
Date
9/5/2013
Parameters
[in]iCountThe number of surface contacts. Must be 0 or larger.

Definition at line 1300 of file RigidBody.cpp.

References m_fltSurfaceContactCount.

void AnimatSim::Environment::RigidBody::SimPausing ( )
virtual

Called just before the simulation pauses.

This method is called on each AnimatBase object when the simulation pauses. It allows it to perform any intialization prior to the pause of the simulation that is needed.

Author
dcofer
Date
3/1/2011

Reimplemented from AnimatSim::AnimatBase.

Definition at line 1592 of file RigidBody.cpp.

References m_bIsStickyPart, and AnimatSim::Environment::BodyPart::m_lpPhysicsBody.

float AnimatSim::Environment::RigidBody::StaticChildrenMass ( )
virtual

Gets the mass of all static children.

Author
David Cofer
Date
10/10/2013
Returns
combined mass of static children.

Definition at line 626 of file RigidBody.cpp.

References HasStaticJoint(), and m_aryChildParts.

Referenced by GetMassValueWithStaticChildren().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::StepSimulation ( )
virtual

Step the simulation for this object.

This is called on an object each time it is stepped in the simulation. this is where its simulation code is processed. However, StepSimulation is not necessarily called every single time that the simulation as a whole is stepped. A good example of this is that neural modules can have different integration time steps. So a firing rate module may have a DT of 0.5 ms, while an integrate and fire model may have one of 0.1 ms. So the firing rate module would only get its StepSimulation method called every 5th time that the other module was called. This is all handed in the StepSimulation method of the Simulator and NervousSystem.

Author
dcofer
Date
3/1/2011

Reimplemented from AnimatSim::AnimatBase.

Reimplemented in AnimatSim::Environment::Bodies::Stomach, AnimatSim::Environment::Bodies::Mouth, VortexAnimatSim::Environment::Bodies::VsSpring, AnimatSim::Environment::Bodies::OdorSensor, VortexAnimatSim::Environment::Bodies::VsLinearHillMuscle, VortexAnimatSim::Environment::Bodies::VsLinearHillStretchReceptor, BulletAnimatSim::Environment::Bodies::BlLinearHillMuscle, RoboticsAnimatSim::Environment::Bodies::RbLinearHillMuscle, BulletAnimatSim::Environment::Bodies::BlLinearHillStretchReceptor, RoboticsAnimatSim::Environment::Bodies::RbLinearHillStretchReceptor, BulletAnimatSim::Environment::Bodies::BlSpring, and RoboticsAnimatSim::Environment::Bodies::RbSpring.

Definition at line 1630 of file RigidBody.cpp.

References m_aryChildParts, m_bEnableFluids, m_bFoodSource, m_fltFoodEaten, m_fltFoodQuantity, m_fltFoodReplenishRate, m_fltMaxFoodQuantity, m_lEatTime, m_lpJointToParent, AnimatSim::Environment::BodyPart::m_lpPhysicsBody, AnimatSim::AnimatBase::m_lpSim, AnimatSim::Simulator::SimulateHydrodynamics(), AnimatSim::AnimatBase::StepSimulation(), AnimatSim::Environment::Joint::StepSimulation(), AnimatSim::Simulator::TimeSlice(), and AnimatSim::Environment::BodyPart::UpdateData().

Referenced by AnimatSim::Environment::Structure::StepPhysicsEngine(), AnimatSim::Environment::Bodies::OdorSensor::StepSimulation(), and AnimatSim::Environment::Bodies::Mouth::StepSimulation().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

RigidBody * AnimatSim::Environment::RigidBody::StickyChild ( )
virtual

Gets the child body part we are stuck to for a sticky part.

Author
dcofer
Date
8/9/2014
Returns
Pointer to stuck child..

Definition at line 547 of file RigidBody.cpp.

References m_lpStickyChild.

void AnimatSim::Environment::RigidBody::StickyChild ( RigidBody lpChild)
virtual

Sets the child part that we are stuck to if this is a sticky part.

Author
dcofer
Date
8/9/2014
Parameters
pointerto stuck child part.

Definition at line 557 of file RigidBody.cpp.

References m_bIsStickyPart, and m_lpStickyChild.

float AnimatSim::Environment::RigidBody::StickyOn ( )
virtual

Query if this stickyness is turned on or not. This only applies to contact sensors that also have IsStickyPart true.

Author
dcofer
Date
8/9/2014
Returns
true if sticky on, false if not.

Definition at line 520 of file RigidBody.cpp.

References m_fltStickyOn.

Referenced by IsStickyPart(), and ResetSimulation().

+ Here is the caller graph for this function:

void AnimatSim::Environment::RigidBody::StickyOn ( float  fltVal)
virtual

Sets whether this part has sticky on or not.

Author
dcofer
Date
8/9/2014
Parameters
bValtrue if sticky is on, false else.

Definition at line 530 of file RigidBody.cpp.

References m_bIsStickyPart, and m_fltStickyOn.

float AnimatSim::Environment::RigidBody::SurfaceContactCount ( )
virtual

Gets the surface contact count.

Author
dcofer
Date
3/2/2011
Returns
Returns m_fltSurfaceContactCount.

Definition at line 1244 of file RigidBody.cpp.

References m_fltSurfaceContactCount.

void AnimatSim::Environment::RigidBody::UpdatePhysicsPosFromGraphics ( )
virtual

Updates the physics position from graphics.

This updates the position of the physcis node directly from the scenegraph position of the graphics node for this item, and then does the same for all child items.

Author
dcofer
Date
3/26/2011

Reimplemented from AnimatSim::Environment::BodyPart.

Definition at line 2100 of file RigidBody.cpp.

References AnimatSim::Environment::BodyPart::m_lpPhysicsBody.

Referenced by AnimatSim::Environment::Structure::ResetSimulation().

+ Here is the caller graph for this function:

int AnimatSim::Environment::RigidBody::VisualSelectionType ( )
virtual

Gets the visual selection type for this part.

In the GUI the user can select several different types of visual selection modes When a user selects an object while in a given selection mode we need to be able to check each object that is in the path of the click to see if it should be selected. So we check the current selection mode with this VisualSelectionType property to see if they match. So if the current VisualSelectionMode is Joints, and this body part is a joint then it will have a matching VisualSelectionType property and we will no it should be selected, but if a rigid body was selected its VisualSelectionType will be different, so we will not select it.

Author
dcofer
Date
3/2/2011
Returns
.

Reimplemented from AnimatSim::Environment::MovableItem.

Definition at line 150 of file RigidBody.cpp.

References IsCollisionObject().

+ Here is the call graph for this function:

Member Data Documentation

CStdPtrArray<RigidBody> AnimatSim::Environment::RigidBody::m_aryChildParts
protected
bool AnimatSim::Environment::RigidBody::m_bDisplayDebugCollisionGraphic
protected

Determines whether a debug graphics of the rigid body is shown or not. This will show the exact placement of the rigid body in the physics engine.

Definition at line 200 of file RigidBody.h.

Referenced by RigidBody().

bool AnimatSim::Environment::RigidBody::m_bFreeze
protected

Specifies if the part should frozen in place to the world. If a rigid body is frozen then it is as if it is nailed in place and can not move. Gravity and and other forces will not act on it.

Definition at line 76 of file RigidBody.h.

Referenced by Freeze(), AnimatSim::Environment::Bodies::Plane::Plane(), RigidBody(), and AnimatSim::Environment::Bodies::Terrain::Terrain().

bool AnimatSim::Environment::RigidBody::m_bIsContactSensor
protected

This determines whether or not this is a contact sensor. If this is true then this object does not take part in collisions and such, it is a contact sensor only.

Definition at line 111 of file RigidBody.h.

Referenced by IsContactSensor(), and RigidBody().

bool AnimatSim::Environment::RigidBody::m_bIsStickyPart
protected

If a part is a contact sensor then we can also make it be a sticky part. If this is enabled and the m_fltStickyOn is 1 then it will stick to any parts that it comes into contact with. When m_fltStickyOn goes to 0 it will release those parts.

Definition at line 123 of file RigidBody.h.

Referenced by IsStickyPart(), RigidBody(), SimPausing(), StickyChild(), and StickyOn().

bool AnimatSim::Environment::RigidBody::m_bUsesJoint
protected

Some body parts like contact sensors and muscle attachments do not have joints. If not then we should not attempt to load them.

Definition at line 107 of file RigidBody.h.

Referenced by RigidBody(), and AnimatSim::Environment::Bodies::Sensor::Sensor().

float AnimatSim::Environment::RigidBody::m_fltBuoyancyScale
protected

This is a scale used to calculate the buoyancy value. It is a scale factor applied to the buoyancy force which accounts for the fact that a given volume might actually have holes or concavity in it which would affect the buoyancy force on the object.

Definition at line 178 of file RigidBody.h.

Referenced by BuoyancyScale(), and RigidBody().

float AnimatSim::Environment::RigidBody::m_fltSurfaceContactCount
protected

This keeps track of the current number of surface contacts that are occuring for this contact sensor. This is only used for sensors.

Definition at line 118 of file RigidBody.h.

Referenced by AddSurfaceContact(), RemoveSurfaceContact(), ResetSimulation(), RigidBody(), SetSurfaceContactCount(), and SurfaceContactCount().

ContactSensor* AnimatSim::Environment::RigidBody::m_lpContactSensor
protected

The pointer to a receptive field ContactSensor object. This is responsible for processing the receptive field contacts

Definition at line 133 of file RigidBody.h.

Referenced by AddContactSensor(), GetContactSensor(), RemoveContactSensor(), RigidBody(), and ~RigidBody().

Joint* AnimatSim::Environment::RigidBody::m_lpJointToParent
protected

A pointer to the joint that connects this rigid body to its parent. If this is the root object then this pointer is null. However, All child parts must be connected to their parent.

Definition at line 103 of file RigidBody.h.

Referenced by AfterResetSimulation(), RoboticsAnimatSim::Environment::Bodies::RbMesh::CreateJoints(), RoboticsAnimatSim::Environment::Bodies::RbSphere::CreateJoints(), RoboticsAnimatSim::Environment::Bodies::RbCylinder::CreateJoints(), RoboticsAnimatSim::Environment::Bodies::RbCone::CreateJoints(), RoboticsAnimatSim::Environment::Bodies::RbTorus::CreateJoints(), RoboticsAnimatSim::Environment::Bodies::RbEllipsoid::CreateJoints(), BulletAnimatSim::Environment::Bodies::BlSphere::CreateJoints(), VortexAnimatSim::Environment::Bodies::VsMesh::CreateJoints(), RoboticsAnimatSim::Environment::Bodies::RbBox::CreateJoints(), BulletAnimatSim::Environment::Bodies::BlCylinder::CreateJoints(), BulletAnimatSim::Environment::Bodies::BlTorus::CreateJoints(), BulletAnimatSim::Environment::Bodies::BlCone::CreateJoints(), BulletAnimatSim::Environment::Bodies::BlEllipsoid::CreateJoints(), VortexAnimatSim::Environment::Bodies::VsTerrain::CreateJoints(), VortexAnimatSim::Environment::Bodies::VsTorus::CreateJoints(), BulletAnimatSim::Environment::Bodies::BlMesh::CreateJoints(), VortexAnimatSim::Environment::Bodies::VsEllipsoid::CreateJoints(), BulletAnimatSim::Environment::Bodies::BlBox::CreateJoints(), VortexAnimatSim::Environment::Bodies::VsBox::CreateJoints(), VortexAnimatSim::Environment::Bodies::VsCylinder::CreateJoints(), VortexAnimatSim::Environment::Bodies::VsCone::CreateJoints(), VortexAnimatSim::Environment::Bodies::VsSphere::CreateJoints(), BulletAnimatSim::Environment::Bodies::BlTerrain::CreateJoints(), JointToParent(), Kill(), AnimatSim::Environment::Bodies::LineBase::LineBase(), LoadJoint(), ResetSimulation(), RigidBody(), AnimatSim::Environment::Bodies::Sensor::Sensor(), StepSimulation(), and ~RigidBody().

CStdFPoint AnimatSim::Environment::RigidBody::m_vCenterOfMass
protected

The center of mass of this body relative to the center of the object. If this is (0, 0, 0) then the default COM is used.

Definition at line 71 of file RigidBody.h.

Referenced by CenterOfMass(), and CenterOfMassWithStaticChildren().


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