PhysicsEntity Class Reference

#include <PhysicsEntity.h>

Inherits Entity, and PhysicsObjectInterface.

Inherited by ArticulatedPhysicsEntity, LinkedPhysicsEntity, and SimplePhysicsEntity.

Collaboration diagram for PhysicsEntity:

List of all members.


Public Member Functions

 PhysicsEntity (unsigned short id, unsigned short environmentId, unsigned short instanceId, EntityType *type)
virtual ~PhysicsEntity ()
virtual void setPhysicsTransformationPipe (TransformationPipe *pipe)
virtual TransformationPipegetPhysicsTransformationPipe ()
virtual void setPhysicsObjectManager (PhysicsObjectManager *objectManager)
virtual void getRigidBodies (std::vector< oops::RigidBody * > &rigidBodyList)=0
virtual void getJoints (std::vector< oops::Joint * > &jointList)=0
virtual PhysicsObjectID getPhysicsObjectID ()=0

Protected Member Functions

virtual void setPhysicsTransformation (TransformationData trans)
virtual void setEntityWorldTransformation (TransformationData trans)
virtual void openPhysicsTransformationPipe ()
virtual void closePhysicsTransformationPipe ()
virtual void requestPhysicsTransformationPipe ()
virtual TransformationData getPhysicsTransformation ()

Protected Attributes

bool physicsPipeCreationInitiated
TransformationPipephysicsTransformationPipe
 Pointer to the TransformationPipe of the PhysicsEntity.
PhysicsObjectManagerobjectManager
 Pointer to the PhysicsObjectManager used by the Physics Module.
TransformationData physicsTransformation
 Transformation of the physical representation.

Friends

class CursorSpringConnector
class OopsPhysicsEntityTransformationWriter
class PhysicsEntityTransformationWriterModifier

Detailed Description

Physically simulated Entity. This class represents an Entity which can be simulated by the Physics Module. It therfore inherits from the Entity class and from the PhysicsObjectInterface. The class does not implement the methods inherited from the PhysicsObjectInterface so that different classes of PhysicsEntities can be implemented. The class stores a pointer to the PhysicsObjectManager which is used to distribute client input to the responsible server. It furthermore has a pointer to the TransformationPipe in which the resulting Entity Transformation is written.

Constructor & Destructor Documentation

PhysicsEntity::PhysicsEntity ( unsigned short  id,
unsigned short  environmentId,
unsigned short  instanceId,
EntityType type 
)

Constructor initializes Entity and zeroes Pointers.

Parameters:
id ID of the Entity
environmentId ID of the Environment where the Entity is created
instanceId ID for the instance this Entity is from the EntityType
type EntityType this Entity is an instance of

PhysicsEntity::~PhysicsEntity (  )  [virtual]

Destructor closes TransformationPipe if open.


Member Function Documentation

void PhysicsEntity::closePhysicsTransformationPipe (  )  [protected, virtual]

Closes the current PhysicsTransformationPipe. The method closes the current PhysicsTransformationPipe if there is one opened. It no pipe is opened it prints a warning.

virtual void PhysicsEntity::getJoints ( std::vector< oops::Joint * > &  jointList  )  [pure virtual]

Fills the passed list with all Joints it contains. It is mainly used by the PhysicsObjectManager to add the Joints to the simulation.

Parameters:
jointList List which is filled with contained Joints

Implements PhysicsObjectInterface.

Implemented in ArticulatedPhysicsEntity, LinkedPhysicsEntity, and SimplePhysicsEntity.

virtual PhysicsObjectID PhysicsEntity::getPhysicsObjectID (  )  [pure virtual]

Adds the PhysicsObject to the passed simulation instance.

Parameters:
simulation oops::Simulation class instance
Returns:
true if the object could be added, false otherwise Removes the PhysicsObject from the passed simulation instance.
Parameters:
simulation oops::Simulation class instance
Returns:
true if the object could be removed, false otherwise Returns the ID of the PhysicsObject. The method has to return the unique PhysicsObjectID of the PhysicsObject. The programmer has to ensure that this PhysicsObjectID is set properly and that it is unique.

ID of the PhysicsObject

Implements PhysicsObjectInterface.

Implemented in ArticulatedPhysicsEntity, LinkedPhysicsEntity, and SimplePhysicsEntity.

TransformationData PhysicsEntity::getPhysicsTransformation (  )  [protected, virtual]

Returns the current Transformation set by the Physics simulation.

TransformationPipe * PhysicsEntity::getPhysicsTransformationPipe (  )  [virtual]

Returns the TransformationPipe for Physics Entity. The method returns the TransformationPipe in which the Entity transformation will be written. This TransformationPipe will be used by the EntityTransformationWriter to write the simluation results.

Returns:
TransformationPipe of the Physics Entity

virtual void PhysicsEntity::getRigidBodies ( std::vector< oops::RigidBody * > &  rigidBodyList  )  [pure virtual]

Fills the passed list with all RigidBodies it contains. It is mainly used by the PhysicsObjectManager to add the RigidBodies to the simulation.

Parameters:
rigidBodyList List which is filled with contained RigidBodies

Implements PhysicsObjectInterface.

Implemented in ArticulatedPhysicsEntity, LinkedPhysicsEntity, and SimplePhysicsEntity.

void PhysicsEntity::openPhysicsTransformationPipe (  )  [protected, virtual]

Opens a default PhysicsTransformationPipe. The method opens the default PhysicsTransformationPipe. The default pipe should only consist of one PhysicsEntityTransformationWriterModifier.

void PhysicsEntity::requestPhysicsTransformationPipe (  )  [protected, virtual]

Requests the PhysicsTransformationPipe from the TransformationManager The method tries to get the TransformationPipe from the TransformationManager if already present.

void PhysicsEntity::setEntityWorldTransformation ( TransformationData  trans  )  [protected, virtual]

Sets the Transformation of the Entity. The method is used to update the Enitity-Transformation usually with the Transformation obtained from the physical representation. The method is called by the PhysicsEntityTransformationWriterModifier.

Parameters:
trans new Transformation of the Entity.

void PhysicsEntity::setPhysicsObjectManager ( PhysicsObjectManager objectManager  )  [virtual]

Stores a pointer to the PhysicsObjectManager. The method stores a pointer to the used PhysicsObjectManager. This is needed when a client input should be sent to the physics server. The method has to encode the method call and call the handleClientInput method of the PhysicsObjectManager.

Implements PhysicsObjectInterface.

void PhysicsEntity::setPhysicsTransformation ( TransformationData  trans  )  [protected, virtual]

Stores the Transformation of the physical representation. The method is called by the PhysicsEntityTransformation Writer which is registered at the physical representation of this PhysicsEntity. It stores the passed Transformation locally and passes it to the physicsTransformationPipe.

Parameters:
trans Transformation of the physical representation

void PhysicsEntity::setPhysicsTransformationPipe ( TransformationPipe pipe  )  [virtual]

Sets the TransformationPipe for Physics Entity. The Method sets the TransformationPipe in which the new Entity transformation can be written. This TransformationPipe will be used by the EntityTransformationWriter to write the simulation results.

Parameters:
pipe TransformationPipe where to put the transformation


Friends And Related Function Documentation

friend class CursorSpringConnector [friend]

Handles incoming messages containing remote method calls. The method receives an incoming message containing a remote method call. First it decodes the type of the message. If the type is not a negative number it is not handled by the PhysicsEntity-class itself and therfore the message is passed to the handleMessage(unsigned type,OSG::NetMessage* msg) method which has to be implemented in the derived class. If the method-type is a negative number it is proven which method call is encoded by comparing the type with the REMOTE_FUNCTIONS enumeration member. If a matching function is found it is called.

Parameters:
msg Message containing remote method call.
Returns:
true if the method call could be executed.

Reimplemented in ArticulatedPhysicsEntity, and SimplePhysicsEntity.


Member Data Documentation

Pointer to the PhysicsObjectManager used by the Physics Module.

DEPRECATED: Handles an incoming SynchroniseAllToClient message. DEPRECATED: Handles an incoming SynchroniseAllToDRClient message. DEPRECATED: Handles an incoming SynchroniseAllToServer message. DEPRECATED: Handles an incoming SynchroniseChangesToClient message. DEPRECATED: Handles an incoming SynchroniseChangesToDRClient message. DEPRECATED: Handles an incoming SynchroniseChangesToServer message. DEPRECATED: Handles an incoming SynchroniseObjectTransformation message.

Parameters:
msg incomming message Handles a remote method call. The method receives a message containing an remote method call identified by the parameter type. The datatype unsigned is chosen because negative method types are handled by the PhysicsEntity itself. These are used for the synchroniseXXX methods and the handleSyncXXX methods. When a more data has to be synchronised these methods can be overloaded in derived classes.
function Method type
msg Message containing the method call
Returns:
true if the remote method call could be executed

Transformation of the physical representation.


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

Generated on Wed Oct 20 16:11:59 2010 for inVRs by doxygen 1.5.8