Sirikata
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
Sirikata::BulletObject Class Reference

Base class for simulated objects in bullet. More...

#include <BulletObject.hpp>

Inheritance diagram for Sirikata::BulletObject:
Collaboration diagram for Sirikata::BulletObject:

List of all members.

Public Member Functions

 BulletObject (BulletPhysicsService *parent)
virtual ~BulletObject ()
virtual bool fixed ()=0
virtual bulletObjTreatment treatment ()=0
virtual bulletObjBBox bbox ()=0
virtual float32 mass ()=0
virtual void load (Mesh::MeshdataPtr mesh)=0
 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 ()=0
 Unload the object from the simulation.
virtual void preTick (const Time &t)
 Make modifications before a full tick.
virtual void postTick (const Time &t)
 Make modifications before a full tick.
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)=0
 Try to apply the requested position to this object, updating the physics simulation if necessary.
virtual bool applyRequestedOrientation (const TimedMotionQuaternion &orient, uint64 epoch)=0
 Try to apply the requested orientation to this object, updating the physics simulation if necessary.
virtual void applyForcedLocation (const TimedMotionVector3f &loc, uint64 epoch)=0
 Apply the given position to this object.
virtual void applyForcedOrientation (const TimedMotionQuaternion &orient, uint64 epoch)=0
 Apply the given orientation to this object.

Static Public Member Functions

static void getCollisionMask (bulletObjTreatment treatment, bulletObjCollisionMaskGroup *mygroup, bulletObjCollisionMaskGroup *collide_with)

Protected Member Functions

btCollisionShape * computeCollisionShape (const UUID &id, bulletObjBBox shape_type, bulletObjTreatment treatment, Mesh::MeshdataPtr retrievedMesh)

Protected Attributes

BulletPhysicsServicemParent

Detailed Description

Base class for simulated objects in bullet.

This provides a pretty generic interface since different types of objects are handled very differently, e.g. regular rigid bodies vs. characters.


Constructor & Destructor Documentation

Sirikata::BulletObject::BulletObject ( BulletPhysicsService parent) [inline]
virtual Sirikata::BulletObject::~BulletObject ( ) [inline, virtual]

Member Function Documentation

virtual void Sirikata::BulletObject::applyForcedLocation ( const TimedMotionVector3f loc,
uint64  epoch 
) [pure 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.

Implemented in Sirikata::BulletCharacterObject, and Sirikata::BulletRigidBodyObject.

virtual void Sirikata::BulletObject::applyForcedOrientation ( const TimedMotionQuaternion orient,
uint64  epoch 
) [pure 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.

Implemented in Sirikata::BulletCharacterObject, and Sirikata::BulletRigidBodyObject.

virtual bool Sirikata::BulletObject::applyRequestedLocation ( const TimedMotionVector3f loc,
uint64  epoch 
) [pure 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.

Implemented in Sirikata::BulletCharacterObject, and Sirikata::BulletRigidBodyObject.

virtual bool Sirikata::BulletObject::applyRequestedOrientation ( const TimedMotionQuaternion orient,
uint64  epoch 
) [pure 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.

Implemented in Sirikata::BulletCharacterObject, and Sirikata::BulletRigidBodyObject.

virtual bulletObjBBox Sirikata::BulletObject::bbox ( ) [pure virtual]
btCollisionShape * Sirikata::BulletObject::computeCollisionShape ( const UUID id,
bulletObjBBox  shape_type,
bulletObjTreatment  treatment,
Mesh::MeshdataPtr  retrievedMesh 
) [protected]
virtual void Sirikata::BulletObject::deactivationTick ( const Time t) [inline, virtual]

Check this object for deactivation.

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

Reimplemented in Sirikata::BulletCharacterObject, and Sirikata::BulletRigidBodyObject.

Referenced by Sirikata::BulletPhysicsService::service().

virtual bool Sirikata::BulletObject::fixed ( ) [pure virtual]
void Sirikata::BulletObject::getCollisionMask ( bulletObjTreatment  treatment,
bulletObjCollisionMaskGroup mygroup,
bulletObjCollisionMaskGroup collide_with 
) [static]
virtual void Sirikata::BulletObject::internalTick ( const Time t) [inline, virtual]

Make modifications during an internal tick.

Useful for capping speed and rotational speed.

Reimplemented in Sirikata::BulletRigidBodyObject.

Referenced by Sirikata::BulletPhysicsService::internalTickCallback().

virtual void Sirikata::BulletObject::load ( Mesh::MeshdataPtr  mesh) [pure 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.

Implemented in Sirikata::BulletCharacterObject, and Sirikata::BulletRigidBodyObject.

Referenced by Sirikata::BulletPhysicsService::updatePhysicsWorldWithMesh().

virtual float32 Sirikata::BulletObject::mass ( ) [pure virtual]
virtual void Sirikata::BulletObject::postTick ( const Time t) [inline, virtual]

Make modifications before a full tick.

Reimplemented in Sirikata::BulletCharacterObject.

Referenced by Sirikata::BulletPhysicsService::service().

virtual void Sirikata::BulletObject::preTick ( const Time t) [inline, virtual]

Make modifications before a full tick.

Reimplemented in Sirikata::BulletCharacterObject.

Referenced by Sirikata::BulletPhysicsService::service().

virtual bulletObjTreatment Sirikata::BulletObject::treatment ( ) [pure virtual]
virtual void Sirikata::BulletObject::unload ( ) [pure virtual]

Member Data Documentation


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