Sirikata
Public Types | Public Member Functions | Protected Types | Protected Attributes | Private Member Functions | Private Attributes
Sirikata::BulletPhysicsService Class Reference

Standard location service, which functions entirely based on location updates from objects and other spaces servers. More...

#include <BulletPhysicsService.hpp>

Inheritance diagram for Sirikata::BulletPhysicsService:
Collaboration diagram for Sirikata::BulletPhysicsService:

List of all members.

Public Types

typedef std::tr1::function
< void(MeshdataPtr)> 
MeshdataParsedCallback

Public Member Functions

 BulletPhysicsService (SpaceContext *ctx, LocationUpdatePolicy *update_policy)
virtual ~BulletPhysicsService ()
virtual bool contains (const UUID &uuid) const
 Indicates whether this location service is tracking the given object.
bool isLocal (const UUID &uuid) const
bool isReplica (const UUID &uuid) const
virtual void service ()
virtual uint64 epoch (const UUID &uuid)
 Methods dealing with information requests.
virtual TimedMotionVector3f location (const UUID &uuid)
virtual Vector3f currentPosition (const UUID &uuid)
virtual TimedMotionQuaternion orientation (const UUID &uuid)
virtual Quaternion currentOrientation (const UUID &uuid)
virtual AggregateBoundingInfo bounds (const UUID &uuid)
virtual const String & mesh (const UUID &uuid)
virtual const String & physics (const UUID &uuid)
bool isFixed (const UUID &uuid)
bool directMotionRequestsEnabled (const UUID &uuid)
void setLocation (const UUID &uuid, const TimedMotionVector3f &newloc)
void setOrientation (const UUID &uuid, const TimedMotionQuaternion &neworient)
virtual void addLocalObject (const UUID &uuid, const TimedMotionVector3f &loc, const TimedMotionQuaternion &orient, const AggregateBoundingInfo &bounds, const String &mesh, const String &physics, const String &zernike)
 Methods dealing with local objects.
virtual void removeLocalObject (const UUID &uuid)
virtual void addLocalAggregateObject (const UUID &uuid, const TimedMotionVector3f &loc, const TimedMotionQuaternion &orient, const AggregateBoundingInfo &bounds, const String &mesh, const String &physics)
 Aggregate objects are handled separately from other local objects.
virtual void removeLocalAggregateObject (const UUID &uuid)
virtual void updateLocalAggregateLocation (const UUID &uuid, const TimedMotionVector3f &newval)
virtual void updateLocalAggregateOrientation (const UUID &uuid, const TimedMotionQuaternion &newval)
virtual void updateLocalAggregateBounds (const UUID &uuid, const AggregateBoundingInfo &newval)
virtual void updateLocalAggregateMesh (const UUID &uuid, const String &newval)
virtual void updateLocalAggregatePhysics (const UUID &uuid, const String &newval)
virtual void addReplicaObject (const Time &t, const UUID &uuid, bool agg, const TimedMotionVector3f &loc, const TimedMotionQuaternion &orient, const AggregateBoundingInfo &bounds, const String &mesh, const String &physics, const String &zernike)
 Methods dealing with replica objects.
virtual void removeReplicaObject (const Time &t, const UUID &uuid)
virtual void receiveMessage (Message *msg)
 MessageRecipient Interface.
virtual bool locationUpdate (UUID source, void *buffer, uint32 length)
virtual void commandProperties (const Command::Command &cmd, Command::Commander *cmdr, Command::CommandID cmdid)
 Get basic properties about this location service, e.g.
virtual void commandObjectProperties (const Command::Command &cmd, Command::Commander *cmdr, Command::CommandID cmdid)
 Get all the properties stored about an object.
void getMesh (const Transfer::URI meshURI, const UUID uuid, MeshdataParsedCallback cb)
void getMeshCallback (Transfer::ResourceDownloadTaskPtr taskptr, Transfer::TransferRequestPtr request, Transfer::DenseDataPtr response, MeshdataParsedCallback cb)
LocationInfoinfo (const UUID &uuid)
const LocationInfoinfo (const UUID &uuid) const
btDiscreteDynamicsWorld * dynamicsWorld ()
btBroadphaseInterface * broadphase ()
void addTickObject (const UUID &uuid)
void removeTickObject (const UUID &uuid)
void addInternalTickObject (const UUID &uuid)
void removeInternalTickObject (const UUID &uuid)
void addDeactivateableObject (const UUID &uuid)
void removeDeactivateableObject (const UUID &uuid)
void addUpdate (const UUID &uuid)
void updateObjectFromDeactivation (const UUID &uuid)
void internalTickCallback ()

Protected Types

typedef
std::tr1::unordered_map< UUID,
LocationInfo, UUID::Hasher
LocationMap
typedef
std::tr1::unordered_set< UUID,
UUID::Hasher
UUIDSet
typedef
std::tr1::unordered_map< UUID,
Transfer::ResourceDownloadTaskPtr,
UUID::Hasher
MeshDownloadMap

Protected Attributes

LocationMap mLocations
UUIDSet mTickObjects
UUIDSet mInternalTickObjects
UUIDSet mDeactivateableObjects
UUIDSet physicsUpdates
uint32 mUpdateIteration
MeshDownloadMap mMeshDownloads

Private Member Functions

void updatePhysicsWorld (const UUID &uuid)
void updatePhysicsWorldWithMesh (const UUID &uuid, MeshdataPtr retrievedMesh)
void cleanupLocationInfo (LocationInfo &locinfo)

Private Attributes

btBroadphaseInterface * mBroadphase
btDefaultCollisionConfiguration * collisionConfiguration
btCollisionDispatcher * dispatcher
btSequentialImpulseConstraintSolver * solver
btDiscreteDynamicsWorld * mDynamicsWorld
Time mLastTime
Time mLastDeactivationTime
ModelsSystemmModelsSystem
Mesh::FiltermModelFilter
Transfer::TransferMediatormTransferMediator
Transfer::TransferPoolPtr mTransferPool
Network::IOStrandmParsingStrand

Detailed Description

Standard location service, which functions entirely based on location updates from objects and other spaces servers.


Member Typedef Documentation

typedef std::tr1::unordered_map<UUID, LocationInfo, UUID::Hasher> Sirikata::BulletPhysicsService::LocationMap [protected]
typedef std::tr1::unordered_set<UUID, UUID::Hasher> Sirikata::BulletPhysicsService::UUIDSet [protected]

Constructor & Destructor Documentation

Sirikata::BulletPhysicsService::BulletPhysicsService ( SpaceContext ctx,
LocationUpdatePolicy update_policy 
)
Sirikata::BulletPhysicsService::~BulletPhysicsService ( ) [virtual]

Member Function Documentation

void Sirikata::BulletPhysicsService::addDeactivateableObject ( const UUID uuid)
void Sirikata::BulletPhysicsService::addInternalTickObject ( const UUID uuid)
void Sirikata::BulletPhysicsService::addLocalAggregateObject ( const UUID uuid,
const TimedMotionVector3f loc,
const TimedMotionQuaternion orient,
const AggregateBoundingInfo bounds,
const String &  mesh,
const String &  physics 
) [virtual]

Aggregate objects are handled separately from other local objects.

All the information is tracked, but listeners are notified about them separately. This is necessary since not filtering them would cause them to filter back into whatever system generated them. In general, users other than Proximity should learn about aggregates and treat them as normal objects. Proximity ignores them since it is the one that generates them.

Implements Sirikata::LocationService.

References Sirikata::LocationInfo::aggregate, bounds(), Sirikata::LocationInfo::local, location(), mesh(), mLocations, Sirikata::LocationService::notifyLocalObjectAdded(), orientation(), physics(), Sirikata::LocationInfo::props, Sirikata::SequencedPresenceProperties::setBounds(), Sirikata::SequencedPresenceProperties::setLocation(), Sirikata::SequencedPresenceProperties::setMesh(), Sirikata::SequencedPresenceProperties::setOrientation(), Sirikata::SequencedPresenceProperties::setPhysics(), and updatePhysicsWorld().

void Sirikata::BulletPhysicsService::addLocalObject ( const UUID uuid,
const TimedMotionVector3f loc,
const TimedMotionQuaternion orient,
const AggregateBoundingInfo bounds,
const String &  mesh,
const String &  physics,
const String &  zernike 
) [virtual]
void Sirikata::BulletPhysicsService::addReplicaObject ( const Time t,
const UUID uuid,
bool  agg,
const TimedMotionVector3f loc,
const TimedMotionQuaternion orient,
const AggregateBoundingInfo bounds,
const String &  mesh,
const String &  physics,
const String &  zernike 
) [virtual]
void Sirikata::BulletPhysicsService::addTickObject ( const UUID uuid)
void Sirikata::BulletPhysicsService::addUpdate ( const UUID uuid)
AggregateBoundingInfo Sirikata::BulletPhysicsService::bounds ( const UUID uuid) [virtual]
btBroadphaseInterface* Sirikata::BulletPhysicsService::broadphase ( ) [inline]
void Sirikata::BulletPhysicsService::cleanupLocationInfo ( LocationInfo locinfo) [private]
void Sirikata::BulletPhysicsService::commandObjectProperties ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [virtual]
void Sirikata::BulletPhysicsService::commandProperties ( const Command::Command cmd,
Command::Commander cmdr,
Command::CommandID  cmdid 
) [virtual]

Get basic properties about this location service, e.g.

type, number of objects tracked, etc.

Implements Sirikata::LocationService.

References Sirikata::Command::EmptyResult(), mLocations, and Sirikata::Command::Commander::result().

bool Sirikata::BulletPhysicsService::contains ( const UUID uuid) const [virtual]

Indicates whether this location service is tracking the given object.

It is only safe to request information

Implements Sirikata::LocationService.

References mLocations.

Referenced by receiveMessage().

Quaternion Sirikata::BulletPhysicsService::currentOrientation ( const UUID uuid) [virtual]
Vector3f Sirikata::BulletPhysicsService::currentPosition ( const UUID uuid) [virtual]
bool Sirikata::BulletPhysicsService::directMotionRequestsEnabled ( const UUID uuid)

References mLocations.

Referenced by locationUpdate(), and receiveMessage().

btDiscreteDynamicsWorld* Sirikata::BulletPhysicsService::dynamicsWorld ( ) [inline]
uint64 Sirikata::BulletPhysicsService::epoch ( const UUID uuid) [virtual]

Methods dealing with information requests.

Implements Sirikata::LocationService.

References Sirikata::SequencedPresenceProperties::maxSeqNo(), mLocations, and Sirikata::LocationInfo::props.

Referenced by locationUpdate(), and receiveMessage().

void Sirikata::BulletPhysicsService::getMesh ( const Transfer::URI  meshURI,
const UUID  uuid,
MeshdataParsedCallback  cb 
)
void Sirikata::BulletPhysicsService::getMeshCallback ( Transfer::ResourceDownloadTaskPtr  taskptr,
Transfer::TransferRequestPtr  request,
Transfer::DenseDataPtr  response,
MeshdataParsedCallback  cb 
)
LocationInfo & Sirikata::BulletPhysicsService::info ( const UUID uuid)
const LocationInfo & Sirikata::BulletPhysicsService::info ( const UUID uuid) const

References mLocations.

void Sirikata::BulletPhysicsService::internalTickCallback ( )
bool Sirikata::BulletPhysicsService::isFixed ( const UUID uuid)

References mLocations.

Referenced by updateObjectFromDeactivation().

bool Sirikata::BulletPhysicsService::isLocal ( const UUID uuid) const

References mLocations.

Referenced by locationUpdate(), and receiveMessage().

bool Sirikata::BulletPhysicsService::isReplica ( const UUID uuid) const [inline]
TimedMotionVector3f Sirikata::BulletPhysicsService::location ( const UUID uuid) [virtual]
bool Sirikata::BulletPhysicsService::locationUpdate ( UUID  source,
void *  buffer,
uint32  length 
) [virtual]
const String & Sirikata::BulletPhysicsService::mesh ( const UUID uuid) [virtual]
TimedMotionQuaternion Sirikata::BulletPhysicsService::orientation ( const UUID uuid) [virtual]
const String & Sirikata::BulletPhysicsService::physics ( const UUID uuid) [virtual]
void Sirikata::BulletPhysicsService::receiveMessage ( Message msg) [virtual]
void Sirikata::BulletPhysicsService::removeDeactivateableObject ( const UUID uuid)
void Sirikata::BulletPhysicsService::removeInternalTickObject ( const UUID uuid)
void Sirikata::BulletPhysicsService::removeLocalAggregateObject ( const UUID uuid) [virtual]
void Sirikata::BulletPhysicsService::removeLocalObject ( const UUID uuid) [virtual]
void Sirikata::BulletPhysicsService::removeReplicaObject ( const Time t,
const UUID uuid 
) [virtual]
void Sirikata::BulletPhysicsService::removeTickObject ( const UUID uuid)
void Sirikata::BulletPhysicsService::service ( ) [virtual]
void Sirikata::BulletPhysicsService::setLocation ( const UUID uuid,
const TimedMotionVector3f newloc 
)
void Sirikata::BulletPhysicsService::setOrientation ( const UUID uuid,
const TimedMotionQuaternion neworient 
)
void Sirikata::BulletPhysicsService::updateLocalAggregateBounds ( const UUID uuid,
const AggregateBoundingInfo newval 
) [virtual]
void Sirikata::BulletPhysicsService::updateLocalAggregateLocation ( const UUID uuid,
const TimedMotionVector3f newval 
) [virtual]
void Sirikata::BulletPhysicsService::updateLocalAggregateMesh ( const UUID uuid,
const String &  newval 
) [virtual]
void Sirikata::BulletPhysicsService::updateLocalAggregateOrientation ( const UUID uuid,
const TimedMotionQuaternion newval 
) [virtual]
void Sirikata::BulletPhysicsService::updateLocalAggregatePhysics ( const UUID uuid,
const String &  newval 
) [virtual]
void Sirikata::BulletPhysicsService::updateObjectFromDeactivation ( const UUID uuid)
void Sirikata::BulletPhysicsService::updatePhysicsWorld ( const UUID uuid) [private]
void Sirikata::BulletPhysicsService::updatePhysicsWorldWithMesh ( const UUID uuid,
MeshdataPtr  retrievedMesh 
) [private]

Member Data Documentation

btDefaultCollisionConfiguration* Sirikata::BulletPhysicsService::collisionConfiguration [private]
btCollisionDispatcher* Sirikata::BulletPhysicsService::dispatcher [private]
btBroadphaseInterface* Sirikata::BulletPhysicsService::mBroadphase [private]
btDiscreteDynamicsWorld* Sirikata::BulletPhysicsService::mDynamicsWorld [private]

Referenced by BulletPhysicsService(), and service().

Referenced by BulletPhysicsService(), and service().

Referenced by getMesh().

Referenced by getMesh(), and ~BulletPhysicsService().

Referenced by BulletPhysicsService().

Referenced by BulletPhysicsService(), and getMesh().

Referenced by service().

btSequentialImpulseConstraintSolver* Sirikata::BulletPhysicsService::solver [private]

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