22 #ifndef __ND_SHAPE_CONVEX_H__
23 #define __ND_SHAPE_CONVEX_H__
25 #include "ndCollisionStdafx.h"
28 #define D_CLIP_MAX_COUNT 512
29 #define D_CLIP_MAX_POINT_COUNT 64
30 #define D_MIN_CONVEX_SHAPE_SIZE ndFloat32 (1.0f/128.0f)
52 D_COLLISION_API
void SetVolumeAndCG();
53 D_COLLISION_API
virtual void MassProperties();
58 D_COLLISION_API
virtual ndShapeInfo GetShapeInfo()
const;
60 D_COLLISION_API
virtual ndVector SupportVertex(
const ndVector& dir, ndInt32*
const vertexIndex)
const;
61 D_COLLISION_API
virtual ndInt32 CalculatePlaneIntersection(
const ndVector& normal,
const ndVector& point,
ndVector*
const contactsOut)
const;
67 bool SanityCheck(ndInt32 count,
const ndVector& normal,
ndVector*
const contactsOut)
const;
68 ndInt32 RectifyConvexSlice(ndInt32 count,
const ndVector& normal,
ndVector*
const contactsOut)
const;
69 virtual ndInt32 GetConvexVertexCount()
const {
return m_vertexCount; }
70 virtual ndVector SupportVertexSpecial(
const ndVector& dir, ndFloat32, ndInt32*
const vertexIndex)
const
72 return SupportVertex(dir, vertexIndex);
80 virtual const ndConvexSimplexEdge** GetVertexToEdgeMapping()
const
85 virtual ndFloat32 GetVolume()
const;
86 virtual ndFloat32 GetBoxMinRadius()
const;
87 virtual ndFloat32 GetBoxMaxRadius()
const;
90 ndInt32 BuildCylinderCapPoly (ndFloat32 radius,
const ndMatrix& transform,
ndVector*
const vertexOut)
const;
93 ndConvexSimplexEdge* m_simplex;
95 ndFloat32 m_boxMinRadius;
96 ndFloat32 m_boxMaxRadius;
97 ndFloat32 m_simplexVolume;
98 ndUnsigned16 m_edgeCount;
99 ndUnsigned16 m_vertexCount;
102 } D_GCC_NEWTON_ALIGN_32 ;