22 #ifndef __AFX_BROADPHASE__INCLUDED__ 23 #define __AFX_BROADPHASE__INCLUDED__ 26 #include "dgContact.h" 27 #include "hpl1/engine/libraries/newton/core/dg.h" 32 #define DG_OCTREE_MAX_DEPTH 7 34 typedef void(dgApi *OnBodiesInAABB)(
dgBody *body,
void *
const userData);
35 typedef void(dgApi *OnLeavingWorldAction)(
dgBody *body, dgInt32 threadIndex);
54 void Add(
dgBody *
const body);
55 void Remove(
dgBody *
const body);
57 void InvalidateCache();
59 dgFloat32 RayCast(dgFloat32 minT,
const dgLineBox &line, OnRayCastAction filter, OnRayPrecastAction prefilter,
void *
const userData)
const;
73 void Add(
dgBody *
const body);
74 void Remove(
dgBody *
const body);
77 void UpdateAutoPair(
dgWorld *
const world, dgInt32 threadIndex);
98 void Init(
dgWorld *
const world, dgFloat32 cellSize, dgInt32 layerIndex);
100 inline dgUnsigned32 GetKey(dgInt32 x, dgInt32 z)
const {
101 dgUnsigned32 key = dgUnsigned32((z << DG_OCTREE_MAX_DEPTH) + x);
105 inline void KeyToIndex(dgInt32 key, dgInt32 &x, dgInt32 &z)
const {
106 x = key & ((1 << DG_OCTREE_MAX_DEPTH) - 1);
107 z = key >> DG_OCTREE_MAX_DEPTH;
112 return node ? &node->GetInfo() : NULL;
117 dgFloat32 m_cellSize;
118 dgFloat32 m_invCellSize;
119 dgInt16 m_layerIndex;
126 virtual void ThreadExecute();
130 dgInt32 m_skipForceUpdate;
131 dgFloat32 m_timeStep;
138 virtual void ThreadExecute();
148 void Realloc(dgInt32 jointsCount, dgInt32 contactCount, dgInt32 threadIndex);
149 virtual void ThreadExecute();
154 dgFloat32 m_timestep;
160 virtual void ThreadExecute();
165 dgFloat32 m_timestep;
174 void RayCast(
const dgVector &p0,
const dgVector &p1, OnRayCastAction filter, OnRayPrecastAction prefilter,
void *
const userData);
176 void ForEachBodyInAABB(
const dgVector &q0,
const dgVector &q1, OnBodiesInAABB callback,
void *
const userData)
const;
183 void Add(
dgBody *
const body);
184 void Remove(
dgBody *
const body);
185 void InvalidateCache();
187 dgUnsigned32 UpdateContactsBroadPhaseBegin(dgFloat32 tiemstep,
bool collisioUpdate, dgUnsigned32 ticks);
188 void UpdateContactsBroadPhaseEnd(dgFloat32 tiemstep);
190 void UpdateContacts(dgFloat32 tiemstep,
bool collisioUpdate);
191 void UpdateContactsSimd(dgFloat32 tiemstep,
bool collisioUpdate);
193 void UpdateBodyBroadphase(
dgBody *
const body, dgInt32 threadIndex);
196 void UpdatePairs(
dgBody *
const body0, dgSortArray::dgListNode *
const listNode, dgInt32 axisX, dgInt32 threadIndex);
213 dgFloat32 m_worlSize;
Definition: dgBroadPhaseCollision.h:170
Definition: dgVector.h:86
Definition: dgBroadPhaseCollision.h:66
Definition: dgBroadPhaseCollision.h:136
Definition: dgThreads.h:28
Definition: dgBroadPhaseCollision.h:158
Definition: dgBroadPhaseCollision.h:49
Definition: dgBroadPhaseCollision.h:37
Definition: dgCollision.h:178
Definition: dgBroadPhaseCollision.h:92
Definition: dgMatrix.h:41
Definition: dgMemory.h:80
Definition: dgBroadPhaseCollision.h:124
Definition: dgWorld.h:118
Definition: dgBroadPhaseCollision.h:43
Definition: dgContact.h:53