Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

PhysicsBody Class Reference

an interface to the Bullet physics engine, although parameters controlled by PhysicsBody::ComponentListener and its associated LinkComponent More...

#include <PhysicsBody.h>


Detailed Description

an interface to the Bullet physics engine, although parameters controlled by PhysicsBody::ComponentListener and its associated LinkComponent

Definition at line 21 of file PhysicsBody.h.

List of all members.

Classes

class  ComponentListener
 This object subscribes to a LinkComponent (usually the root KinematicJoint of a chain) and creates a corresponding PhysicsBodies for it and its children. More...

Public Member Functions

KinematicJointgetLinkComponent ()
std::string getPath () const
std::string getModel () const
btRigidBody & getBody () const
const btVector3 & getCenterOffset () const
void getCurrent (fmat::Column< 3 > &pos, fmat::Quaternion &quat) const
bool hasJoint () const
float getJoint () const
fmat::Column< 3 > getInertia () const
void teleport (const fmat::Column< 3 > &pos)
 removes from world, then re-builds at new location
void teleport (const fmat::Quaternion &quat)
 removes from world, then re-builds at new location
void teleport (const fmat::Column< 3 > &pos, const fmat::Quaternion &quat)
 removes from world, then re-builds at new location
void teleport (const btTransform &tr)
 removes from world, then re-builds at new location
void setVelocity (const fmat::Column< 3 > &linear, const fmat::Column< 3 > &angular)
 sets a linear and angular velocity (world coordinates), also applies to children
void setVelocity (const btVector3 &linear, const btVector3 &angular)
 sets a linear and angular velocity (world coordinates), also applies to children

Protected Member Functions

 PhysicsBody (PhysicsWorld &world_, KinematicJoint &link_, const plist::Primitive< float > *pos_, const btTransform &tr, PhysicsBody *parent)
 ~PhysicsBody ()
void init ()
void build ()
void buildLink (const KinematicJoint &kj, const fmat::Transform &tr)
void addComponent (const LinkComponent &comp, const fmat::Transform &tr)
void resetTransform ()
void clear ()
void updateFrictionForce ()
void updateAnistropicFriction ()
void rebuild ()

Static Protected Member Functions

static bool isChild (const LinkComponent &pb, const LinkComponent &child)

Protected Attributes

PhysicsWorldworld
KinematicJointlink
const plist::Primitive< float > * qpos
float totalMass
btVector3 centerOffset
btVector3 inertia
btCompoundShape * compound
btRigidBody * body
btGeneric6DofConstraint * joint
ConstraintInterfacejointInterface
MotorControllerjointController
btTransform lastTransform
PhysicsBodyparentBody
std::set< PhysicsBody * > children
std::string collisionDataName
plist::PrimitiveCallbackMember
< PhysicsBody
frictionForceListener
plist::CollectionCallbackMember
< PhysicsBody
anistropicFrictionListener

Static Protected Attributes

static std::map< std::string,
CollisionData * > 
collisionData

Private Member Functions

 PhysicsBody (const PhysicsBody &)
 do not call
PhysicsBodyoperator= (const PhysicsBody &)
 do not call

Friends

class PhysicsWorld
class CollisionData

Constructor & Destructor Documentation

PhysicsBody::PhysicsBody ( PhysicsWorld world_,
KinematicJoint link_,
const plist::Primitive< float > *  pos_,
const btTransform &  tr,
PhysicsBody parent 
) [protected]

Definition at line 117 of file PhysicsBody.h.

PhysicsBody::~PhysicsBody (  )  [protected]
PhysicsBody::PhysicsBody ( const PhysicsBody  )  [private]

do not call


Member Function Documentation

void PhysicsBody::addComponent ( const LinkComponent comp,
const fmat::Transform tr 
) [protected]
void PhysicsBody::build (  )  [protected]

Referenced by rebuild().

void PhysicsBody::buildLink ( const KinematicJoint kj,
const fmat::Transform tr 
) [protected]
void PhysicsBody::clear (  )  [protected]

Referenced by rebuild().

btRigidBody& PhysicsBody::getBody (  )  const

Definition at line 101 of file PhysicsBody.h.

const btVector3& PhysicsBody::getCenterOffset (  )  const

Definition at line 102 of file PhysicsBody.h.

void PhysicsBody::getCurrent ( fmat::Column< 3 > &  pos,
fmat::Quaternion quat 
) const
fmat::Column<3> PhysicsBody::getInertia (  )  const

Definition at line 107 of file PhysicsBody.h.

float PhysicsBody::getJoint (  )  const
KinematicJoint& PhysicsBody::getLinkComponent (  ) 

Definition at line 96 of file PhysicsBody.h.

std::string PhysicsBody::getModel (  )  const

Definition at line 99 of file PhysicsBody.h.

std::string PhysicsBody::getPath (  )  const
bool PhysicsBody::hasJoint (  )  const
void PhysicsBody::init (  )  [protected]

Referenced by PhysicsBody().

static bool PhysicsBody::isChild ( const LinkComponent pb,
const LinkComponent child 
) [static, protected]
PhysicsBody& PhysicsBody::operator= ( const PhysicsBody  )  [private]

do not call

void PhysicsBody::rebuild (  )  [protected]

Definition at line 140 of file PhysicsBody.h.

Referenced by PhysicsBody::ComponentListener::rebuildBody().

void PhysicsBody::resetTransform (  )  [protected]
void PhysicsBody::setVelocity ( const btVector3 &  linear,
const btVector3 &  angular 
)

sets a linear and angular velocity (world coordinates), also applies to children

void PhysicsBody::setVelocity ( const fmat::Column< 3 > &  linear,
const fmat::Column< 3 > &  angular 
)

sets a linear and angular velocity (world coordinates), also applies to children

void PhysicsBody::teleport ( const btTransform &  tr  ) 

removes from world, then re-builds at new location

void PhysicsBody::teleport ( const fmat::Column< 3 > &  pos,
const fmat::Quaternion quat 
)

removes from world, then re-builds at new location

void PhysicsBody::teleport ( const fmat::Quaternion quat  ) 

removes from world, then re-builds at new location

void PhysicsBody::teleport ( const fmat::Column< 3 > &  pos  ) 

removes from world, then re-builds at new location

void PhysicsBody::updateAnistropicFriction (  )  [protected]
void PhysicsBody::updateFrictionForce (  )  [protected]

Friends And Related Function Documentation

friend class CollisionData [friend]

Definition at line 161 of file PhysicsBody.h.

friend class PhysicsWorld [friend]

Definition at line 22 of file PhysicsBody.h.


Member Data Documentation

btRigidBody* PhysicsBody::body [protected]

Definition at line 151 of file PhysicsBody.h.

Referenced by getBody().

btVector3 PhysicsBody::centerOffset [protected]

Definition at line 147 of file PhysicsBody.h.

Referenced by getCenterOffset().

std::set<PhysicsBody*> PhysicsBody::children [protected]

Definition at line 157 of file PhysicsBody.h.

std::map<std::string,CollisionData*> PhysicsBody::collisionData [static, protected]

Definition at line 160 of file PhysicsBody.h.

std::string PhysicsBody::collisionDataName [protected]

Definition at line 159 of file PhysicsBody.h.

btCompoundShape* PhysicsBody::compound [protected]

Definition at line 150 of file PhysicsBody.h.

btVector3 PhysicsBody::inertia [protected]

Definition at line 148 of file PhysicsBody.h.

Referenced by getInertia().

btGeneric6DofConstraint* PhysicsBody::joint [protected]

Definition at line 152 of file PhysicsBody.h.

Definition at line 154 of file PhysicsBody.h.

Definition at line 153 of file PhysicsBody.h.

btTransform PhysicsBody::lastTransform [protected]

Definition at line 155 of file PhysicsBody.h.

Definition at line 143 of file PhysicsBody.h.

Referenced by getLinkComponent(), and getModel().

Definition at line 156 of file PhysicsBody.h.

Definition at line 144 of file PhysicsBody.h.

Definition at line 146 of file PhysicsBody.h.

Definition at line 142 of file PhysicsBody.h.


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:14 2016 by Doxygen 1.6.3