chai3d::cBulletGenericObject Class Reference

#include <CBulletGenericObject.h>

Inheritance diagram for chai3d::cBulletGenericObject:

Public Member Functions

 cBulletGenericObject (cBulletWorld *a_world)
 Constructor of cBulletGenericBody. More...
 
virtual ~cBulletGenericObject ()
 Destructor of cBulletGenericBody. More...
 
virtual void updateBodyPosition (void)
 This method updates the position and orientation from the Bullet model to CHAI3D model. More...
 
virtual void setMass (const double a_mass)
 This method assigns a mass value to this object. More...
 
double getMass () const
 This method returns the mass value for this object. More...
 
virtual void setInertia (const cVector3d &a_inertia)
 This method assigns an inertia properties to this object. More...
 
cVector3d getInertia ()
 This method returns the inertia properties of this object. More...
 
virtual void setMassInertia (const double a_mass, const cVector3d &a_inertia)
 This method assigns a mass and an inertia to this object. More...
 
virtual void estimateInertia ()
 This method estimates the inertia properties for this object. More...
 
virtual void setStatic (bool a_static)
 This method enables of disables the object to be static in the world. More...
 
virtual bool getStatic () const
 This method returns true if the object is static, false otherwise. More...
 
virtual void buildDynamicModel ()
 This method builds a dynamic representation of the object in the Bullet world. More...
 
virtual void updatePositionFromDynamics ()
 This method updates the CHAI3D position representation from the Bullet dynamics engine. More...
 
void setSurfaceFriction (const double a_friction)
 This method assign a coefficient of friction to this object. More...
 
double getSurfaceFriction ()
 This method returns the coefficient of friction for this object. More...
 
void addExternalForce (const cVector3d &a_force)
 This method applies an external force at the center of mass of this object. More...
 
void addExternalTorque (const cVector3d &a_torque)
 This method applies an external torque at the center of mass of of this object. More...
 
void addExternalForceAtPoint (const cVector3d &a_force, const cVector3d &a_relativePos)
 This method applies an external force at a given position described in global coordinates to this object. More...
 
void setDamping (const double &a_dampingLin, const double &a_dampingAng)
 This method assigns a linear and angular damping term to the object. More...
 
double getDampingLin ()
 This method returns the linear damping term for this object. More...
 
double getDampingAng ()
 This method returns the angular damping term for this object. More...
 

Public Attributes

cBulletWorld * m_dynamicWorld
 Bullet world. More...
 
btRigidBody * m_bulletRigidBody
 Bullet rigid body. More...
 
btCollisionShape * m_bulletCollisionShape
 Bullet collision shape. More...
 
btDefaultMotionState * m_bulletMotionState
 Bullet motion state. More...
 

Protected Member Functions

virtual void initialize (cBulletWorld *a_world)
 This method initializes the Bullet object. More...
 

Protected Attributes

bool m_static
 If true then object is static and does not move, false otherwise. More...
 
double m_mass
 Mass property. More...
 
cVector3d m_inertia
 Inertia properties. More...
 

Constructor & Destructor Documentation

chai3d::cBulletGenericObject::cBulletGenericObject ( cBulletWorld *  a_world)
inline
chai3d::cBulletGenericObject::~cBulletGenericObject ( )
virtual

This method initializes the Bullet dynamic model.

Member Function Documentation

virtual void chai3d::cBulletGenericObject::updateBodyPosition ( void  )
inlinevirtual
void chai3d::cBulletGenericObject::setMass ( const double  a_mass)
virtual

This method assigns a mass value to this object.

Parameters
a_massMass value.
double chai3d::cBulletGenericObject::getMass ( ) const
inline
void chai3d::cBulletGenericObject::setInertia ( const cVector3d &  a_inertia)
virtual

This method assigns inertia properties to this object.

Parameters
a_inertiaInertia properties.
cVector3d chai3d::cBulletGenericObject::getInertia ( )
inline
void chai3d::cBulletGenericObject::setMassInertia ( const double  a_mass,
const cVector3d &  a_inertia 
)
virtual

This method assigns mass and inertia properties to this object.

Parameters
a_massMass value.
a_inertiaInertia properties.
void chai3d::cBulletGenericObject::estimateInertia ( )
virtual

This method estimates the inertia properties for this object. Make sure to define its mass beforehand.

void chai3d::cBulletGenericObject::setStatic ( bool  a_static)
virtual

This method enables of disables the object to be static in the world.

Parameters
a_staticIf true then object is static, false it is dynamic as long as mass and inertia properties have been defined.
virtual bool chai3d::cBulletGenericObject::getStatic ( ) const
inlinevirtual
void chai3d::cBulletGenericObject::buildDynamicModel ( )
virtual

This method builds a dynamic representation of the object in the Bullet world.

Reimplemented in chai3d::cBulletVehicle.

virtual void chai3d::cBulletGenericObject::updatePositionFromDynamics ( )
inlinevirtual
void chai3d::cBulletGenericObject::setSurfaceFriction ( const double  a_friction)

This method assign a coefficient of friction to this object.

Returns
Angular damping.
double chai3d::cBulletGenericObject::getSurfaceFriction ( )

This method returns the coefficient of friction for this object. Zero is returned if the object has no dynamic model.

Returns
Friction coefficient.
void chai3d::cBulletGenericObject::addExternalForce ( const cVector3d &  a_force)

This method applies an external force at the center of mass of the object.

Parameters
a_forceForce vector.
void chai3d::cBulletGenericObject::addExternalTorque ( const cVector3d &  a_torque)

This method applies an external torque at the center of mass of the object.

Parameters
a_torqueTorque vector.
void chai3d::cBulletGenericObject::addExternalForceAtPoint ( const cVector3d &  a_force,
const cVector3d &  a_relativePos 
)

This method applies an external force to the object at a given position. The relative position and force are expressed in global coordinates.

Parameters
a_forceForce vector.
a_relativePosRelative position where force is applied.
void chai3d::cBulletGenericObject::setDamping ( const double &  a_dampingLin,
const double &  a_dampingAng 
)

This method assigns a linear and angular damping term to the object.

Parameters
a_dampingLinLinear damping.
a_dampingAngAngular damping.
double chai3d::cBulletGenericObject::getDampingLin ( )

This method returns the linear damping term for this object. Zero is returned if the object has no dynamic model.

Returns
Linear damping.
double chai3d::cBulletGenericObject::getDampingAng ( )

This method returns the angular damping term for this object. Zero is returned if the object has no dynamic model.

Returns
Angular damping.
void chai3d::cBulletGenericObject::initialize ( cBulletWorld *  a_world)
protectedvirtual

This method initializes the Bullet dynamic model.

Parameters
a_worldBullet world to which this new object belongs to.

init variables

Member Data Documentation

cBulletWorld* chai3d::cBulletGenericObject::m_dynamicWorld
btRigidBody* chai3d::cBulletGenericObject::m_bulletRigidBody
btCollisionShape* chai3d::cBulletGenericObject::m_bulletCollisionShape
btDefaultMotionState* chai3d::cBulletGenericObject::m_bulletMotionState
bool chai3d::cBulletGenericObject::m_static
protected
double chai3d::cBulletGenericObject::m_mass
protected
cVector3d chai3d::cBulletGenericObject::m_inertia
protected

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