SingleServerPhysicsObjectManager Class Reference
#include <SingleServerPhysicsObjectManager.h>
Inherits PhysicsObjectManager.

Public Member Functions | |
| SingleServerPhysicsObjectManager () | |
| virtual | ~SingleServerPhysicsObjectManager () |
| virtual void | setServerMode (std::string mode) |
| virtual bool | isSimulatingRigidBody (OopsObjectID rigidBodyID) |
| virtual bool | isSimulatingJoint (OopsObjectID jointID) |
Protected Types | |
| enum | SERVERMODE { SERVERMODE_UNDEFINED, SERVERMODE_SERVER, SERVERMODE_DRCLIENT, SERVERMODE_CLIENT } |
Protected Member Functions | |
| virtual void | getLocalSimulatedRigidBodies (std::vector< oops::RigidBody * > &dst) |
| virtual void | getLocalSimulatedJoints (std::vector< oops::Joint * > &dst) |
| virtual void | getRemoteSimulatedRigidBodies (std::vector< oops::RigidBody * > &dst) |
| virtual void | getRemoteSimulatedJoints (std::vector< oops::Joint * > &dst) |
| virtual void | init (Physics *physics) |
| virtual void | step (float dt) |
| virtual NetMessage * | createSynchronisationMessage () |
| virtual void | handleSynchronisationMessage (NetMessage *msg) |
| virtual bool | isServer () |
Protected Attributes | |
| SERVERMODE | serverMode |
| Variable indicating if local User is server. | |
| User * | server |
| User who is physics server. | |
| NetworkInterface * | network |
| Pointer to the Network Module. | |
| OSG::Lock * | messageListLock |
| std::vector< NetMessage * > | messageList |
| List of incoming messages. | |
Detailed Description
PhysicsObjectManager for a simulation where only one machine acts as Physics server.Member Enumeration Documentation
enum SingleServerPhysicsObjectManager::SERVERMODE [protected] |
Constructor & Destructor Documentation
| SingleServerPhysicsObjectManager::SingleServerPhysicsObjectManager | ( | ) |
Constructor initializes lock.
| SingleServerPhysicsObjectManager::~SingleServerPhysicsObjectManager | ( | ) | [virtual] |
Empty Destructor.
Member Function Documentation
| NetMessage * SingleServerPhysicsObjectManager::createSynchronisationMessage | ( | ) | [protected, virtual] |
Creates a SynchronisationMessage for the current PhysicsObjectManager. The method returns a message containing information for the initial synchronisation of the PhysicsObjectManager. It is called from the Physics-Module in the Physics::createSyncEvent method. The returned message is then appended to the PhysicsSynchronisationEvent and sent to the new connected User.
- Returns:
- Synchronisation message for new User.
Implements PhysicsObjectManager.
| void SingleServerPhysicsObjectManager::getLocalSimulatedJoints | ( | std::vector< oops::Joint * > & | dst | ) | [protected, virtual] |
Implements PhysicsObjectManager.
| void SingleServerPhysicsObjectManager::getLocalSimulatedRigidBodies | ( | std::vector< oops::RigidBody * > & | dst | ) | [protected, virtual] |
Implements PhysicsObjectManager.
| void SingleServerPhysicsObjectManager::getRemoteSimulatedJoints | ( | std::vector< oops::Joint * > & | dst | ) | [protected, virtual] |
Implements PhysicsObjectManager.
| void SingleServerPhysicsObjectManager::getRemoteSimulatedRigidBodies | ( | std::vector< oops::RigidBody * > & | dst | ) | [protected, virtual] |
Implements PhysicsObjectManager.
| void SingleServerPhysicsObjectManager::handleSynchronisationMessage | ( | NetMessage * | msg | ) | [protected, virtual] |
Handles a received SynchronisationMessage. The method is called by the Physics-Module when a PhysicsSynchronisationEvent is received. The passed method contains information used to synchronise the current PhysicsObjectManager. The message is encoded by the createSynchronisationMessage method.
- Parameters:
-
msg Synchronisation message for PhysicsObjectManager
Implements PhysicsObjectManager.
| void SingleServerPhysicsObjectManager::init | ( | Physics * | physics | ) | [protected, virtual] |
Initializes the PhysicsObjectManager. The method is called from the Physics Module and initializes the pointer to the Module. This is needed to get access to the oops::Simulation class or to the current simulation time.
- Parameters:
-
physics Pointer to the Physics Module
Reimplemented from PhysicsObjectManager.
| bool SingleServerPhysicsObjectManager::isServer | ( | ) | [protected, virtual] |
Returns if the local machine has to do physics calculations.
Implements PhysicsObjectManager.
| bool SingleServerPhysicsObjectManager::isSimulatingJoint | ( | OopsObjectID | jointID | ) | [virtual] |
Implements PhysicsObjectManager.
| bool SingleServerPhysicsObjectManager::isSimulatingRigidBody | ( | OopsObjectID | rigidBodyID | ) | [virtual] |
Implements PhysicsObjectManager.
| void SingleServerPhysicsObjectManager::setServerMode | ( | std::string | mode | ) | [virtual] |
Sets the server mode. The method is called by the SingleServerPhysicsObjectManagerFactory and defines if the local machine acts as Physics Server or not.
- Parameters:
-
server indicating if local machine is physics server
| void SingleServerPhysicsObjectManager::step | ( | float | dt | ) | [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. Handles a simulation step. The method is called after the handleMessages method and before the Physics::handleSimulationStepListener method. It is used to add PhysicsObjects to the Simulation. The added objects are then already simulated in this step the first time. The method is equal to the one of a SimulationStepListenerInterface but it has to to called before the Physics::handleSimulationStepListener method is executed to allow PhysicsObjects which implement this interface to be notified in the same simulation step the first time.
- Parameters:
-
dt Timestep of the current simulation step
Implements PhysicsObjectManager.
Member Data Documentation
std::vector<NetMessage*> SingleServerPhysicsObjectManager::messageList [protected] |
List of incoming messages.
OSG::Lock* SingleServerPhysicsObjectManager::messageListLock [protected] |
Pointer to the Network Module.
User* SingleServerPhysicsObjectManager::server [protected] |
User who is physics server.
Variable indicating if local User is server.
The documentation for this class was generated from the following files:
- src/inVRs/Modules/3DPhysics/SingleServerPhysicsObjectManager.h
- src/inVRs/Modules/3DPhysics/SingleServerPhysicsObjectManager.cpp
Generated on Wed Oct 20 16:12:00 2010 for inVRs by
1.5.8