22 #ifndef __DGCOLLIION_HEIGHT_FIELD__ 23 #define __DGCOLLIION_HEIGHT_FIELD__ 25 #include "dgCollision.h" 26 #include "dgCollisionMesh.h" 29 typedef dgFloat32(*dgCollisionHeightFieldRayCastCallback)(
const dgBody *
const body,
const dgCollisionHeightField *
const heightFieldCollision, dgFloat32 interception, dgInt32 row, dgInt32 col,
dgVector *
const normal,
int faceId,
void *
const usedData);
35 const dgUnsigned16 *
const elevationMap,
const dgInt8 *
const atributeMap, dgFloat32 horizontalScale, dgFloat32 vertcalScale);
41 void SetCollisionRayCastCallback(dgCollisionHeightFieldRayCastCallback rayCastCallback);
42 dgCollisionHeightFieldRayCastCallback GetDebugRayCastCallback()
const {
43 return m_userRayCastCallback;
49 void AllocateVertex(
dgWorld *
const world, dgInt32 thread)
const;
52 dgFloat32 RayCastCell(
const dgFastRayTest &ray, dgInt32 xIndex0, dgInt32 zIndex0,
dgVector &normalOut)
const;
53 dgFloat32 RayCastCellSimd(
const dgFastRayTest &ray, dgInt32 xIndex0, dgInt32 zIndex0,
dgVector &normalOut)
const;
55 virtual void Serialize(dgSerialize callback,
void *
const userData)
const;
56 virtual dgFloat32 RayCast(
const dgVector &localP0,
const dgVector &localP1,
dgContactPoint &contactOut, OnRayPrecastAction preFilter,
const dgBody *
const body,
void *
const userData)
const;
57 virtual dgFloat32 RayCastSimd(
const dgVector &localP0,
const dgVector &localP1,
dgContactPoint &contactOut, OnRayPrecastAction preFilter,
const dgBody *
const body,
void *
const userData)
const;
62 void DebugCollision(
const dgMatrix &matrixPtr, OnDebugCollisionMeshCallback callback,
void *
const userData)
const;
71 dgInt32 m_diagonalMode;
72 dgInt8 *m_atributeMap;
73 dgUnsigned16 *m_elevationMap;
74 dgFloat32 m_verticalScale;
75 dgFloat32 m_horizontalScale;
77 dgFloat32 m_horizontalScaleInv;
78 dgCollisionHeightFieldRayCastCallback m_userRayCastCallback;
83 struct dgPerIntanceData {
86 dgInt32 m_vertexCount[DG_MAXIMUN_THREADS];
87 dgVector *m_vertex[DG_MAXIMUN_THREADS];
90 dgPerIntanceData *m_instanceData;
Definition: dgIntersections.h:35
Definition: dgCollision.h:73
Definition: dgCollisionMesh.h:39
Definition: dgVector.h:86
Definition: dgCollisionMesh.h:101
Definition: dgCollisionMesh.h:90
Definition: dgCollisionHeightField.h:32
Definition: dgMatrix.h:41
Definition: dgWorld.h:118
Definition: dgCollisionCompound.h:31