SynchronisationModel Class Reference

#include <SynchronisationModel.h>

Inherited by ChangedSynchronisationModel, FullSynchronisationModel, PhysicsFullSynchronisationModel, PhysicsInputSynchronisationModel, and VelocitySynchronisationModel.

Collaboration diagram for SynchronisationModel:

List of all members.


Public Member Functions

 SynchronisationModel ()
virtual ~SynchronisationModel ()

Protected Member Functions

virtual void synchroniseBeforeStep ()=0
virtual void synchroniseAfterStep ()=0
virtual void setPhysicsObjectManager (PhysicsObjectManager *objectManager)
virtual void handleMessages ()
virtual void handleSyncMessage (NetMessage *msg)=0
virtual void handleClientInputMessage (NetMessage *msg)=0
virtual bool needPhysicsCalculation ()
void getLocalSimulatedRigidBodies (PhysicsObjectManager *manager, std::vector< oops::RigidBody * > &dst)
void getRemoteSimulatedRigidBodies (PhysicsObjectManager *manager, std::vector< oops::RigidBody * > &dst)
void getLocalSimulatedJoints (PhysicsObjectManager *manager, std::vector< oops::Joint * > &dst)
void getRemoteSimulatedJoints (PhysicsObjectManager *manager, std::vector< oops::Joint * > &dst)
oops::RigidBodygetRigidBodyById (PhysicsObjectManager *manager, OopsObjectID id)
oops::JointgetJointById (PhysicsObjectManager *manager, OopsObjectID id)
void setSimulationTime (unsigned simulationTime)

Protected Attributes

Physicsphysics
 Pointer to Physics.
PhysicsObjectManagerobjectManager
 Pointer to the used PhysicsObjectManager.
NetworkInterfacenetwork
 Pointer to the Network module.
std::vector< NetMessage * > messageList
 List of incoming messages.

Friends

class Physics

Detailed Description

Class capable of synchronising server data with other servers or clients This class is used to synchronise data from a server to the connected clients and to other servers. The class therefore will be called from the Physics Module before a simulation step takes place and after a simulation step occured. The class can then decide whether to send data to other users or not.

Constructor & Destructor Documentation

SynchronisationModel::SynchronisationModel (  ) 

Constructor zeroes objectManager-pointer.

SynchronisationModel::~SynchronisationModel (  )  [virtual]

Empty destructor.


Member Function Documentation

Joint * SynchronisationModel::getJointById ( PhysicsObjectManager manager,
OopsObjectID  id 
) [protected]

Helper-method to access the method in the PhysicsObjectManager

void SynchronisationModel::getLocalSimulatedJoints ( PhysicsObjectManager manager,
std::vector< oops::Joint * > &  dst 
) [protected]

Helper-method to access the method in the PhysicsObjectManager

void SynchronisationModel::getLocalSimulatedRigidBodies ( PhysicsObjectManager manager,
std::vector< oops::RigidBody * > &  dst 
) [protected]

Helper-method to access the method in the PhysicsObjectManager

void SynchronisationModel::getRemoteSimulatedJoints ( PhysicsObjectManager manager,
std::vector< oops::Joint * > &  dst 
) [protected]

Helper-method to access the method in the PhysicsObjectManager

void SynchronisationModel::getRemoteSimulatedRigidBodies ( PhysicsObjectManager manager,
std::vector< oops::RigidBody * > &  dst 
) [protected]

Helper-method to access the method in the PhysicsObjectManager

RigidBody * SynchronisationModel::getRigidBodyById ( PhysicsObjectManager manager,
OopsObjectID  id 
) [protected]

Helper-method to access the method in the PhysicsObjectManager

virtual void SynchronisationModel::handleClientInputMessage ( NetMessage msg  )  [protected, pure virtual]

void SynchronisationModel::handleMessages (  )  [protected, virtual]

Handles the incoming network messages. The method is called before each simulation step. It should receive all incoming messages from the Network Module and execute them.

virtual void SynchronisationModel::handleSyncMessage ( NetMessage msg  )  [protected, pure virtual]

bool SynchronisationModel::needPhysicsCalculation (  )  [protected, virtual]

DEPRECATED: Helper method for derived SynchronisationModels to access protected methods from PhysicsObjects. DEPRECATED: Helper method for derived SynchronisationModels to access protected methods from PhysicsObjects. DEPRECATED: Helper method for derived SynchronisationModels to access protected methods from PhysicsObjects. DEPRECATED: Helper method for derived SynchronisationModels to access protected methods from PhysicsObjects. DEPRECATED: Helper method for derived SynchronisationModels to access protected methods from PhysicsObjects. DEPRECATED: Helper method for derived SynchronisationModels to access protected methods from PhysicsObjects. Helper method for derived SynchronisationModels to access protected methods from PhysicsObjects. Helper method for derived SynchronisationModels to access protected methods from PhysicsObjects. Stores all connected users in the passes vector. The method copies the vector of connected users from the Physics module to the passed vector.

Parameters:
dst vector where the connected userIds should be stored in Returns the UserData of the user with the passed Id.
userId Id of the user
Returns:
UserData of the user with the passed Id Returns if the current SynchronisationModel needs physics calculations or not.

true if the Physics-engine should do calculations

Reimplemented in PhysicsFullSynchronisationModel, and PhysicsInputSynchronisationModel.

void SynchronisationModel::setPhysicsObjectManager ( PhysicsObjectManager objectManager  )  [protected, virtual]

Stores a pointer to the PhysicsObjectManager. The method is called in the Physics::loadConfig method and stores a local pointer to the used PhysicsObjectManager.

Parameters:
objectManager PhysicsObjectManager from the Physics Module.

void SynchronisationModel::setSimulationTime ( unsigned  simulationTime  )  [protected]

Helper-method to set the simulationTime of the Physics module

virtual void SynchronisationModel::synchroniseAfterStep (  )  [protected, pure virtual]

Synchronises data after a simulation step. The method is called from the Physics Module after a simulation step takes place.

Implemented in ChangedSynchronisationModel, FullSynchronisationModel, PhysicsFullSynchronisationModel, PhysicsInputSynchronisationModel, and VelocitySynchronisationModel.

virtual void SynchronisationModel::synchroniseBeforeStep (  )  [protected, pure virtual]

Synchronises data before a simulation step. The method is called from the Physics Module before a simulation step takes place.

Implemented in AccelerationSynchronisationModel, ChangedSynchronisationModel, FullSynchronisationModel, PhysicsFullSynchronisationModel, PhysicsInputSynchronisationModel, and VelocitySynchronisationModel.


Friends And Related Function Documentation

friend class Physics [friend]


Member Data Documentation

std::vector<NetMessage*> SynchronisationModel::messageList [protected]

List of incoming messages.

Pointer to the Network module.

Pointer to Physics.


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

Generated on Wed Oct 20 16:12:01 2010 for inVRs by doxygen 1.5.8