chai3d::cBulletBox Class Reference

This class implements a Bullet dynamic box. More...

#include <CBulletBox.h>

Inheritance diagram for chai3d::cBulletBox:

Public Member Functions

 cBulletBox (cBulletWorld *a_world, const double &a_sizeX, const double &a_sizeY, const double &a_sizeZ)
 Constructor of cBulletBox. More...
 
virtual ~cBulletBox ()
 Destructor of cBulletBox. More...
 
double getSizeX () const
 This method returns the box length along axis X. More...
 
double getSizeY () const
 This method returns the box length along axis Y. More...
 
double getSizeZ () const
 This method returns the box length along axis Z. More...
 
- Public Member Functions inherited from chai3d::cBulletMesh
 cBulletMesh (cBulletWorld *a_world)
 Constructor of cBulletMesh. More...
 
virtual ~cBulletMesh ()
 Destructor of cBulletMesh. More...
 
virtual void setLocalPos (const cVector3d &a_position)
 This method sets the local position of object. More...
 
virtual void setLocalRot (const cMatrix3d &a_rotation)
 This method sets the orientation of this object. More...
 
virtual void updatePositionFromDynamics ()
 This method update the CHAI3D position representation from the Bullet dynamics engine. More...
 
virtual void buildContactConvexTriangles (const double a_margin=0.01)
 This method creates a Bullet collision model for this object. More...
 
virtual void buildContactTriangles (const double a_margin=0.01)
 This method creates a Bullet collision model for this object. More...
 
virtual void buildContactHull (const double a_margin=0.01)
 This method creates a Bullet collision model for this object. More...
 
- Public Member Functions inherited from chai3d::cMesh
 cMesh (cMaterialPtr a_material=cMaterialPtr())
 
virtual ~cMesh ()
 
virtual cMesh * copy (const bool a_duplicateMaterialData=false, const bool a_duplicateTextureData=false, const bool a_duplicateMeshData=false, const bool a_buildCollisionDetector=false)
 
virtual void setTransparencyLevel (const float a_level, const bool a_applyToVertices=false, const bool a_applyToTextures=false, const bool a_affectChildren=false)
 
virtual void markForUpdate (const bool a_affectChildren=false)
 
unsigned int newVertex (const double a_x=0.0, const double a_y=0.0, const double a_z=0.0, const double a_normalX=1.0, const double a_normalY=0.0, const double a_normalZ=0.0, const double a_textureCoordX=0.0, const double a_textureCoordY=0.0, const double a_textureCoordZ=0.0)
 
unsigned int newVertex (const cVector3d &a_pos, const cVector3d &a_normal=cVector3d(1, 0, 0), const cVector3d &a_textureCoord=cVector3d(0, 0, 0), const cColorf &a_color=cColorf(0, 0, 0, 1))
 
unsigned int getNumVertices () const
 
void setVertexColor (const cColorf &a_color)
 
unsigned int newTriangle (const unsigned int a_indexVertex0, const unsigned int a_indexVertex1, const unsigned int a_indexVertex2)
 
unsigned int newTriangle (const cVector3d &a_vertex0=cVector3d(0, 0, 0), const cVector3d &a_vertex1=cVector3d(0, 0, 0), const cVector3d &a_vertex2=cVector3d(0, 0, 0), const cVector3d &a_normal0=cVector3d(1, 0, 0), const cVector3d &a_normal1=cVector3d(1, 0, 0), const cVector3d &a_normal2=cVector3d(1, 0, 0), const cVector3d &a_textureCoord0=cVector3d(0, 0, 0), const cVector3d &a_textureCoord1=cVector3d(0, 0, 0), const cVector3d &a_textureCoord2=cVector3d(0, 0, 0), const cColorf &a_colorVertex0=cColorf(0, 0, 0, 1), const cColorf &a_colorVertex1=cColorf(0, 0, 0, 1), const cColorf &a_colorVertex2=cColorf(0, 0, 0, 1))
 
bool removeTriangle (const unsigned int a_index)
 
unsigned int getNumTriangles ()
 
void clear ()
 
void setShowTriangles (const bool a_showTriangles)
 
bool getShowTriangles () const
 
void computeAllEdges (double a_angleThresholdDeg=40.0)
 
void clearAllEdges ()
 
void setShowEdges (const bool a_showEdges)
 
bool getShowEdges () const
 
void setEdgeProperties (const double a_width, const cColorf &a_color)
 
void setEdgeLineWidth (const double a_width)
 
void setShowNormals (const bool a_showNormals)
 
bool getShowNormals () const
 
void setNormalsProperties (const double a_length, const cColorf &a_color)
 
void setNormalsLength (const double a_length)
 
void computeAllNormals ()
 
virtual void reverseAllNormals ()
 
void computeBTN ()
 
void setShowTangents (const bool a_showTangents)
 
bool getShowTangents () const
 
virtual void createBruteForceCollisionDetector ()
 
virtual void createAABBCollisionDetector (const double a_radius)
 
void scaleXYZ (const double a_scaleX, const double a_scaleY, const double a_scaleZ)
 
virtual void offsetVertices (const cVector3d &a_offset, const bool a_updateCollisionDetector=true)
 
virtual cVector3d getCenterOfMass ()
 
- Public Member Functions inherited from chai3d::cGenericObject
 cGenericObject ()
 
virtual ~cGenericObject ()
 
virtual void setEnabled (bool a_enabled, const bool a_affectChildren=false)
 
bool getEnabled () const
 
void setLocalPos (const double a_x=0.0, const double a_y=0.0, const double a_z=0.0)
 
cVector3d getLocalPos () const
 
cVector3d getGlobalPos () const
 
cMatrix3d getLocalRot () const
 
cMatrix3d getGlobalRot () const
 
void setLocalTransform (const cTransform &a_transform)
 
cTransform getLocalTransform ()
 
cTransform getGlobalTransform ()
 
void translate (const cVector3d &a_translation)
 
void translate (const double a_x, const double a_y, const double a_z=0.0)
 
void rotateAboutLocalAxisRad (const cVector3d &a_axis, const double a_angleRad)
 
void rotateAboutLocalAxisDeg (const cVector3d &a_axis, const double a_angleDeg)
 
void rotateAboutLocalAxisRad (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleRad)
 
void rotateAboutLocalAxisDeg (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleDeg)
 
void rotateAboutGlobalAxisRad (const cVector3d &a_axis, const double a_angleRad)
 
void rotateAboutGlobalAxisDeg (const cVector3d &a_axis, const double a_angleDeg)
 
void rotateAboutGlobalAxisRad (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleRad)
 
void rotateAboutGlobalAxisDeg (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleDeg)
 
void rotateExtrinsicEulerAnglesRad (const double &a_angleRad1, const double &a_angleRad2, const double &a_angleRad3, const cEulerOrder a_eulerOrder)
 
void rotateExtrinsicEulerAnglesDeg (const double &a_angleDeg1, const double &a_angleDeg2, const double &a_angleDeg3, const cEulerOrder a_eulerOrder)
 
void rotateIntrinsicEulerAnglesRad (const double &a_angleRad1, const double &a_angleRad2, const double &a_angleRad3, const cEulerOrder a_eulerOrder)
 
void rotateIntrinsicEulerAnglesDeg (const double &a_angleDeg1, const double &a_angleDeg2, const double &a_angleDeg3, const cEulerOrder a_eulerOrder)
 
virtual void computeGlobalPositions (const bool a_frameOnly=true, const cVector3d &a_globalPos=cVector3d(0.0, 0.0, 0.0), const cMatrix3d &a_globalRot=cIdentity3d())
 
void computeGlobalPositionsFromRoot (const bool a_frameOnly=true)
 
bool addEffect (cGenericEffect *a_effect)
 
bool removeEffect (cGenericEffect *a_effect)
 
void deleteAllEffects ()
 
bool createEffectMagnetic ()
 
bool deleteEffectMagnetic ()
 
bool createEffectStickSlip ()
 
bool deleteEffectStickSlip ()
 
bool createEffectSurface ()
 
bool deleteEffectSurface ()
 
bool createEffectVibration ()
 
bool deleteEffectVibration ()
 
bool createEffectViscosity ()
 
bool deleteEffectViscosity ()
 
virtual void setHapticEnabled (const bool a_hapticEnabled, const bool a_affectChildren=true)
 
bool getHapticEnabled () const
 
virtual void setStiffness (const double a_stiffness, const bool a_affectChildren=true)
 
virtual void setFriction (double a_staticFriction, double a_dynamicFriction, const bool a_affectChildren=true)
 
virtual void setShowEnabled (const bool a_show, const bool a_affectChildren=true)
 
bool getShowEnabled () const
 
virtual void setWireMode (const bool a_showWireMode, const bool a_affectChildren=false)
 
bool getWireMode () const
 
virtual void setUseCulling (const bool a_useCulling, const bool a_affectChildren=false)
 
bool getUseCulling () const
 
virtual void setUseTransparency (const bool a_useTransparency, const bool a_affectChildren=false)
 
bool getUseTransparency () const
 
virtual void setUseDisplayList (const bool a_useDisplayList, const bool a_affectChildren=false)
 
bool getUseDisplayList () const
 
virtual void setUseVertexColors (const bool a_useColors, const bool a_affectChildren=false)
 
bool getUseVertexColors () const
 
virtual void setUseMaterial (const bool a_useMaterial, const bool a_affectChildren=false)
 
bool getUseMaterial () const
 
virtual void setMaterial (cMaterialPtr a_material, const bool a_affectChildren=false)
 
virtual void setMaterial (cMaterial &a_material, const bool a_affectChildren=false)
 
virtual void backupMaterialColors (const bool a_affectChildren=false)
 
virtual void restoreMaterialColors (const bool a_affectChildren=false)
 
virtual void setUseTexture (const bool a_useTexture, const bool a_affectChildren=false)
 
bool getUseTexture () const
 
virtual void setTexture (cTexture1dPtr a_texture, const bool a_affectChildren=false)
 
virtual void setShaderProgram (cShaderProgramPtr a_shaderProgram, const bool a_affectChildren=false)
 
virtual cShaderProgramPtr getShaderProgram ()
 
virtual void setShowBoundaryBox (const bool a_showBoundaryBox, const bool a_affectChildren=false)
 
bool getShowBoundaryBox () const
 
cVector3d getBoundaryMin () const
 
cVector3d getBoundaryMax () const
 
cVector3d getBoundaryCenter () const
 
bool getBoundaryBoxEmpty ()
 
virtual void computeBoundaryBox (const bool a_includeChildren=true)
 
virtual void setShowFrame (const bool a_showFrame, const bool a_affectChildren=false)
 
bool getShowFrame (void) const
 
virtual void setFrameSize (const double a_size=1.0, const bool a_affectChildren=false)
 
double getFrameSize () const
 
void setCollisionDetector (cGenericCollision *a_collisionDetector)
 
cGenericCollision * getCollisionDetector () const
 
virtual void deleteCollisionDetector (const bool a_affectChildren=false)
 
virtual bool computeCollisionDetection (const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings)
 
virtual void setShowCollisionDetector (const bool a_showCollisionDetector, const bool a_affectChildren=false)
 
bool getShowCollisionDetector ()
 
virtual void setCollisionDetectorProperties (unsigned int a_displayDepth, cColorf &a_color, const bool a_affectChildren=false)
 
void setParent (cGenericObject *a_parent)
 
cGenericObject * getParent () const
 
void setOwner (cGenericObject *a_owner)
 
cGenericObject * getOwner ()
 
cGenericObject * getChild (const unsigned int a_index) const
 
bool addChild (cGenericObject *a_object)
 
bool removeChild (cGenericObject *a_object)
 
bool removeFromGraph ()
 
bool deleteChild (cGenericObject *a_object)
 
void clearAllChildren ()
 
void deleteAllChildren ()
 
unsigned int getNumChildren ()
 
unsigned int getNumDescendants (bool a_includeCurrentObject=false)
 
void setGhostEnabled (bool a_ghostEnabled)
 
bool getGhostEnabled ()
 
virtual void scale (const double &a_scaleFactor, const bool a_affectChildren=true)
 
virtual void renderSceneGraph (cRenderOptions &a_options)
 
virtual void adjustCollisionSegment (cVector3d &a_segmentPointA, cVector3d &a_segmentPointAadjusted)
 
virtual cVector3d computeInteractions (const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN, cInteractionRecorder &a_interactions)
 
- Public Member Functions inherited from chai3d::cGenericType
 cGenericType ()
 
virtual ~cGenericType ()
 
- Public Member Functions inherited from chai3d::cBulletGenericObject
 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...
 
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...
 

Protected Attributes

double m_sizeX
 Length of box along axis Z. More...
 
double m_sizeY
 Length of box along axis Y. More...
 
double m_sizeZ
 Length of box along axis Z. More...
 
- Protected Attributes inherited from chai3d::cMesh
bool m_showTriangles
 
bool m_showNormals
 
bool m_showTangents
 
double m_normalsLength
 
bool m_showEdges
 
double m_edgeLineWidth
 
cDisplayList m_displayListEdges
 
- Protected Attributes inherited from chai3d::cGenericObject
cGenericObject * m_parent
 
cGenericObject * m_owner
 
std::vector< cGenericObject * > m_children
 
cVector3d m_localPos
 
cVector3d m_globalPos
 
cMatrix3d m_localRot
 
cMatrix3d m_globalRot
 
cVector3d m_prevGlobalPos
 
cMatrix3d m_prevGlobalRot
 
cVector3d m_boundaryBoxMin
 
cVector3d m_boundaryBoxMax
 
bool m_boundaryBoxEmpty
 
double m_frameSize
 
double m_frameThicknessScale
 
bool m_enabled
 
bool m_showEnabled
 
bool m_hapticEnabled
 
bool m_ghostEnabled
 
bool m_showFrame
 
bool m_showBoundaryBox
 
bool m_showCollisionDetector
 
bool m_useTextureMapping
 
bool m_useMaterialProperty
 
bool m_useVertexColors
 
bool m_useDisplayList
 
cDisplayList m_displayList
 
int m_triangleMode
 
bool m_useTransparency
 
bool m_cullingEnabled
 
cShaderProgramPtr m_shaderProgram
 
cTransform m_frameGL
 
cGenericCollision * m_collisionDetector
 
std::vector< cGenericEffect * > m_effects
 
- Protected Attributes inherited from chai3d::cBulletGenericObject
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...
 

Additional Inherited Members

- Public Attributes inherited from chai3d::cMesh
cColorf m_normalsColor
 
cColorf m_edgeLineColor
 
cVertexArrayPtr m_vertices
 
cTriangleArrayPtr m_triangles
 
std::vector< cEdge > m_edges
 
- Public Attributes inherited from chai3d::cGenericObject
std::string m_name
 
cMaterialPtr m_material
 
cTexture1dPtr m_texture
 
cNormalMapPtr m_normalMap
 
int m_userTag
 
void * m_userData
 
std::string m_userName
 
cGenericObject * m_userExternalObject
 
cVector3d m_interactionPoint
 
cVector3d m_interactionNormal
 
bool m_interactionInside
 
- Public Attributes inherited from chai3d::cBulletGenericObject
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...
 
- Static Public Attributes inherited from chai3d::cGenericObject
static cColorf s_boundaryBoxColor
 
- Protected Member Functions inherited from chai3d::cMesh
virtual void render (cRenderOptions &a_options)
 
virtual void renderNormals (cRenderOptions &a_options)
 
virtual void renderTangents (cRenderOptions &a_options)
 
virtual void renderEdges (cRenderOptions &a_options)
 
virtual void renderMesh (cRenderOptions &a_options)
 
virtual void updateGlobalPositions (const bool a_frameOnly)
 
virtual void updateBoundaryBox ()
 
void copyMeshProperties (cMesh *a_obj, const bool a_duplicateMaterialData, const bool a_duplicateTextureData, const bool a_duplicateMeshData, const bool a_buildCollisionDetector)
 
virtual void scaleObject (const double &a_scaleFactor)
 
void computeLocalInteraction (const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN)
 
- Protected Member Functions inherited from chai3d::cGenericObject
virtual cVector3d computeOtherInteractions (const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN, cInteractionRecorder &a_interactions)
 
virtual bool computeOtherCollisionDetection (cVector3d &a_segmentPointA, cVector3d &a_segmentPointB, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings)
 
void copyGenericObjectProperties (cGenericObject *a_objDest, const bool a_duplicateMaterialData, const bool a_duplicateTextureData, const bool a_duplicateMeshData, const bool a_buildCollisionDetector)
 
- Protected Member Functions inherited from chai3d::cBulletGenericObject
virtual void initialize (cBulletWorld *a_world)
 This method initializes the Bullet object. More...
 
- Static Protected Attributes inherited from chai3d::cGenericObject
static cMaterialPtr s_defaultMaterial
 

Detailed Description

cBulletBox models a dynamic box.

Constructor & Destructor Documentation

chai3d::cBulletBox::cBulletBox ( cBulletWorld *  a_world,
const double &  a_sizeX,
const double &  a_sizeY,
const double &  a_sizeZ 
)

Constructor of cBulletBox.

Parameters
a_worldBullet world to which object belongs.
a_sizeXSize of box along X axis.
a_sizeYSize of box along Y axis.
a_sizeZSize of box along Z axis.
virtual chai3d::cBulletBox::~cBulletBox ( )
inlinevirtual

Member Function Documentation

double chai3d::cBulletBox::getSizeX ( ) const
inline
double chai3d::cBulletBox::getSizeY ( ) const
inline
double chai3d::cBulletBox::getSizeZ ( ) const
inline

Member Data Documentation

double chai3d::cBulletBox::m_sizeX
protected
double chai3d::cBulletBox::m_sizeY
protected
double chai3d::cBulletBox::m_sizeZ
protected

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