Sirikata
Public Member Functions | Private Member Functions | Private Attributes
Sirikata::BulletRigidBodyObject Class Reference

Implementation of BulletObject covering most types of rigid bodies -- static, dynamic, and linearly/vertically constrained. More...

#include <BulletRigidBodyObject.hpp>

Inheritance diagram for Sirikata::BulletRigidBodyObject:
Collaboration diagram for Sirikata::BulletRigidBodyObject:

List of all members.

Public Member Functions

 BulletRigidBodyObject (BulletPhysicsService *parent, const UUID &uuid, bulletObjTreatment treatment=BULLET_OBJECT_TREATMENT_IGNORE, bulletObjBBox bb=BULLET_OBJECT_BOUNDS_SPHERE, float32 mass=1.f)
virtual ~BulletRigidBodyObject ()
virtual bool fixed ()
virtual bulletObjTreatment treatment ()
virtual bulletObjBBox bbox ()
virtual float32 mass ()
virtual void load (Mesh::MeshdataPtr mesh)
 After the mesh has been downloaded and parsed (or immediately if no mesh is required), this loads the object into the simulation.
virtual void unload ()
 Unload the object from the simulation.
virtual void internalTick (const Time &t)
 Make modifications during an internal tick.
virtual void deactivationTick (const Time &t)
 Check this object for deactivation.
virtual bool applyRequestedLocation (const TimedMotionVector3f &loc, uint64 epoch)
 Try to apply the requested position to this object, updating the physics simulation if necessary.
virtual bool applyRequestedOrientation (const TimedMotionQuaternion &orient, uint64 epoch)
 Try to apply the requested orientation to this object, updating the physics simulation if necessary.
virtual void applyForcedLocation (const TimedMotionVector3f &loc, uint64 epoch)
 Apply the given position to this object.
virtual void applyForcedOrientation (const TimedMotionQuaternion &orient, uint64 epoch)
 Apply the given orientation to this object.
void updateBulletFromObject (btTransform &worldTrans)
void updateObjectFromBullet (const btTransform &worldTrans)

Private Member Functions

void addRigidBody ()
void removeRigidBody ()

Private Attributes

UUID mID
bool mFixed
bulletObjTreatment mTreatment
bulletObjBBox mBBox
float32 mMass
btCollisionShape * mObjShape
SirikataMotionStatemObjMotionState
btRigidBody * mObjRigidBody

Detailed Description

Implementation of BulletObject covering most types of rigid bodies -- static, dynamic, and linearly/vertically constrained.


Constructor & Destructor Documentation

Sirikata::BulletRigidBodyObject::BulletRigidBodyObject ( BulletPhysicsService parent,
const UUID uuid,
bulletObjTreatment  treatment = BULLET_OBJECT_TREATMENT_IGNORE,
bulletObjBBox  bb = BULLET_OBJECT_BOUNDS_SPHERE,
float32  mass = 1.f 
)
Sirikata::BulletRigidBodyObject::~BulletRigidBodyObject ( ) [virtual]

References removeRigidBody().


Member Function Documentation

void Sirikata::BulletRigidBodyObject::addRigidBody ( ) [private]
void Sirikata::BulletRigidBodyObject::applyForcedLocation ( const TimedMotionVector3f loc,
uint64  epoch 
) [virtual]

Apply the given position to this object.

This takes whatever steps are necessary to apply the change, even completely reloading the object in Bullet. This should only be used when absolutely necessary, e.g. for updates about remote, physically simulated objects.

Implements Sirikata::BulletObject.

References Sirikata::BulletPhysicsService::info(), mID, mObjMotionState, mObjRigidBody, Sirikata::BulletObject::mParent, Sirikata::LocationInfo::props, and Sirikata::SequencedPresenceProperties::setLocation().

Referenced by applyRequestedLocation().

void Sirikata::BulletRigidBodyObject::applyForcedOrientation ( const TimedMotionQuaternion orient,
uint64  epoch 
) [virtual]

Apply the given orientation to this object.

This takes whatever steps are necessary to apply the change, even completely reloading the object in Bullet. This should only be used when absolutely necessary, e.g. for updates about remote, physically simulated objects.

Implements Sirikata::BulletObject.

References Sirikata::BulletPhysicsService::info(), mID, mObjMotionState, mObjRigidBody, Sirikata::BulletObject::mParent, Sirikata::LocationInfo::props, and Sirikata::SequencedPresenceProperties::setOrientation().

Referenced by applyRequestedOrientation().

bool Sirikata::BulletRigidBodyObject::applyRequestedLocation ( const TimedMotionVector3f loc,
uint64  epoch 
) [virtual]

Try to apply the requested position to this object, updating the physics simulation if necessary.

Some types of objects may always fail to apply updates. Returns true if the update was applied and an update will need to be sent.

Implements Sirikata::BulletObject.

References applyForcedLocation(), Sirikata::BULLET_OBJECT_TREATMENT_STATIC, and mTreatment.

bool Sirikata::BulletRigidBodyObject::applyRequestedOrientation ( const TimedMotionQuaternion orient,
uint64  epoch 
) [virtual]

Try to apply the requested orientation to this object, updating the physics simulation if necessary.

Some types of objects may always fail to apply updates. Returns true if the update was applied and an update will need to be sent.

Implements Sirikata::BulletObject.

References applyForcedOrientation(), Sirikata::BULLET_OBJECT_TREATMENT_STATIC, and mTreatment.

boost::any Sirikata::Graphics::OgreSystem::bbox ( ) [inline, virtual]

Implements Sirikata::BulletObject.

References mBBox.

void Sirikata::BulletRigidBodyObject::deactivationTick ( const Time t) [virtual]

Check this object for deactivation.

Implementations should call BulletPhysicsService::updateObjectFromDeactivation if the object has been deactivated.

Reimplemented from Sirikata::BulletObject.

References mID, mObjRigidBody, Sirikata::BulletObject::mParent, and Sirikata::BulletPhysicsService::updateObjectFromDeactivation().

virtual bool Sirikata::BulletRigidBodyObject::fixed ( ) [inline, virtual]

Implements Sirikata::BulletObject.

References mFixed.

void Sirikata::BulletRigidBodyObject::internalTick ( const Time t) [virtual]

Make modifications during an internal tick.

Useful for capping speed and rotational speed.

Reimplemented from Sirikata::BulletObject.

References mObjRigidBody.

void Sirikata::BulletRigidBodyObject::load ( Mesh::MeshdataPtr  mesh) [virtual]

After the mesh has been downloaded and parsed (or immediately if no mesh is required), this loads the object into the simulation.

This should setup any Bullet state and start the physical simulation on the object.

Implements Sirikata::BulletObject.

References addRigidBody(), Sirikata::BulletObject::computeCollisionShape(), mBBox, mID, mObjShape, and mTreatment.

virtual float32 Sirikata::BulletRigidBodyObject::mass ( ) [inline, virtual]

Implements Sirikata::BulletObject.

References mMass.

void Sirikata::BulletRigidBodyObject::removeRigidBody ( ) [private]
virtual bulletObjTreatment Sirikata::BulletRigidBodyObject::treatment ( ) [inline, virtual]

Implements Sirikata::BulletObject.

References mTreatment.

void Sirikata::BulletRigidBodyObject::unload ( ) [virtual]

Unload the object from the simulation.

Implements Sirikata::BulletObject.

References removeRigidBody().

void Sirikata::BulletRigidBodyObject::updateBulletFromObject ( btTransform &  worldTrans)
void Sirikata::BulletRigidBodyObject::updateObjectFromBullet ( const btTransform &  worldTrans)

Member Data Documentation

Referenced by bbox(), and load().

btCollisionShape* Sirikata::BulletRigidBodyObject::mObjShape [private]

Referenced by addRigidBody(), load(), and removeRigidBody().


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