26 #define CALC_EXACT_INERTIA 1
32 #ifdef CALC_EXACT_INERTIA
41 m_childShapes[i]->calculateLocalInertia(shapemass,temp_inertia);
65 inertia = scaledmass * (
btVector3(y2+z2,x2+z2,x2+y2));
78 #ifdef CALC_EXACT_INERTIA
89 inertia+=pointintertia;
104 inertia = scaledmass * (
btVector3(y2+z2,x2+z2,x2+y2));
114 #ifdef CALC_EXACT_INERTIA
124 inertia+=partinertia;
139 inertia = scaledmass * (
btVector3(y2+z2,x2+z2,x2+y2));
157 if(collided.
size()==0)
165 int i = collided.
size();
184 if(collided.
size()==0)
192 int i = collided.
size();
207 m_mesh_parts[i]->processAllTriangles(callback,aabbMin,aabbMax);
216 m_mesh_parts[i]->processAllTrianglesRay(callback, rayFrom, rayTo);
236 return "btGImpactMeshShapeData";
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
void getVertex(int vertex_index, btVector3 &vertex) const
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)=0
btScalar m_collisionMargin
RayResultCallback is used to report new raycast results.
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
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
btGImpactBoxSet m_box_set
virtual bool childrenHasTransform() const
if true, then its children must get transforms.
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const
Subshape member functions.
btGImpactMeshShapePart * getMeshPart(int index)
btAlignedObjectArray< btTransform > m_childTransforms
int size() const
return the number of elements in the array
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
virtual void processAllTrianglesRay(btTriangleCallback *callback, const btVector3 &rayFrom, const btVector3 &rayTo) const
Function for retrieve triangles.
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
Function for retrieve triangles.
btVector3 gim_inertia_add_transformed(const btVector3 &source_inertia, const btVector3 &added_inertia, const btTransform &transform)
virtual void lockChildShapes() const
call when reading child shapes
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
Function for retrieve triangles.
btStridingMeshInterfaceData m_meshInterface
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
void serializeFloat(struct btVector3FloatData &dataOut) const
btCollisionShapeData m_collisionShapeData
btVector3 can be used to represent 3D points and vectors.
virtual void lockChildShapes() const
call when reading child shapes
virtual void unlockChildShapes() const
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
btStridingMeshInterface * m_meshInterface
btVector3 gim_get_point_inertia(const btVector3 &point, btScalar mass)
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
Calculates the exact inertia tensor for this shape.
bool boxQuery(const btAABB &box, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
void getPrimitiveTriangle(int index, btPrimitiveTriangle &triangle) const
if this trimesh
btAlignedObjectArray< btGImpactMeshShapePart * > m_mesh_parts
btVector3FloatData m_localScaling
int getMeshPartCount() const
btAlignedObjectArray< btCollisionShape * > m_childShapes
virtual int getNumChildShapes() const
Gets the number of children.
virtual void processAllTrianglesRay(btTriangleCallback *callback, const btVector3 &rayFrom, const btVector3 &rayTo) const
Function for retrieve triangles.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
int getVertexCount() const