1 /*! \file btGImpactShape.h
2 \author Francisco Le
\7fn Nßjera
5 This source file is part of GIMPACT Library.
7 For the latest info, see http://gimpact.sourceforge.net/
9 Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
10 email: projectileman@yahoo.com
13 This software is provided 'as-is', without any express or implied warranty.
14 In no event will the authors be held liable for any damages arising from the use of this software.
15 Permission is granted to anyone to use this software for any purpose,
16 including commercial applications, and to alter it and redistribute it freely,
17 subject to the following restrictions:
19 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
20 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
21 3. This notice may not be removed or altered from any source distribution.
24 #ifndef GIMPACT_SHAPE_H
25 #define GIMPACT_SHAPE_H
27 #include "BulletCollision/CollisionShapes/btCollisionShape.h"
28 #include "BulletCollision/CollisionShapes/btTriangleShape.h"
29 #include "BulletCollision/CollisionShapes/btStridingMeshInterface.h"
30 #include "BulletCollision/CollisionShapes/btCollisionMargin.h"
31 #include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
32 #include "BulletCollision/CollisionShapes/btConcaveShape.h"
33 #include "BulletCollision/CollisionShapes/btTetrahedronShape.h"
34 #include "LinearMath/btVector3.h"
35 #include "LinearMath/btTransform.h"
36 #include "LinearMath/btMatrix3x3.h"
37 #include "LinearMath/btAlignedObjectArray.h"
39 #include "btGImpactQuantizedBvh.h" // box tree class
41 //! declare Quantized trees, (you can change to float based trees)
42 typedef btGImpactQuantizedBvh btGImpactBoxSet;
44 enum eGIMPACT_SHAPE_TYPE
46 CONST_GIMPACT_COMPOUND_SHAPE = 0,
47 CONST_GIMPACT_TRIMESH_SHAPE_PART,
48 CONST_GIMPACT_TRIMESH_SHAPE
51 //! Helper class for tetrahedrons
52 class btTetrahedronShapeEx : public btBU_Simplex1to4
55 btTetrahedronShapeEx()
60 SIMD_FORCE_INLINE void setVertices(
61 const btVector3& v0, const btVector3& v1,
62 const btVector3& v2, const btVector3& v3)
72 //! Base class for gimpact shapes
73 class btGImpactShapeInterface : public btConcaveShape
78 btVector3 localScaling;
79 btGImpactBoxSet m_box_set; // optionally boxset
81 //! use this function for perfofm refit in bounding boxes
82 //! use this function for perfofm refit in bounding boxes
83 virtual void calcLocalAABB()
86 if (m_box_set.getNodeCount() == 0)
96 m_localAABB = m_box_set.getGlobalBox();
100 btGImpactShapeInterface()
102 m_shapeType = GIMPACT_SHAPE_PROXYTYPE;
103 m_localAABB.invalidate();
104 m_needs_update = true;
105 localScaling.setValue(1.f, 1.f, 1.f);
108 //! performs refit operation
110 Updates the entire Box set of this shape.
111 \pre postUpdate() must be called for attemps to calculating the box set, else this function
113 \post if m_needs_update == true, then it calls calcLocalAABB();
115 SIMD_FORCE_INLINE void updateBound()
117 if (!m_needs_update) return;
119 m_needs_update = false;
122 //! If the Bounding box is not updated, then this class attemps to calculate it.
124 \post Calls updateBound() for update the box set.
126 void getAabb(const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const
128 btAABB transformedbox = m_localAABB;
129 transformedbox.appy_transform(t);
130 aabbMin = transformedbox.m_min;
131 aabbMax = transformedbox.m_max;
134 //! Tells to this object that is needed to refit the box set
135 virtual void postUpdate()
137 m_needs_update = true;
140 //! Obtains the local box, which is the global calculated box of the total of subshapes
141 SIMD_FORCE_INLINE const btAABB& getLocalBox()
146 virtual int getShapeType() const
148 return GIMPACT_SHAPE_PROXYTYPE;
152 \post You must call updateBound() for update the box set.
154 virtual void setLocalScaling(const btVector3& scaling)
156 localScaling = scaling;
160 virtual const btVector3& getLocalScaling() const
165 virtual void setMargin(btScalar margin)
167 m_collisionMargin = margin;
168 int i = getNumChildShapes();
171 btCollisionShape* child = getChildShape(i);
172 child->setMargin(margin);
175 m_needs_update = true;
178 //! Subshape member functions
181 //! Base method for determinig which kind of GIMPACT shape we get
182 virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const = 0;
185 SIMD_FORCE_INLINE const btGImpactBoxSet* getBoxSet() const
190 //! Determines if this class has a hierarchy structure for sorting its primitives
191 SIMD_FORCE_INLINE bool hasBoxSet() const
193 if (m_box_set.getNodeCount() == 0) return false;
197 //! Obtains the primitive manager
198 virtual const btPrimitiveManagerBase* getPrimitiveManager() const = 0;
200 //! Gets the number of children
201 virtual int getNumChildShapes() const = 0;
203 //! if true, then its children must get transforms.
204 virtual bool childrenHasTransform() const = 0;
206 //! Determines if this shape has triangles
207 virtual bool needsRetrieveTriangles() const = 0;
209 //! Determines if this shape has tetrahedrons
210 virtual bool needsRetrieveTetrahedrons() const = 0;
212 virtual void getBulletTriangle(int prim_index, btTriangleShapeEx& triangle) const = 0;
214 virtual void getBulletTetrahedron(int prim_index, btTetrahedronShapeEx& tetrahedron) const = 0;
216 //! call when reading child shapes
217 virtual void lockChildShapes() const
221 virtual void unlockChildShapes() const
226 SIMD_FORCE_INLINE void getPrimitiveTriangle(int index, btPrimitiveTriangle& triangle) const
228 getPrimitiveManager()->get_primitive_triangle(index, triangle);
231 //! Retrieves the bound from a child
234 virtual void getChildAabb(int child_index, const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const
237 getPrimitiveManager()->get_primitive_box(child_index, child_aabb);
238 child_aabb.appy_transform(t);
239 aabbMin = child_aabb.m_min;
240 aabbMax = child_aabb.m_max;
243 //! Gets the children
244 virtual btCollisionShape* getChildShape(int index) = 0;
247 virtual const btCollisionShape* getChildShape(int index) const = 0;
249 //! Gets the children transform
250 virtual btTransform getChildTransform(int index) const = 0;
252 //! Sets the children transform
254 \post You must call updateBound() for update the box set.
256 virtual void setChildTransform(int index, const btTransform& transform) = 0;
260 //! virtual method for ray collision
261 virtual void rayTest(const btVector3& rayFrom, const btVector3& rayTo, btCollisionWorld::RayResultCallback& resultCallback) const
265 (void)resultCallback;
268 //! Function for retrieve triangles.
270 It gives the triangles in local space
272 virtual void processAllTriangles(btTriangleCallback* callback, const btVector3& aabbMin, const btVector3& aabbMax) const
279 //! Function for retrieve triangles.
281 It gives the triangles in local space
283 virtual void processAllTrianglesRay(btTriangleCallback* /*callback*/, const btVector3& /*rayFrom*/, const btVector3& /*rayTo*/) const
290 //! btGImpactCompoundShape allows to handle multiple btCollisionShape objects at once
292 This class only can manage Convex subshapes
294 class btGImpactCompoundShape : public btGImpactShapeInterface
297 //! compound primitive manager
298 class CompoundPrimitiveManager : public btPrimitiveManagerBase
301 virtual ~CompoundPrimitiveManager() {}
302 btGImpactCompoundShape* m_compoundShape;
304 CompoundPrimitiveManager(const CompoundPrimitiveManager& compound)
305 : btPrimitiveManagerBase()
307 m_compoundShape = compound.m_compoundShape;
310 CompoundPrimitiveManager(btGImpactCompoundShape* compoundShape)
312 m_compoundShape = compoundShape;
315 CompoundPrimitiveManager()
317 m_compoundShape = NULL;
320 virtual bool is_trimesh() const
325 virtual int get_primitive_count() const
327 return (int)m_compoundShape->getNumChildShapes();
330 virtual void get_primitive_box(int prim_index, btAABB& primbox) const
332 btTransform prim_trans;
333 if (m_compoundShape->childrenHasTransform())
335 prim_trans = m_compoundShape->getChildTransform(prim_index);
339 prim_trans.setIdentity();
341 const btCollisionShape* shape = m_compoundShape->getChildShape(prim_index);
342 shape->getAabb(prim_trans, primbox.m_min, primbox.m_max);
345 virtual void get_primitive_triangle(int prim_index, btPrimitiveTriangle& triangle) const
354 CompoundPrimitiveManager m_primitive_manager;
355 btAlignedObjectArray<btTransform> m_childTransforms;
356 btAlignedObjectArray<btCollisionShape*> m_childShapes;
359 btGImpactCompoundShape(bool children_has_transform = true)
361 (void)children_has_transform;
362 m_primitive_manager.m_compoundShape = this;
363 m_box_set.setPrimitiveManager(&m_primitive_manager);
366 virtual ~btGImpactCompoundShape()
370 //! if true, then its children must get transforms.
371 virtual bool childrenHasTransform() const
373 if (m_childTransforms.size() == 0) return false;
377 //! Obtains the primitive manager
378 virtual const btPrimitiveManagerBase* getPrimitiveManager() const
380 return &m_primitive_manager;
383 //! Obtains the compopund primitive manager
384 SIMD_FORCE_INLINE CompoundPrimitiveManager* getCompoundPrimitiveManager()
386 return &m_primitive_manager;
389 //! Gets the number of children
390 virtual int getNumChildShapes() const
392 return m_childShapes.size();
395 //! Use this method for adding children. Only Convex shapes are allowed.
396 void addChildShape(const btTransform& localTransform, btCollisionShape* shape)
398 btAssert(shape->isConvex());
399 m_childTransforms.push_back(localTransform);
400 m_childShapes.push_back(shape);
403 //! Use this method for adding children. Only Convex shapes are allowed.
404 void addChildShape(btCollisionShape* shape)
406 btAssert(shape->isConvex());
407 m_childShapes.push_back(shape);
410 //! Gets the children
411 virtual btCollisionShape* getChildShape(int index)
413 return m_childShapes[index];
416 //! Gets the children
417 virtual const btCollisionShape* getChildShape(int index) const
419 return m_childShapes[index];
422 //! Retrieves the bound from a child
425 virtual void getChildAabb(int child_index, const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const
427 if (childrenHasTransform())
429 m_childShapes[child_index]->getAabb(t * m_childTransforms[child_index], aabbMin, aabbMax);
433 m_childShapes[child_index]->getAabb(t, aabbMin, aabbMax);
437 //! Gets the children transform
438 virtual btTransform getChildTransform(int index) const
440 btAssert(m_childTransforms.size() == m_childShapes.size());
441 return m_childTransforms[index];
444 //! Sets the children transform
446 \post You must call updateBound() for update the box set.
448 virtual void setChildTransform(int index, const btTransform& transform)
450 btAssert(m_childTransforms.size() == m_childShapes.size());
451 m_childTransforms[index] = transform;
455 //! Determines if this shape has triangles
456 virtual bool needsRetrieveTriangles() const
461 //! Determines if this shape has tetrahedrons
462 virtual bool needsRetrieveTetrahedrons() const
467 virtual void getBulletTriangle(int prim_index, btTriangleShapeEx& triangle) const
474 virtual void getBulletTetrahedron(int prim_index, btTetrahedronShapeEx& tetrahedron) const
481 //! Calculates the exact inertia tensor for this shape
482 virtual void calculateLocalInertia(btScalar mass, btVector3& inertia) const;
484 virtual const char* getName() const
486 return "GImpactCompound";
489 virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const
491 return CONST_GIMPACT_COMPOUND_SHAPE;
495 //! This class manages a sub part of a mesh supplied by the btStridingMeshInterface interface.
497 - Simply create this shape by passing the btStridingMeshInterface to the constructor btGImpactMeshShapePart, then you must call updateBound() after creating the mesh
498 - When making operations with this shape, you must call <b>lock</b> before accessing to the trimesh primitives, and then call <b>unlock</b>
499 - You can handle deformable meshes with this shape, by calling postUpdate() every time when changing the mesh vertices.
502 class btGImpactMeshShapePart : public btGImpactShapeInterface
505 //! Trimesh primitive manager
507 Manages the info from btStridingMeshInterface object and controls the Lock/Unlock mechanism
509 class TrimeshPrimitiveManager : public btPrimitiveManagerBase
513 btStridingMeshInterface* m_meshInterface;
517 const unsigned char* vertexbase;
521 const unsigned char* indexbase;
524 PHY_ScalarType indicestype;
526 TrimeshPrimitiveManager()
528 m_meshInterface = NULL;
531 m_scale = btVector3(1.f, 1.f, 1.f);
541 TrimeshPrimitiveManager(const TrimeshPrimitiveManager& manager)
542 : btPrimitiveManagerBase()
544 m_meshInterface = manager.m_meshInterface;
545 m_part = manager.m_part;
546 m_margin = manager.m_margin;
547 m_scale = manager.m_scale;
557 TrimeshPrimitiveManager(
558 btStridingMeshInterface* meshInterface, int part)
560 m_meshInterface = meshInterface;
562 m_scale = m_meshInterface->getScaling();
573 virtual ~TrimeshPrimitiveManager() {}
577 if (m_lock_count > 0)
582 m_meshInterface->getLockedReadOnlyVertexIndexBase(
583 &vertexbase, numverts,
584 type, stride, &indexbase, indexstride, numfaces, indicestype, m_part);
591 if (m_lock_count == 0) return;
592 if (m_lock_count > 1)
597 m_meshInterface->unLockReadOnlyVertexBase(m_part);
602 virtual bool is_trimesh() const
607 virtual int get_primitive_count() const
609 return (int)numfaces;
612 SIMD_FORCE_INLINE int get_vertex_count() const
614 return (int)numverts;
617 SIMD_FORCE_INLINE void get_indices(int face_index, unsigned int& i0, unsigned int& i1, unsigned int& i2) const
619 if (indicestype == PHY_SHORT)
621 unsigned short* s_indices = (unsigned short*)(indexbase + face_index * indexstride);
626 else if (indicestype == PHY_INTEGER)
628 unsigned int* i_indices = (unsigned int*)(indexbase + face_index * indexstride);
635 btAssert(indicestype == PHY_UCHAR);
636 unsigned char* i_indices = (unsigned char*)(indexbase + face_index * indexstride);
643 SIMD_FORCE_INLINE void get_vertex(unsigned int vertex_index, btVector3& vertex) const
645 if (type == PHY_DOUBLE)
647 double* dvertices = (double*)(vertexbase + vertex_index * stride);
648 vertex[0] = btScalar(dvertices[0] * m_scale[0]);
649 vertex[1] = btScalar(dvertices[1] * m_scale[1]);
650 vertex[2] = btScalar(dvertices[2] * m_scale[2]);
654 float* svertices = (float*)(vertexbase + vertex_index * stride);
655 vertex[0] = svertices[0] * m_scale[0];
656 vertex[1] = svertices[1] * m_scale[1];
657 vertex[2] = svertices[2] * m_scale[2];
661 virtual void get_primitive_box(int prim_index, btAABB& primbox) const
663 btPrimitiveTriangle triangle;
664 get_primitive_triangle(prim_index, triangle);
665 primbox.calc_from_triangle_margin(
666 triangle.m_vertices[0],
667 triangle.m_vertices[1], triangle.m_vertices[2], triangle.m_margin);
670 virtual void get_primitive_triangle(int prim_index, btPrimitiveTriangle& triangle) const
672 unsigned int indices[3];
673 get_indices(prim_index, indices[0], indices[1], indices[2]);
674 get_vertex(indices[0], triangle.m_vertices[0]);
675 get_vertex(indices[1], triangle.m_vertices[1]);
676 get_vertex(indices[2], triangle.m_vertices[2]);
677 triangle.m_margin = m_margin;
680 SIMD_FORCE_INLINE void get_bullet_triangle(int prim_index, btTriangleShapeEx& triangle) const
682 unsigned int indices[3];
683 get_indices(prim_index, indices[0], indices[1], indices[2]);
684 get_vertex(indices[0], triangle.m_vertices1[0]);
685 get_vertex(indices[1], triangle.m_vertices1[1]);
686 get_vertex(indices[2], triangle.m_vertices1[2]);
687 triangle.setMargin(m_margin);
692 TrimeshPrimitiveManager m_primitive_manager;
695 btGImpactMeshShapePart()
697 m_box_set.setPrimitiveManager(&m_primitive_manager);
700 btGImpactMeshShapePart(btStridingMeshInterface* meshInterface, int part);
701 virtual ~btGImpactMeshShapePart();
703 //! if true, then its children must get transforms.
704 virtual bool childrenHasTransform() const
709 //! call when reading child shapes
710 virtual void lockChildShapes() const;
711 virtual void unlockChildShapes() const;
713 //! Gets the number of children
714 virtual int getNumChildShapes() const
716 return m_primitive_manager.get_primitive_count();
719 //! Gets the children
720 virtual btCollisionShape* getChildShape(int index)
728 virtual const btCollisionShape* getChildShape(int index) const
735 //! Gets the children transform
736 virtual btTransform getChildTransform(int index) const
740 return btTransform();
743 //! Sets the children transform
745 \post You must call updateBound() for update the box set.
747 virtual void setChildTransform(int index, const btTransform& transform)
754 //! Obtains the primitive manager
755 virtual const btPrimitiveManagerBase* getPrimitiveManager() const
757 return &m_primitive_manager;
760 SIMD_FORCE_INLINE TrimeshPrimitiveManager* getTrimeshPrimitiveManager()
762 return &m_primitive_manager;
765 virtual void calculateLocalInertia(btScalar mass, btVector3& inertia) const;
767 virtual const char* getName() const
769 return "GImpactMeshShapePart";
772 virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const
774 return CONST_GIMPACT_TRIMESH_SHAPE_PART;
777 //! Determines if this shape has triangles
778 virtual bool needsRetrieveTriangles() const
783 //! Determines if this shape has tetrahedrons
784 virtual bool needsRetrieveTetrahedrons() const
789 virtual void getBulletTriangle(int prim_index, btTriangleShapeEx& triangle) const
791 m_primitive_manager.get_bullet_triangle(prim_index, triangle);
794 virtual void getBulletTetrahedron(int prim_index, btTetrahedronShapeEx& tetrahedron) const
801 SIMD_FORCE_INLINE int getVertexCount() const
803 return m_primitive_manager.get_vertex_count();
806 SIMD_FORCE_INLINE void getVertex(int vertex_index, btVector3& vertex) const
808 m_primitive_manager.get_vertex(vertex_index, vertex);
811 SIMD_FORCE_INLINE void setMargin(btScalar margin)
813 m_primitive_manager.m_margin = margin;
817 SIMD_FORCE_INLINE btScalar getMargin() const
819 return m_primitive_manager.m_margin;
822 virtual void setLocalScaling(const btVector3& scaling)
824 m_primitive_manager.m_scale = scaling;
828 virtual const btVector3& getLocalScaling() const
830 return m_primitive_manager.m_scale;
833 SIMD_FORCE_INLINE int getPart() const
835 return (int)m_primitive_manager.m_part;
838 virtual void processAllTriangles(btTriangleCallback* callback, const btVector3& aabbMin, const btVector3& aabbMax) const;
839 virtual void processAllTrianglesRay(btTriangleCallback* callback, const btVector3& rayFrom, const btVector3& rayTo) const;
842 //! This class manages a mesh supplied by the btStridingMeshInterface interface.
844 Set of btGImpactMeshShapePart parts
845 - Simply create this shape by passing the btStridingMeshInterface to the constructor btGImpactMeshShape, then you must call updateBound() after creating the mesh
847 - You can handle deformable meshes with this shape, by calling postUpdate() every time when changing the mesh vertices.
850 class btGImpactMeshShape : public btGImpactShapeInterface
852 btStridingMeshInterface* m_meshInterface;
855 btAlignedObjectArray<btGImpactMeshShapePart*> m_mesh_parts;
856 void buildMeshParts(btStridingMeshInterface* meshInterface)
858 for (int i = 0; i < meshInterface->getNumSubParts(); ++i)
860 btGImpactMeshShapePart* newpart = new btGImpactMeshShapePart(meshInterface, i);
861 m_mesh_parts.push_back(newpart);
865 //! use this function for perfofm refit in bounding boxes
866 virtual void calcLocalAABB()
868 m_localAABB.invalidate();
869 int i = m_mesh_parts.size();
872 m_mesh_parts[i]->updateBound();
873 m_localAABB.merge(m_mesh_parts[i]->getLocalBox());
878 btGImpactMeshShape(btStridingMeshInterface* meshInterface)
880 m_meshInterface = meshInterface;
881 buildMeshParts(meshInterface);
884 virtual ~btGImpactMeshShape()
886 int i = m_mesh_parts.size();
889 btGImpactMeshShapePart* part = m_mesh_parts[i];
892 m_mesh_parts.clear();
895 btStridingMeshInterface* getMeshInterface()
897 return m_meshInterface;
900 const btStridingMeshInterface* getMeshInterface() const
902 return m_meshInterface;
905 int getMeshPartCount() const
907 return m_mesh_parts.size();
910 btGImpactMeshShapePart* getMeshPart(int index)
912 return m_mesh_parts[index];
915 const btGImpactMeshShapePart* getMeshPart(int index) const
917 return m_mesh_parts[index];
920 virtual void setLocalScaling(const btVector3& scaling)
922 localScaling = scaling;
924 int i = m_mesh_parts.size();
927 btGImpactMeshShapePart* part = m_mesh_parts[i];
928 part->setLocalScaling(scaling);
931 m_needs_update = true;
934 virtual void setMargin(btScalar margin)
936 m_collisionMargin = margin;
938 int i = m_mesh_parts.size();
941 btGImpactMeshShapePart* part = m_mesh_parts[i];
942 part->setMargin(margin);
945 m_needs_update = true;
948 //! Tells to this object that is needed to refit all the meshes
949 virtual void postUpdate()
951 int i = m_mesh_parts.size();
954 btGImpactMeshShapePart* part = m_mesh_parts[i];
958 m_needs_update = true;
961 virtual void calculateLocalInertia(btScalar mass, btVector3& inertia) const;
963 //! Obtains the primitive manager
964 virtual const btPrimitiveManagerBase* getPrimitiveManager() const
970 //! Gets the number of children
971 virtual int getNumChildShapes() const
977 //! if true, then its children must get transforms.
978 virtual bool childrenHasTransform() const
984 //! Determines if this shape has triangles
985 virtual bool needsRetrieveTriangles() const
991 //! Determines if this shape has tetrahedrons
992 virtual bool needsRetrieveTetrahedrons() const
998 virtual void getBulletTriangle(int prim_index, btTriangleShapeEx& triangle) const
1005 virtual void getBulletTetrahedron(int prim_index, btTetrahedronShapeEx& tetrahedron) const
1012 //! call when reading child shapes
1013 virtual void lockChildShapes() const
1018 virtual void unlockChildShapes() const
1023 //! Retrieves the bound from a child
1026 virtual void getChildAabb(int child_index, const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const
1035 //! Gets the children
1036 virtual btCollisionShape* getChildShape(int index)
1044 virtual const btCollisionShape* getChildShape(int index) const
1051 //! Gets the children transform
1052 virtual btTransform getChildTransform(int index) const
1056 return btTransform();
1059 //! Sets the children transform
1061 \post You must call updateBound() for update the box set.
1063 virtual void setChildTransform(int index, const btTransform& transform)
1070 virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const
1072 return CONST_GIMPACT_TRIMESH_SHAPE;
1075 virtual const char* getName() const
1077 return "GImpactMesh";
1080 virtual void rayTest(const btVector3& rayFrom, const btVector3& rayTo, btCollisionWorld::RayResultCallback& resultCallback) const;
1082 //! Function for retrieve triangles.
1084 It gives the triangles in local space
1086 virtual void processAllTriangles(btTriangleCallback* callback, const btVector3& aabbMin, const btVector3& aabbMax) const;
1088 virtual void processAllTrianglesRay(btTriangleCallback* callback, const btVector3& rayFrom, const btVector3& rayTo) const;
1090 virtual int calculateSerializeBufferSize() const;
1092 ///fills the dataBuffer and returns the struct name (and 0 on failure)
1093 virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const;
1096 ///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
1097 struct btGImpactMeshShapeData
1099 btCollisionShapeData m_collisionShapeData;
1101 btStridingMeshInterfaceData m_meshInterface;
1103 btVector3FloatData m_localScaling;
1105 float m_collisionMargin;
1107 int m_gimpactSubType;
1110 SIMD_FORCE_INLINE int btGImpactMeshShape::calculateSerializeBufferSize() const
1112 return sizeof(btGImpactMeshShapeData);
1115 #endif //GIMPACT_MESH_SHAPE_H