AnimatLab
2
Test
|
Baes class for all items that can be moved/roated within the environment. More...
#include <MovableItem.h>
Public Member Functions | |
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 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 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 CStdColor * | Ambient () |
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 IMovableItemCallback * | Callback () |
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 CStdColor * | Diffuse () |
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 * | GetDataPointer (const std::string &strDataType) |
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 void | Load (CStdXml &oXml) |
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... | |
RigidBody * | Parent () |
Gets the parent RigidBody of this part. More... | |
void | Parent (RigidBody *lpValue) |
Sets the parent RigidBody of this part. More... | |
virtual IPhysicsMovableItem * | PhysicsMovableItem () |
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 CStdFPoint | Position () |
Gets the local position. (m_oPosition) More... | |
virtual void | Position (CStdFPoint &oPoint, bool bUseScaling=true, bool bFireChangeEvent=false, bool bUpdateMatrix=true) |
Sets the local position. (m_oPosition) 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 void | QueryProperties (CStdPtrArray< TypeProperty > &aryProperties) |
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 void | Selected (bool bValue, bool bSelectMultiple) |
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 bool | SetData (const std::string &strDataType, const std::string &strValue, bool bThrowError=true) |
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 CStdColor * | Specular () |
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... | |
virtual void | VisualSelectionModeChanged (int iNewMode) |
Called when the visual selection mode changed in GUI. More... | |
virtual int | VisualSelectionType () |
Gets the visual selection type for this part. More... | |
Protected Member Functions | |
virtual void | LoadPosition (CStdXml &oXml) |
Loads the items position. More... | |
virtual void | LoadRotation (CStdXml &oXml) |
Loads the items rotation. More... | |
Protected Attributes | |
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. | |
IMovableItemCallback * | m_lpCallback |
Simulator * | m_lpMovableSim |
The pointer to a Simulation. | |
RigidBody * | m_lpParent |
IPhysicsMovableItem * | m_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. | |
Baes class for all items that can be moved/roated within the environment.
Definition at line 19 of file MovableItem.h.
AnimatSim::Environment::MovableItem::MovableItem | ( | void | ) |
Default constructor.
Definition at line 46 of file MovableItem.cpp.
References m_bIsSelected, m_bIsVisible, m_fltAlpha, m_fltCollisionsAlpha, m_fltGraphicsAlpha, m_fltJointsAlpha, m_fltReceptiveFieldsAlpha, m_fltShininess, m_fltSimulationAlpha, m_fltUserDefinedDraggerRadius, m_lpCallback, m_lpMovableSim, m_lpParent, m_lpPhysicsMovableItem, m_vAmbient, m_vDiffuse, m_vSpecular, and StdUtils::CStdColor::Set().
|
virtual |
|
virtual |
Gets the absolute position of this body part.
Definition at line 240 of file MovableItem.cpp.
References m_lpPhysicsMovableItem, and m_oAbsPosition.
|
virtual |
Sets the absolute position of this body part. (m_oAbsPosition)
[in,out] | oPoint | The new position. |
Reimplemented in AnimatSim::Environment::Bodies::LineBase.
Definition at line 256 of file MovableItem.cpp.
References AnimatSim::Simulator::DistanceUnits(), m_lpMovableSim, m_oAbsPosition, and m_oReportWorldPosition.
|
virtual |
Sets the absolute position of this body part. (m_oAbsPosition)
fltX | The x coordinate. |
fltY | The y coordinate. |
fltZ | The z coordinate. |
Definition at line 272 of file MovableItem.cpp.
References AnimatSim::Simulator::DistanceUnits(), m_lpMovableSim, m_oAbsPosition, and m_oReportWorldPosition.
|
virtual |
Called when the user clicks on this object while the AddBody mode is active.
When the user selects the AddBody mode in the GUI then the simulation detects when a part is clicked in the simulation window. (This occurs in the VsCameraManipulator class). It gets the position of the click in global coordinates, and the normal vector for the surface that was clicked. We then need to pass this info back up the GUI and let it know the click occurred. This method uses the IMovableItemCallback object to send this info back up to the GUI.
fltPosX | The position x coordinate. |
fltPosY | The position y coordinate. |
fltPosZ | The position z coordinate. |
fltNormX | The normal x coordinate. |
fltNormY | The normal y coordinate. |
fltNormZ | The normal z coordinate. |
Reimplemented in AnimatSim::Environment::BodyPart.
Definition at line 1204 of file MovableItem.cpp.
|
virtual |
Tells if a given part can be manipulated using the mouse and draggers.
Reimplemented in AnimatSim::Environment::Bodies::LineBase.
Definition at line 133 of file MovableItem.cpp.
|
virtual |
Gets whether this body part can be rotated along the x-axis by the user with the drag handlers.
Reimplemented in AnimatSim::Environment::Structure, AnimatSim::Environment::Bodies::Sensor, AnimatSim::Environment::Bodies::FluidPlane, and AnimatSim::Environment::Bodies::Terrain.
Definition at line 1092 of file MovableItem.cpp.
|
virtual |
Gets whether this body part can be rotated along the y-axis by the user with the drag handlers.
Reimplemented in AnimatSim::Environment::Structure, AnimatSim::Environment::Bodies::Sensor, AnimatSim::Environment::Bodies::FluidPlane, and AnimatSim::Environment::Bodies::Terrain.
Definition at line 1102 of file MovableItem.cpp.
|
virtual |
Gets whether this body part can be rotated along the z-axis by the user with the drag handlers.
Reimplemented in AnimatSim::Environment::Structure, AnimatSim::Environment::Bodies::Sensor, AnimatSim::Environment::Bodies::FluidPlane, and AnimatSim::Environment::Bodies::Terrain.
Definition at line 1112 of file MovableItem.cpp.
|
virtual |
Gets whether this body part can be translated along the x-axis by the user with the drag handlers.
Reimplemented in AnimatSim::Environment::Structure.
Definition at line 1061 of file MovableItem.cpp.
|
virtual |
Gets whether this body part can be translated along the y-axis by the user with the drag handlers.
Reimplemented in AnimatSim::Environment::Structure.
Definition at line 1072 of file MovableItem.cpp.
|
virtual |
Gets whether this body part can be translated along the z-axis by the user with the drag handlers.
Reimplemented in AnimatSim::Environment::Structure.
Definition at line 1082 of file MovableItem.cpp.
|
virtual |
Gets the current alpha.
The current alpha is on of the various selection mode alphas like JointsAlpha. This is just the one that is currently selected.
Definition at line 679 of file MovableItem.cpp.
References m_fltAlpha.
|
virtual |
Sets the current alpha.
fltAlpha | The new Alpha value between 0 and 1. |
If | value not between 0 and 1. |
Definition at line 690 of file MovableItem.cpp.
References m_fltAlpha, and StdUtils::Std_InValidRange().
|
virtual |
Gets the ambient color value.
Definition at line 705 of file MovableItem.cpp.
References m_vAmbient.
Referenced by Ambient().
|
virtual |
Sets the Ambient color.
[in,out] | aryColor | The color data. |
Definition at line 729 of file MovableItem.cpp.
References Ambient().
|
virtual |
Loads the Ambient color from an XML data packet.
strXml | The color data in an xml data packet |
Definition at line 744 of file MovableItem.cpp.
References Ambient(), and StdUtils::CStdColor::Load().
|
virtual |
Calculates the local position values for matrix transform for the part to be in a specific world position.
fltWorldX | The world x coordinate we want. |
fltWorldY | The world y coordinate we want. |
fltWorldZ | The world z coordinate we want. |
Definition at line 1241 of file MovableItem.cpp.
References m_lpPhysicsMovableItem.
|
virtual |
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.
Definition at line 969 of file MovableItem.cpp.
References m_lpCallback.
Referenced by AnimatSim::Environment::Structure::Position().
|
virtual |
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.
[in,out] | lpCallback | The pointer to a callback interface object. |
Definition at line 980 of file MovableItem.cpp.
References m_lpCallback.
|
virtual |
Gets the collisions alpha.
Definition at line 560 of file MovableItem.cpp.
References m_fltCollisionsAlpha.
|
virtual |
Sets the collisions alpha.
fltVal | The new CollisionsAlpha value between 0 and 1. |
If | value not between 0 and 1. |
Definition at line 571 of file MovableItem.cpp.
References m_fltCollisionsAlpha, m_lpPhysicsMovableItem, and StdUtils::Std_InValidRange().
|
virtual |
Gets the diffuse color.
Definition at line 759 of file MovableItem.cpp.
References m_vDiffuse.
Referenced by Diffuse().
|
virtual |
Sets the Diffuse color.
[in,out] | aryColor | The color data. |
Definition at line 783 of file MovableItem.cpp.
References Diffuse().
|
virtual |
Loads the Diffuse color from an XML data packet.
strXml | The color data in an xml data packet |
Definition at line 797 of file MovableItem.cpp.
References Diffuse(), and StdUtils::CStdColor::Load().
|
virtual |
Gets the bounding box for this part.
Definition at line 1030 of file MovableItem.cpp.
References m_lpPhysicsMovableItem.
Referenced by AnimatSim::Environment::Bodies::Mesh::SetBoundingBox().
|
virtual |
Gets the bounding radius of this part.
Definition at line 1014 of file MovableItem.cpp.
References m_lpPhysicsMovableItem.
|
virtual |
Gets the current position of this part.
Definition at line 286 of file MovableItem.cpp.
References m_oAbsPosition.
Referenced by AnimatSim::Environment::Bodies::LineBase::CalculateLength(), AnimatSim::Environment::Odor::CalculateOdorValue(), and AnimatSim::Environment::Bodies::Mouth::StepSimulation().
|
virtual |
Gets the graphics alpha.
Definition at line 531 of file MovableItem.cpp.
References m_fltGraphicsAlpha.
|
virtual |
Sets the graphics alpha.
fltVal | The new GraphicsAlpha value between 0 and 1. |
If | value not between 0 and 1. |
Definition at line 542 of file MovableItem.cpp.
References m_fltGraphicsAlpha, m_lpPhysicsMovableItem, and StdUtils::Std_InValidRange().
|
virtual |
Query if this object is selected.
Definition at line 1152 of file MovableItem.cpp.
References m_bIsSelected.
|
virtual |
Query if this object is visible.
Definition at line 504 of file MovableItem.cpp.
References m_bIsVisible.
|
virtual |
Sets whether this part is visible or not.
bVal | true to make visible, false to make invisible. |
Definition at line 514 of file MovableItem.cpp.
References m_bIsVisible, and m_lpPhysicsMovableItem.
|
virtual |
Gets the joints alpha.
Definition at line 589 of file MovableItem.cpp.
References m_fltJointsAlpha.
|
virtual |
Sets the joints alpha.
fltVal | The new JointsAlpha value between 0 and 1. |
If | value not between 0 and 1. |
Definition at line 600 of file MovableItem.cpp.
References m_fltJointsAlpha, m_lpPhysicsMovableItem, and StdUtils::Std_InValidRange().
|
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.
[in,out] | oXml | The xml. |
Reimplemented in AnimatSim::Environment::RigidBody.
Definition at line 1580 of file MovableItem.cpp.
References Position(), and StdUtils::Std_LoadPoint().
|
protectedvirtual |
Loads the items rotation.
I have split this off into its own virtual function to make it consistent with the LoadPosition method.
[in,out] | oXml | The xml. |
Definition at line 1598 of file MovableItem.cpp.
References Rotation(), and StdUtils::Std_LoadPoint().
|
virtual |
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.
Definition at line 488 of file MovableItem.cpp.
References m_lpPhysicsMovableItem.
|
virtual |
Orients a new part based on where the parent was clicked and the normal of the surface face.
fltXPos | The click x position. |
fltYPos | The click y position. |
fltZPos | The click z position. |
fltXNorm | The face normal x coordinate. |
fltYNorm | Th face normale y coordinat. |
fltZNorm | The face normal z coordinate. |
Reimplemented in AnimatSim::Environment::Bodies::LineBase.
Definition at line 1223 of file MovableItem.cpp.
References m_lpPhysicsMovableItem.
RigidBody * AnimatSim::Environment::MovableItem::Parent | ( | ) |
Gets the parent RigidBody of this part.
Definition at line 90 of file MovableItem.cpp.
References m_lpParent.
Referenced by AnimatSim::Environment::RigidBody::LoadJoint(), AnimatSim::Environment::RigidBody::LoadRigidBody(), and AnimatSim::Environment::Structure::LoadRoot().
void AnimatSim::Environment::MovableItem::Parent | ( | RigidBody * | lpValue | ) |
Sets the parent RigidBody of this part.
[in,out] | lpValue | The pointer to the parent RigidBody. |
Definition at line 100 of file MovableItem.cpp.
References m_lpParent, and m_lpPhysicsMovableItem.
|
virtual |
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..
Definition at line 992 of file MovableItem.cpp.
References m_lpPhysicsMovableItem.
Referenced by AnimatSim::Environment::Structure::Position().
|
virtual |
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..
[in,out] | lpBody | The pointer to the phsyics body interface. |
Definition at line 1004 of file MovableItem.cpp.
References m_lpPhysicsMovableItem.
|
virtual |
Gets the local position. (m_oPosition)
Reimplemented in AnimatSim::Environment::RigidBody, and AnimatSim::Environment::Structure.
Definition at line 143 of file MovableItem.cpp.
References m_oPosition.
Referenced by LoadPosition(), AnimatSim::Environment::RigidBody::LoadPosition(), Position(), AnimatSim::Environment::Structure::Position(), and AnimatSim::Environment::RigidBody::Position().
|
virtual |
Sets the local position. (m_oPosition)
[in,out] | oPoint | The new point to use to set the local position. |
bUseScaling | If true then the position values that are passed in will be scaled by the unit scaling values. | |
bFireChangeEvent | If true then this will call the IMovableItemCallback->PositionChanged callback method to inform the GUI that the part has moved. If false then this callback will be skipped. | |
bUpdateMatrix | If true then the IPhysicsMovableItem->Physics_UpdateMatrix method will be called so that the osg graphics will be updated. If false then this will be skipped. |
Reimplemented in AnimatSim::Environment::RigidBody, AnimatSim::Environment::Structure, AnimatSim::Environment::Bodies::LineBase, VortexAnimatSim::Environment::VsLight, OsgAnimatSim::Environment::OsgLight, VortexAnimatSim::Environment::Bodies::VsFluidPlane, and BulletAnimatSim::Environment::Bodies::BlFluidPlane.
Definition at line 161 of file MovableItem.cpp.
References AnimatSim::Simulator::DistanceUnits(), AnimatSim::Simulator::InverseDistanceUnits(), m_lpCallback, m_lpMovableSim, m_lpPhysicsMovableItem, m_oPosition, m_oReportPosition, and AnimatSim::IMovableItemCallback::PositionChanged().
|
virtual |
Sets the local position. (m_oPosition)
fltX | The x coordinate. |
fltY | The y coordinate. |
fltZ | The z coordinate. |
bUseScaling | If true then the position values that are passed in will be scaled by the unit scaling values. |
bFireChangeEvent | If true then this will call the IMovableItemCallback->PositionChanged callback method to inform the GUI that the part has moved. If false then this callback will be skipped. |
bUpdateMatrix | If true then the IPhysicsMovableItem->Physics_UpdateMatrix method will be called so that the osg graphics will be updated. If false then this will be skipped. |
Definition at line 197 of file MovableItem.cpp.
References Position().
|
virtual |
Sets the local position. (m_oPosition). This method is primarily used by the GUI to reset the local position using an xml data packet.
strXml | The xml string with the data to load in the position. |
bUseScaling | If true then the position values that are passed in will be scaled by the unit scaling values. |
bFireChangeEvent | If true then this will call the IMovableItemCallback->PositionChanged callback method to inform the GUI that the part has moved. If false then this callback will be skipped. |
bUpdateMatrix | If true then the IPhysicsMovableItem->Physics_UpdateMatrix method will be called so that the osg graphics will be updated. If false then this will be skipped. |
Definition at line 220 of file MovableItem.cpp.
References StdUtils::CStdXml::Deserialize(), StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), Position(), and StdUtils::Std_LoadPoint().
|
virtual |
Gets the receptive fields alpha.
Definition at line 618 of file MovableItem.cpp.
References m_fltReceptiveFieldsAlpha.
|
virtual |
Sets the receptive fields alpha.
fltVal | The new ReceptiveFieldsAlpha value between 0 and 1. |
If | value not between 0 and 1. |
Definition at line 629 of file MovableItem.cpp.
References m_fltReceptiveFieldsAlpha, m_lpPhysicsMovableItem, and StdUtils::Std_InValidRange().
|
virtual |
Gets the reported local position. (m_oReportPosition).
Definition at line 306 of file MovableItem.cpp.
References m_oReportPosition.
|
virtual |
Sets the reported local position. (m_oReportPosition).
[in,out] | oPoint | The new position. |
Definition at line 316 of file MovableItem.cpp.
References m_oReportPosition.
|
virtual |
Sets the reported local position. (m_oReportPosition).
fltX | The coordinate. |
fltY | The y coordinate. |
fltZ | The z coordinate. |
Definition at line 328 of file MovableItem.cpp.
References m_oReportPosition.
|
virtual |
Gets the reported rotation of this part. (m_oReportRotation)
Definition at line 455 of file MovableItem.cpp.
References m_oReportRotation.
|
virtual |
Sets the reported rotation of this part. (m_oReportRotation)
[in,out] | oPoint | The new reported rotation. |
Definition at line 465 of file MovableItem.cpp.
References m_oReportRotation.
|
virtual |
Sets the reported rotation of this part. (m_oReportRotation)
fltX | The x coordinate. |
fltY | The y coordinate. |
fltZ | The z coordinate. |
Definition at line 477 of file MovableItem.cpp.
References m_oReportRotation.
|
virtual |
Gets the reported world position. (m_oReportWorldPosition)
Definition at line 338 of file MovableItem.cpp.
References m_oReportWorldPosition.
|
virtual |
Sets the reported world position (m_oReportWorldPosition)
[in,out] | oPoint | The new position. |
Definition at line 348 of file MovableItem.cpp.
References m_oReportWorldPosition.
|
virtual |
Sets the reported world position (m_oReportWorldPosition)
fltX | The x coordinate. |
fltY | The y coordinate. |
fltZ | The z coordinate. |
Definition at line 360 of file MovableItem.cpp.
References m_oReportWorldPosition.
|
virtual |
Gets the rotation of this body in radians.
Definition at line 370 of file MovableItem.cpp.
References m_oRotation.
Referenced by LoadRotation(), and Rotation().
|
virtual |
Sets the rotation of this body in radians. (m_oRotation)
[in,out] | oPoint | The new rotation values. |
bFireChangeEvent | If true then this will call the IMovableItemCallback->RotationChanged callback method to inform the GUI that the part has moved. If false then this callback will be skipped. | |
bUpdateMatrix | If true then the IPhysicsMovableItem->Physics_UpdateMatrix method will be called so that the osg graphics will be updated. If false then this will be skipped. |
Definition at line 386 of file MovableItem.cpp.
References m_lpCallback, m_lpPhysicsMovableItem, m_oReportRotation, m_oRotation, and AnimatSim::IMovableItemCallback::RotationChanged().
|
virtual |
Sets the rotation of this body in radians. (m_oRotation)
fltX | The x coordinate. |
fltY | The y coordinate. |
fltZ | The z coordinate. |
bFireChangeEvent | If true then this will call the IMovableItemCallback->RotationChanged callback method to inform the GUI that the part has moved. If false then this callback will be skipped. |
bUpdateMatrix | If true then the IPhysicsMovableItem->Physics_UpdateMatrix method will be called so that the osg graphics will be updated. If false then this will be skipped. |
Definition at line 414 of file MovableItem.cpp.
References Rotation().
|
virtual |
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.
strXml | The xml std::string used to load the rotation. |
bFireChangeEvent | If true then this will call the IMovableItemCallback->RotationChanged callback method to inform the GUI that the part has moved. If false then this callback will be skipped. |
bUpdateMatrix | If true then the IPhysicsMovableItem->Physics_UpdateMatrix method will be called so that the osg graphics will be updated. If false then this will be skipped. |
Definition at line 435 of file MovableItem.cpp.
References StdUtils::CStdXml::Deserialize(), StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), Rotation(), and StdUtils::Std_LoadPoint().
|
virtual |
Gets the relative position of the selected vertex. (m_vSelectedVertex)
Definition at line 915 of file MovableItem.cpp.
References m_vSelectedVertex.
Referenced by SelectedVertex().
|
virtual |
Sets the relative position of the selected vertex. (m_vSelectedVertex)
[in,out] | vPoint | The new point to use to set the local position. |
bFireChangeEvent | If true then this will call the IMovableItemCallback->SelectedVertexChanged callback method to inform the GUI that the selected vertex has changed. If false then this callback will be skipped. | |
bUpdatePhysics | If true then the physcis object is also updated. |
Definition at line 929 of file MovableItem.cpp.
References m_lpCallback, m_lpPhysicsMovableItem, m_vSelectedVertex, and AnimatSim::IMovableItemCallback::SelectedVertexChanged().
|
virtual |
Sets the relative position of the selected vertex. (m_vSelectedVertex)
fltX | The x coordinate. |
fltY | The y coordinate. |
fltZ | The z coordinate. |
bFireChangeEvent | If true then this will call the IMovableItemCallback->SelectedVertexChanged callback method to inform the GUI that the selected vertex has changed. If false then this callback will be skipped. |
bUpdatePhysics | If true then the physcis object is also updated. |
Definition at line 954 of file MovableItem.cpp.
References SelectedVertex().
|
virtual |
Sets one dimension of the bounding box. This does nothing for all parts except a mesh.
Reimplemented in AnimatSim::Environment::Bodies::Mesh.
Definition at line 1048 of file MovableItem.cpp.
|
virtual |
Gets the shininess.
Definition at line 866 of file MovableItem.cpp.
References m_fltShininess.
|
virtual |
Sets the shininess value.
fltVal | The new value. |
Definition at line 876 of file MovableItem.cpp.
References m_fltShininess, m_lpPhysicsMovableItem, and StdUtils::Std_InValidRange().
|
virtual |
Gets the simulation alpha.
Definition at line 647 of file MovableItem.cpp.
References m_fltSimulationAlpha.
|
virtual |
Sets the simulation alpha.
fltVal | The new SimulationAlpha value between 0 and 1. |
If | value not between 0 and 1. |
Definition at line 658 of file MovableItem.cpp.
References m_fltSimulationAlpha, m_lpPhysicsMovableItem, and StdUtils::Std_InValidRange().
|
virtual |
Gets the specular color.
Definition at line 812 of file MovableItem.cpp.
References m_vSpecular.
Referenced by Specular().
|
virtual |
Sets the Specular color.
[in,out] | aryColor | The color data. |
Definition at line 836 of file MovableItem.cpp.
References Specular().
|
virtual |
Loads the Specular color from an XML data packet.
strXml | The color data in an xml data packet |
Definition at line 850 of file MovableItem.cpp.
References StdUtils::CStdColor::Load(), and Specular().
|
virtual |
Gets the texture filename.
Definition at line 891 of file MovableItem.cpp.
References m_strTexture.
|
virtual |
Sets the Texture filename.
strValue | The texture filename. |
Definition at line 901 of file MovableItem.cpp.
References m_lpPhysicsMovableItem, and m_strTexture.
|
virtual |
User defined dragger radius.
fltRadius | Sets the user defined drag radius. |
Definition at line 1122 of file MovableItem.cpp.
References m_fltUserDefinedDraggerRadius, and m_lpPhysicsMovableItem.
|
virtual |
Gets the user defined dragger radius.
Definition at line 1141 of file MovableItem.cpp.
References m_fltUserDefinedDraggerRadius.
|
virtual |
Called when the visual selection mode changed in GUI.
In the GUI the user can select several different types of visual selection modes This method is called any time that the user switches the selection mode in the GUI. This allows us to change the current Alpha value of the objects so the display is correct.
iNewMode | The new VisualSelectionMode. |
Reimplemented in AnimatSim::Environment::Light, and AnimatSim::Environment::BodyPart.
Definition at line 1180 of file MovableItem.cpp.
References m_lpPhysicsMovableItem.
Referenced by AnimatSim::Environment::BodyPart::VisualSelectionModeChanged(), and AnimatSim::Environment::Light::VisualSelectionModeChanged().
|
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.
Reimplemented in AnimatSim::Environment::RigidBody, and AnimatSim::Environment::Joint.
Definition at line 123 of file MovableItem.cpp.
|
protected |
Determines if this body is physically seen or not. If this is false then whatever geometry this is, like a box, is not seen in the graphics.
Definition at line 54 of file MovableItem.h.
Referenced by IsVisible(), and MovableItem().
|
protected |
This is an interface pointer to a callback class that allows us to notify the gui of events that occur within the simulation.
Definition at line 98 of file MovableItem.h.
Referenced by AnimatSim::Environment::BodyPart::AddBodyClicked(), Callback(), MovableItem(), Position(), AnimatSim::Environment::BodyPart::Resize(), Rotation(), and SelectedVertex().
|
protected |
The parent rigid body of this part. If this value is null then it is assumed that this is the root part of a structure or the structure itself.
Definition at line 27 of file MovableItem.h.
Referenced by AnimatSim::Environment::RigidBody::LoadJoint(), MovableItem(), Parent(), AnimatSim::Environment::RigidBody::ParentWithCollisionGeometry(), AnimatSim::Environment::RigidBody::RigidBody(), AnimatSim::Environment::Joint::~Joint(), and AnimatSim::Environment::RigidBody::~RigidBody().
|
protected |
This is an interface references 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..
Definition at line 103 of file MovableItem.h.
Referenced by AbsolutePosition(), AnimatSim::Environment::Joint::AfterResetSimulation(), CalculateLocalPosForWorldPos(), AnimatSim::Environment::Joint::Child(), CollisionsAlpha(), GetBoundingBox(), GetBoundingRadius(), GraphicsAlpha(), IsVisible(), JointsAlpha(), LocalTransformationMatrixString(), MovableItem(), OrientNewPart(), Parent(), PhysicsMovableItem(), Position(), ReceptiveFieldsAlpha(), AnimatSim::Environment::Joint::ResetSimulation(), AnimatSim::Environment::Structure::ResetSimulation(), AnimatSim::Environment::RigidBody::ResetSimulation(), AnimatSim::Environment::Light::Resize(), AnimatSim::Environment::BodyPart::Resize(), Rotation(), AnimatSim::Environment::Bodies::Mesh::Scale(), SelectedVertex(), Shininess(), SimulationAlpha(), AnimatSim::Environment::Structure::Structure(), Texture(), AnimatSim::Environment::Light::UpdateData(), AnimatSim::Environment::BodyPart::UpdateData(), AnimatSim::Environment::Structure::UpdateData(), AnimatSim::Environment::BodyPart::UpdateExtraData(), UserDefinedDraggerRadius(), and VisualSelectionModeChanged().
|
protected |
The absolute position of the movable item in world coordinates. This is calcualted during loading of the part using the position of the parent part and the relative position specified in the configuration file.
Definition at line 32 of file MovableItem.h.
Referenced by AbsolutePosition(), AnimatSim::Environment::Bodies::Plane::CornerX(), AnimatSim::Environment::Bodies::Plane::CornerY(), GetCurrentPosition(), and AnimatSim::Environment::Bodies::OdorSensor::StepSimulation().
|
protected |
This is used for reporting the rotation back to the GUI. We need to keep the regular rotation information so it can be used during a simulation reset.
Definition at line 50 of file MovableItem.h.
Referenced by ReportRotation(), and Rotation().
|
protected |
The rotation to apply to this body part. It is defined by the three euler angles in radians.
Definition at line 46 of file MovableItem.h.
Referenced by Rotation().