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

Implementation of BulletObject for characters. More...

#include <BulletCharacterObject.hpp>

Inheritance diagram for Sirikata::BulletCharacterObject:
Collaboration diagram for Sirikata::BulletCharacterObject:

List of all members.

Public Member Functions

 BulletCharacterObject (BulletPhysicsService *parent, const UUID &uuid, bulletObjBBox bb=BULLET_OBJECT_BOUNDS_SPHERE)
virtual ~BulletCharacterObject ()
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 preTick (const Time &t)
 Make modifications before a full tick.
virtual void postTick (const Time &t)
 Make modifications before a full 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.

Private Attributes

UUID mID
bulletObjBBox mBBox
btPairCachingGhostObject * mGhostObject
BulletCharacterControllermCharacter
btCollisionShape * mCollisionShape

Detailed Description

Implementation of BulletObject for characters.

Characters behave differently than other physical objects -- they try to stay on the ground and fall like normal objects, but we don't want them to rotate, want them to slide against the ground and walls, etc.


Constructor & Destructor Documentation

Sirikata::BulletCharacterObject::BulletCharacterObject ( BulletPhysicsService parent,
const UUID uuid,
bulletObjBBox  bb = BULLET_OBJECT_BOUNDS_SPHERE 
)
Sirikata::BulletCharacterObject::~BulletCharacterObject ( ) [virtual]

Member Function Documentation

void Sirikata::BulletCharacterObject::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::currentPosition(), Sirikata::BulletPhysicsService::info(), mGhostObject, mID, Sirikata::BulletObject::mParent, Sirikata::LocationInfo::props, and Sirikata::SequencedPresenceProperties::setLocation().

Referenced by applyRequestedLocation().

void Sirikata::BulletCharacterObject::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::currentOrientation(), Sirikata::BulletPhysicsService::info(), mGhostObject, mID, Sirikata::BulletObject::mParent, Sirikata::LocationInfo::props, Sirikata::SequencedPresenceProperties::setOrientation(), Sirikata::Vector4< scalar >::w, Sirikata::Vector4< scalar >::x, Sirikata::Vector4< scalar >::y, and Sirikata::Vector4< scalar >::z.

Referenced by applyRequestedOrientation().

bool Sirikata::BulletCharacterObject::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().

bool Sirikata::BulletCharacterObject::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().

bulletObjBBox Sirikata::BulletCharacterObject::bbox ( ) [virtual]

Implements Sirikata::BulletObject.

References mBBox.

void Sirikata::BulletCharacterObject::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 mGhostObject, mID, Sirikata::BulletObject::mParent, and Sirikata::BulletPhysicsService::updateObjectFromDeactivation().

bool Sirikata::BulletCharacterObject::fixed ( ) [virtual]
void Sirikata::BulletCharacterObject::load ( Mesh::MeshdataPtr  mesh) [virtual]
float32 Sirikata::BulletCharacterObject::mass ( ) [virtual]
void Sirikata::BulletCharacterObject::postTick ( const Time t) [virtual]
void Sirikata::BulletCharacterObject::preTick ( const Time t) [virtual]
bulletObjTreatment Sirikata::BulletCharacterObject::treatment ( ) [virtual]
void Sirikata::BulletCharacterObject::unload ( ) [virtual]

Member Data Documentation

Referenced by bbox(), BulletCharacterObject(), and load().

Referenced by load(), preTick(), and unload().

Referenced by load(), and unload().

btPairCachingGhostObject* Sirikata::BulletCharacterObject::mGhostObject [private]

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