Bullet Collision Detection & Physics Library
|
Go to the documentation of this file.
76 #define CALC_EXACT_INERTIA 1
81 #ifdef CALC_EXACT_INERTIA
90 m_childShapes[i]->calculateLocalInertia(shapemass, temp_inertia);
113 inertia = scaledmass * (
btVector3(y2 + z2, x2 + z2, x2 + y2));
123 #ifdef CALC_EXACT_INERTIA
134 inertia += pointintertia;
149 inertia = scaledmass * (
btVector3(y2 + z2, x2 + z2, x2 + y2));
158 #ifdef CALC_EXACT_INERTIA
168 inertia += partinertia;
183 inertia = scaledmass * (
btVector3(y2 + z2, x2 + z2, x2 + y2));
201 if (collided.
size() == 0)
209 int i = collided.
size();
228 if (collided.
size() == 0)
236 int i = collided.
size();
250 m_mesh_parts[i]->processAllTriangles(callback, aabbMin, aabbMax);
259 m_mesh_parts[i]->processAllTrianglesRay(callback, rayFrom, rayTo);
278 return "btGImpactMeshShapeData";
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
virtual void unlockChildShapes() const
virtual bool childrenHasTransform() const
if true, then its children must get transforms.
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
btAlignedObjectArray< btCollisionShape * > m_childShapes
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
btScalar m_collisionMargin
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
virtual void rayTest(const btVector3 &rayFrom, const btVector3 &rayTo, btCollisionWorld::RayResultCallback &resultCallback) const
virtual method for ray collision
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
Calculates the exact inertia tensor for this shape.
virtual void lockChildShapes() const
call when reading child shapes
virtual int getNumChildShapes() const
Gets the number of children.
virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const
Subshape member functions.
btStridingMeshInterface * m_meshInterface
Trimesh primitive manager.
btPrimitiveManagerBase * getPrimitiveManager() const
The btStridingMeshInterface is the interface class for high performance generic access to triangle me...
btAlignedObjectArray< btTransform > m_childTransforms
btVector3 gim_get_point_inertia(const btVector3 &point, btScalar mass)
bool boxQuery(const btAABB &box, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
int getMeshPartCount() const
btStridingMeshInterfaceData m_meshInterface
btGImpactBoxSet m_box_set
int getVertexCount() const
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
Function for retrieve triangles.
void setPrimitiveManager(btPrimitiveManagerBase *primitive_manager)
btVector3 can be used to represent 3D points and vectors.
btGImpactMeshShapePart * getMeshPart(int index)
virtual void lockChildShapes() const
call when reading child shapes
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)=0
void serializeFloat(struct btVector3FloatData &dataOut) const
virtual void processAllTrianglesRay(btTriangleCallback *callback, const btVector3 &rayFrom, const btVector3 &rayTo) const
Function for retrieve triangles.
btCollisionShapeData m_collisionShapeData
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
virtual void unlockChildShapes() const
btAlignedObjectArray< btGImpactMeshShapePart * > m_mesh_parts
btVector3FloatData m_localScaling
void getPrimitiveTriangle(int index, btPrimitiveTriangle &triangle) const
if this trimesh
bool rayQuery(const btVector3 &ray_dir, const btVector3 &ray_origin, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
void getVertex(int vertex_index, btVector3 &vertex) const
TrimeshPrimitiveManager m_primitive_manager
RayResultCallback is used to report new raycast results.
btVector3 gim_inertia_add_transformed(const btVector3 &source_inertia, const btVector3 &added_inertia, const btTransform &transform)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
Function for retrieve triangles.
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
virtual ~btGImpactMeshShapePart()
virtual void processAllTrianglesRay(btTriangleCallback *callback, const btVector3 &rayFrom, const btVector3 &rayTo) const
Function for retrieve triangles.
int size() const
return the number of elements in the array
btStridingMeshInterface * m_meshInterface