Bullet Collision Detection & Physics Library: btBulletWorldImporter Class Reference

Bullet Collision Detection & Physics Library

Public Member Functions | List of all members
btBulletWorldImporter Class Reference

The btBulletWorldImporter is a starting point to import .bullet files. More...

`#include <btBulletWorldImporter.h>`

Inheritance diagram for btBulletWorldImporter:
[legend]
Collaboration diagram for btBulletWorldImporter:
[legend]

## Public Member Functions
| btBulletWorldImporter (btDynamicsWorld *world=0)
virtual | ~btBulletWorldImporter ()
bool | loadFile (const char *fileName, const char *preSwapFilenameOut=0)
| if you pass a valid preSwapFilenameOut, it will save a new file with a different endianness this pre-swapped file can be loaded without swapping on a target platform of different endianness More...
bool | loadFileFromMemory (char *memoryBuffer, int len)
| the memoryBuffer might be modified (for example if endian swaps are necessary) More...
bool | loadFileFromMemory (bParse::btBulletFile *file)
virtual bool | convertAllObjects (bParse::btBulletFile *file)
Public Member Functions inherited from btWorldImporter
| btWorldImporter (btDynamicsWorld *world)
virtual | ~btWorldImporter ()
virtual void | deleteAllData ()
| delete all memory collision shapes, rigid bodies, constraints etc. More...
void | setVerboseMode (int verboseMode)
int | getVerboseMode () const
int | getNumCollisionShapes () const
btCollisionShape * | getCollisionShapeByIndex (int index)
int | getNumRigidBodies () const
btCollisionObject * | getRigidBodyByIndex (int index) const
int | getNumConstraints () const
btTypedConstraint * | getConstraintByIndex (int index) const
int | getNumBvhs () const
btOptimizedBvh * | getBvhByIndex (int index) const
int | getNumTriangleInfoMaps () const
btTriangleInfoMap * | getTriangleInfoMapByIndex (int index) const
btCollisionShape * | getCollisionShapeByName (const char *name)
btRigidBody * | getRigidBodyByName (const char *name)
btTypedConstraint * | getConstraintByName (const char *name)
const char * | getNameForPointer (const void *ptr) const
virtual void | setDynamicsWorldInfo (const btVector3 &gravity, const btContactSolverInfo &solverInfo)
| those virtuals are called by load and can be overridden by the user More...
virtual btRigidBody * | createRigidBody (bool isDynamic, btScalar mass, const btTransform &startTransform, btCollisionShape *shape, const char *bodyName)
virtual btCollisionObject * | createCollisionObject (const btTransform &startTransform, btCollisionShape *shape, const char *bodyName)
virtual btCollisionShape * | createPlaneShape (const btVector3 &planeNormal, btScalar planeConstant)
| shapes More...
virtual btCollisionShape * | createBoxShape (const btVector3 &halfExtents)
virtual btCollisionShape * | createSphereShape (btScalar radius)
virtual btCollisionShape * | createCapsuleShapeX (btScalar radius, btScalar height)
virtual btCollisionShape * | createCapsuleShapeY (btScalar radius, btScalar height)
virtual btCollisionShape * | createCapsuleShapeZ (btScalar radius, btScalar height)
virtual btCollisionShape * | createCylinderShapeX (btScalar radius, btScalar height)
virtual btCollisionShape * | createCylinderShapeY (btScalar radius, btScalar height)
virtual btCollisionShape * | createCylinderShapeZ (btScalar radius, btScalar height)
virtual btCollisionShape * | createConeShapeX (btScalar radius, btScalar height)
virtual btCollisionShape * | createConeShapeY (btScalar radius, btScalar height)
virtual btCollisionShape * | createConeShapeZ (btScalar radius, btScalar height)
virtual class btTriangleIndexVertexArray * | createTriangleMeshContainer ()
virtual btBvhTriangleMeshShape * | createBvhTriangleMeshShape (btStridingMeshInterface *trimesh, btOptimizedBvh *bvh)
virtual btCollisionShape * | createConvexTriangleMeshShape (btStridingMeshInterface *trimesh)
virtual btGImpactMeshShape * | createGimpactShape (btStridingMeshInterface *trimesh)
virtual btStridingMeshInterfaceData * | createStridingMeshInterfaceData (btStridingMeshInterfaceData *interfaceData)
virtual class btConvexHullShape * | createConvexHullShape ()
virtual class btCompoundShape * | createCompoundShape ()
virtual class btScaledBvhTriangleMeshShape * | createScaledTrangleMeshShape (btBvhTriangleMeshShape *meshShape, const btVector3 &localScalingbtBvhTriangleMeshShape)
virtual class btMultiSphereShape * | createMultiSphereShape (const btVector3 *positions, const btScalar *radi, int numSpheres)
virtual btTriangleIndexVertexArray * | createMeshInterface (btStridingMeshInterfaceData &meshData)
virtual btOptimizedBvh * | createOptimizedBvh ()
| acceleration and connectivity structures More...
virtual btTriangleInfoMap * | createTriangleInfoMap ()
virtual btPoint2PointConstraint * | createPoint2PointConstraint (btRigidBody &rbA, btRigidBody &rbB, const btVector3 &pivotInA, const btVector3 &pivotInB)
| constraints More...
virtual btPoint2PointConstraint * | createPoint2PointConstraint (btRigidBody &rbA, const btVector3 &pivotInA)
virtual btHingeConstraint * | createHingeConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &rbAFrame, const btTransform &rbBFrame, bool useReferenceFrameA=false)
virtual btHingeConstraint * | createHingeConstraint (btRigidBody &rbA, const btTransform &rbAFrame, bool useReferenceFrameA=false)
virtual btConeTwistConstraint * | createConeTwistConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &rbAFrame, const btTransform &rbBFrame)
virtual btConeTwistConstraint * | createConeTwistConstraint (btRigidBody &rbA, const btTransform &rbAFrame)
virtual btGeneric6DofConstraint * | createGeneric6DofConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
virtual btGeneric6DofConstraint * | createGeneric6DofConstraint (btRigidBody &rbB, const btTransform &frameInB, bool useLinearReferenceFrameB)
virtual btGeneric6DofSpringConstraint * | createGeneric6DofSpringConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
virtual btGeneric6DofSpring2Constraint * | createGeneric6DofSpring2Constraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, int rotateOrder)
virtual btSliderConstraint * | createSliderConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
virtual btSliderConstraint * | createSliderConstraint (btRigidBody &rbB, const btTransform &frameInB, bool useLinearReferenceFrameA)
virtual btGearConstraint * | createGearConstraint (btRigidBody &rbA, btRigidBody &rbB, const btVector3 &axisInA, const btVector3 &axisInB, btScalar ratio)

## Additional Inherited Members
Protected Member Functions inherited from btWorldImporter
char * | duplicateName (const char *name)
btCollisionShape * | convertCollisionShape (btCollisionShapeData *shapeData)
void | convertConstraintBackwardsCompatible281 (btTypedConstraintData *constraintData, btRigidBody *rbA, btRigidBody *rbB, int fileVersion)
void | convertConstraintFloat (btTypedConstraintFloatData *constraintData, btRigidBody *rbA, btRigidBody *rbB, int fileVersion)
void | convertConstraintDouble (btTypedConstraintDoubleData *constraintData, btRigidBody *rbA, btRigidBody *rbB, int fileVersion)
void | convertRigidBodyFloat (btRigidBodyFloatData *colObjData)
void | convertRigidBodyDouble (btRigidBodyDoubleData *colObjData)
Static Protected Member Functions inherited from btWorldImporter
static btRigidBody & | getFixedBody ()
Protected Attributes inherited from btWorldImporter
btDynamicsWorld * | m_dynamicsWorld
int | m_verboseMode
btAlignedObjectArray< btCollisionShape * > | m_allocatedCollisionShapes
btAlignedObjectArray< btCollisionObject * > | m_allocatedRigidBodies
btAlignedObjectArray< btTypedConstraint * > | m_allocatedConstraints
btAlignedObjectArray< btOptimizedBvh * > | m_allocatedBvhs
btAlignedObjectArray< btTriangleInfoMap * > | m_allocatedTriangleInfoMaps
btAlignedObjectArray< btTriangleIndexVertexArray * > | m_allocatedTriangleIndexArrays
btAlignedObjectArray< btStridingMeshInterfaceData * > | m_allocatedbtStridingMeshInterfaceDatas
btAlignedObjectArray< char * > | m_allocatedNames
btAlignedObjectArray< int * > | m_indexArrays
btAlignedObjectArray< short int * > | m_shortIndexArrays
btAlignedObjectArray< unsigned char * > | m_charIndexArrays
btAlignedObjectArray< btVector3FloatData * > | m_floatVertexArrays
btAlignedObjectArray< btVector3DoubleData * > | m_doubleVertexArrays
btHashMap< btHashPtr, btOptimizedBvh * > | m_bvhMap
btHashMap< btHashPtr, btTriangleInfoMap * > | m_timMap
btHashMap< btHashString, btCollisionShape * > | m_nameShapeMap
btHashMap< btHashString, btRigidBody * > | m_nameBodyMap
btHashMap< btHashString, btTypedConstraint * > | m_nameConstraintMap
btHashMap< btHashPtr, const char * > | m_objectNameMap
btHashMap< btHashPtr, btCollisionShape * > | m_shapeMap
btHashMap< btHashPtr, btCollisionObject * > | m_bodyMap

## Detailed Description

The btBulletWorldImporter is a starting point to import .bullet files.

note that not all data is converted yet. You are expected to override or modify this class. See Bullet/Demos/SerializeDemo for a derived class that extract btSoftBody objects too.

Definition at line 40 of file btBulletWorldImporter.h.

## Constructor & Destructor Documentation

## § btBulletWorldImporter()

btBulletWorldImporter::btBulletWorldImporter | ( | btDynamicsWorld * | world = `0` | ) |

Definition at line 31 of file btBulletWorldImporter.cpp.

## § ~btBulletWorldImporter()

btBulletWorldImporter::~btBulletWorldImporter | ( |  | ) |
| virtual

Definition at line 36 of file btBulletWorldImporter.cpp.

## Member Function Documentation

## § convertAllObjects()

bool btBulletWorldImporter::convertAllObjects | ( | bParse::btBulletFile * | file | ) |
| virtual

Definition at line 98 of file btBulletWorldImporter.cpp.

## § loadFile()

bool btBulletWorldImporter::loadFile | ( | const char * | fileName,
|  | const char * | preSwapFilenameOut = `0`
| ) |  |

if you pass a valid preSwapFilenameOut, it will save a new file with a different endianness this pre-swapped file can be loaded without swapping on a target platform of different endianness

Definition at line 41 of file btBulletWorldImporter.cpp.

## § loadFileFromMemory() [1/2]

bool btBulletWorldImporter::loadFileFromMemory | ( | char * | memoryBuffer,
|  | int | len
| ) |  |

the memoryBuffer might be modified (for example if endian swaps are necessary)

Definition at line 66 of file btBulletWorldImporter.cpp.

## § loadFileFromMemory() [2/2]

bool btBulletWorldImporter::loadFileFromMemory | ( | bParse::btBulletFile * | file | ) |

Definition at line 80 of file btBulletWorldImporter.cpp.

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

- btBulletWorldImporter.h
- btBulletWorldImporter.cpp