diff options
Diffstat (limited to 'extern/bullet2/src/BulletCollision/Gimpact/btGImpactShape.h')
-rw-r--r-- | extern/bullet2/src/BulletCollision/Gimpact/btGImpactShape.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/extern/bullet2/src/BulletCollision/Gimpact/btGImpactShape.h b/extern/bullet2/src/BulletCollision/Gimpact/btGImpactShape.h index 90015bb9ac0..3d1f48d4776 100644 --- a/extern/bullet2/src/BulletCollision/Gimpact/btGImpactShape.h +++ b/extern/bullet2/src/BulletCollision/Gimpact/btGImpactShape.h @@ -51,6 +51,7 @@ enum eGIMPACT_SHAPE_TYPE }; + //! Helper class for tetrahedrons class btTetrahedronShapeEx:public btBU_Simplex1to4 { @@ -192,7 +193,7 @@ public: virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const = 0 ; //! gets boxset - SIMD_FORCE_INLINE btGImpactBoxSet * getBoxSet() + SIMD_FORCE_INLINE const btGImpactBoxSet * getBoxSet() const { return &m_box_set; } @@ -288,6 +289,15 @@ public: (void) callback; (void) aabbMin; (void) aabbMax; } + //! Function for retrieve triangles. + /*! + It gives the triangles in local space + */ + virtual void processAllTrianglesRay(btTriangleCallback* /*callback*/,const btVector3& /*rayFrom*/, const btVector3& /*rayTo*/) const + { + + } + //!@} }; @@ -635,25 +645,25 @@ public: return (int )numverts; } - SIMD_FORCE_INLINE void get_indices(int face_index,int &i0,int &i1,int &i2) const + SIMD_FORCE_INLINE void get_indices(int face_index,unsigned int &i0,unsigned int &i1,unsigned int &i2) const { if(indicestype == PHY_SHORT) { - short * s_indices = (short *)(indexbase + face_index*indexstride); + unsigned short* s_indices = (unsigned short *)(indexbase + face_index * indexstride); i0 = s_indices[0]; i1 = s_indices[1]; i2 = s_indices[2]; } else { - int * i_indices = (int *)(indexbase + face_index*indexstride); + unsigned int * i_indices = (unsigned int *)(indexbase + face_index*indexstride); i0 = i_indices[0]; i1 = i_indices[1]; i2 = i_indices[2]; } } - SIMD_FORCE_INLINE void get_vertex(int vertex_index, btVector3 & vertex) const + SIMD_FORCE_INLINE void get_vertex(unsigned int vertex_index, btVector3 & vertex) const { if(type == PHY_DOUBLE) { @@ -682,7 +692,7 @@ public: virtual void get_primitive_triangle(int prim_index,btPrimitiveTriangle & triangle) const { - int indices[3]; + unsigned int indices[3]; get_indices(prim_index,indices[0],indices[1],indices[2]); get_vertex(indices[0],triangle.m_vertices[0]); get_vertex(indices[1],triangle.m_vertices[1]); @@ -692,7 +702,7 @@ public: SIMD_FORCE_INLINE void get_bullet_triangle(int prim_index,btTriangleShapeEx & triangle) const { - int indices[3]; + unsigned int indices[3]; get_indices(prim_index,indices[0],indices[1],indices[2]); get_vertex(indices[0],triangle.m_vertices1[0]); get_vertex(indices[1],triangle.m_vertices1[1]); @@ -885,6 +895,7 @@ public: } virtual void processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const; + virtual void processAllTrianglesRay(btTriangleCallback* callback,const btVector3& rayFrom,const btVector3& rayTo) const; }; @@ -1141,6 +1152,8 @@ public: */ virtual void processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const; + virtual void processAllTrianglesRay (btTriangleCallback* callback,const btVector3& rayFrom,const btVector3& rayTo) const; + virtual int calculateSerializeBufferSize() const; ///fills the dataBuffer and returns the struct name (and 0 on failure) |