My Project: dynamics.mod/NewtonDynamics/source/physics/dgCollisionCompound.h Source File

My Project

dgCollisionCompound.h
Go to the documentation of this file.
1 /* Copyright (c) <2003-2011> <Julio Jerez, Newton Game Dynamics>
2 *
3 * This software is provided 'as-is', without any express or implied
4 * warranty. In no event will the authors be held liable for any damages
5 * arising from the use of this software.
6 *
7 * Permission is granted to anyone to use this software for any purpose,
8 * including commercial applications, and to alter it and redistribute it
9 * freely, subject to the following restrictions:
10 *
11 * 1. The origin of this software must not be misrepresented; you must not
12 * claim that you wrote the original software. If you use this software
13 * in a product, an acknowledgment in the product documentation would be
14 * appreciated but is not required.
15 *
16 * 2. Altered source versions must be plainly marked as such, and must not be
17 * misrepresented as being the original software.
18 *
19 * 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 #ifndef __DGCOLLISIONCOMPOUND_H__
23 #define __DGCOLLISIONCOMPOUND_H__
24
25
26 #include "dgCollision.h"
27
28 class dgFastRayTest;
29 class dgCollisionBVH;
30 class dgCollisionInstance;
31
32
33 #define DG_COMPOUND_STACK_DEPTH 256
34
35 class dgCollisionCompound: public dgCollision
36 {
37 protected:
38 enum dgNodeType
39 {
40 m_leaf,
41 m_node,
42 };
43
44 public:
45
46 class dgNodeBase;
47 class dgTreeArray: public dgTree<dgNodeBase*, dgInt32>
48 {
49 public:
50 dgTreeArray (dgMemoryAllocator* const allocator);
51 void AddNode (dgNodeBase* const node, dgInt32 index, const dgCollisionInstance* const parent);
52 };
53
54 DG_MSC_VECTOR_ALIGMENT
55 class dgOOBBTestData
56 {
57 public:
58 dgOOBBTestData (const dgMatrix& matrix);
59 dgOOBBTestData (const dgMatrix& matrix, const dgVector& origin, const dgVector& size);
60
61 dgMatrix m_matrix;
62 dgMatrix m_absMatrix;
63 dgVector m_origin;
64 dgVector m_size;
65 dgVector m_localP0;
66 dgVector m_localP1;
67 dgVector m_aabbP0;
68 dgVector m_aabbP1;
69
70 dgVector m_crossAxis[9];
71 dgVector m_crossAxisAbs[9];
72 dgVector m_crossAxisDotAbs[9];
73 dgVector m_extendsMinX[3];
74 dgVector m_extendsMaxX[3];
75 } DG_GCC_VECTOR_ALIGMENT;
76
77
78 DG_MSC_VECTOR_ALIGMENT
79 class dgNodeBase
80 {
81 public:
82 DG_CLASS_ALLOCATOR(allocator)
83 dgNodeBase ();
84 dgNodeBase (const dgNodeBase& copyFrom);
85 dgNodeBase (dgCollisionInstance* const instance);
86 dgNodeBase (dgNodeBase* const left, dgNodeBase* const right);
87 ~dgNodeBase();
88
89 void CalculateAABB();
90 void SetBox (const dgVector& p0, const dgVector& p1);
91 bool BoxTest (const dgOOBBTestData& data) const;
92 bool BoxTest (const dgOOBBTestData& data, const dgNodeBase* const otherNode) const;
93 dgFloat32 RayBoxDistance (const dgOOBBTestData& data, const dgFastRayTest& myRay, const dgFastRayTest& otherRay, const dgNodeBase* const otherNode) const;
94
95 DG_INLINE dgCollisionInstance* GetShape() const
96 {
97 return m_shape;
98 }
99
100 DG_INLINE dgInt32 BoxIntersect (const dgFastRayTest& ray, const dgVector& boxP0, const dgVector& boxP1) const
101 {
102 dgVector minBox (m_p0 - boxP1);
103 dgVector maxBox (m_p1 - boxP0);
104 return ray.BoxTest(minBox, maxBox);
105 }
106
107 dgVector m_p0;
108 dgVector m_p1;
109 dgVector m_size;
110 dgVector m_origin;
111 dgFloat32 m_area;
112 dgInt32 m_type;
113 dgNodeBase* m_left;
114 dgNodeBase* m_right;
115 dgNodeBase* m_parent;
116 dgCollisionInstance* m_shape;
117 dgTreeArray::dgTreeNode* m_myNode;
118 } DG_GCC_VECTOR_ALIGMENT;
119
120 protected:
121 class dgNodePairs
122 {
123 public:
124 const void* m_treeNode;
125 dgNodeBase* m_myNode;
126 dgInt32 m_treeNodeIsLeaf;
127 };
128
129
130 class dgSpliteInfo;
131 class dgHeapNodePair;
132
133 public:
134 dgCollisionCompound (dgWorld* const world);
135 dgCollisionCompound (const dgCollisionCompound& source, const dgCollisionInstance* const myInstance);
136 dgCollisionCompound (dgWorld* const world, dgDeserialize deserialization, void* const userData, const dgCollisionInstance* const myInstance);
137
138 void SetParent (const dgCollisionInstance* const myInstance);
139 virtual ~dgCollisionCompound();
140
141 virtual void BeginAddRemove ();
142 virtual dgTreeArray::dgTreeNode* AddCollision (dgCollisionInstance* const part);
143 virtual void RemoveCollision (dgTreeArray::dgTreeNode* const node);
144 virtual void SetCollisionMatrix (dgTreeArray::dgTreeNode* const node, const dgMatrix& matrix);
145 virtual void EndAddRemove (bool flushCache = true);
146
147 void ApplyScale (const dgVector& scale);
148 void GetAABB (dgVector& p0, dgVector& p1) const;
149
150 dgInt32 GetNodeIndex(dgTreeArray::dgTreeNode* const node) const;
151 dgTreeArray::dgTreeNode* FindNodeByIndex (dgInt32 index) const;
152
153
154 dgTreeArray::dgTreeNode* GetFirstNode () const;
155 dgTreeArray::dgTreeNode* GetNextNode (dgTreeArray::dgTreeNode* const node) const;
156 dgCollisionInstance* GetCollisionFromNode (dgTreeArray::dgTreeNode* const node) const;
157
158 protected:
159 void RemoveCollision (dgNodeBase* const node);
160 virtual dgFloat32 GetVolume () const;
161 virtual dgFloat32 GetBoxMinRadius () const;
162 virtual dgFloat32 GetBoxMaxRadius () const;
163
164 virtual dgVector SupportVertex (const dgVector& dir, dgInt32* const vertexIndex) const;
165 virtual void CalcAABB (const dgMatrix& matrix, dgVector& p0, dgVector& p1) const;
166
167 static void CalculateInertia (void* userData, int vertexCount, const dgFloat32* const FaceArray, int faceId);
168
169 virtual void MassProperties ();
170 dgMatrix CalculateInertiaAndCenterOfMass (const dgMatrix& m_alignMatrix, const dgVector& localScale, const dgMatrix& matrix) const;
171 dgFloat32 CalculateMassProperties (const dgMatrix& offset, dgVector& inertia, dgVector& crossInertia, dgVector& centerOfMass) const;
172
173
174
175 virtual dgVector CalculateVolumeIntegral (const dgMatrix& globalMatrix, const dgVector& plane, const dgCollisionInstance& parentScale) const;
176
177 virtual void DebugCollision (const dgMatrix& matrix, dgCollision::OnDebugCollisionMeshCallback callback, void* const userData) const;
178 virtual dgFloat32 RayCast (const dgVector& localP0, const dgVector& localP1, dgFloat32 maxT, dgContactPoint& contactOut, const dgBody* const body, void* const userData, OnRayPrecastAction preFilter) const;
179
180 virtual dgFloat32 ConvexRayCast (const dgCollisionInstance* const instance, const dgMatrix& instanceMatrix, const dgVector& instanceVeloc, dgFloat32 maxT, dgContactPoint& contactOut, const dgBody* const referenceBody, const dgCollisionInstance* const referenceInstance, void* const userData, dgInt32 threadId) const;
181
182
183 virtual dgInt32 CalculateSignature () const;
184 virtual void SetCollisionBBox (const dgVector& p0, const dgVector& p1);
185 virtual void GetCollisionInfo(dgCollisionInfo* const info) const;
186 virtual void Serialize(dgSerialize callback, void* const userData) const;
187 virtual dgInt32 CalculateContacts (dgCollidingPairCollector::dgPair* const pair, dgCollisionParamProxy& proxy) const;
188
189 dgInt32 CalculateContactsToSingle (dgCollidingPairCollector::dgPair* const pair, dgCollisionParamProxy& proxy) const;
190 dgInt32 CalculateContactsToSingleContinue (dgCollidingPairCollector::dgPair* const pair, dgCollisionParamProxy& proxy) const;
191 dgInt32 CalculateContactsToCompound (dgCollidingPairCollector::dgPair* const pair, dgCollisionParamProxy& proxy) const;
192 dgInt32 CalculateContactsToCompoundContinue (dgCollidingPairCollector::dgPair* const pair, dgCollisionParamProxy& proxy) const;
193 dgInt32 CalculateContactsToCollisionTree (dgCollidingPairCollector::dgPair* const pair, dgCollisionParamProxy& proxy) const;
194 dgInt32 CalculateContactsToCollisionTreeContinue (dgCollidingPairCollector::dgPair* const pair, dgCollisionParamProxy& proxy) const;
195 dgInt32 CalculateContactsToHeightField (dgCollidingPairCollector::dgPair* const pair, dgCollisionParamProxy& proxy) const;
196 dgInt32 CalculateContactsUserDefinedCollision (dgCollidingPairCollector::dgPair* const pair, dgCollisionParamProxy& proxy) const;
197
198 dgFloat32 ConvexRayCastSingleConvex (const dgCollisionInstance* const convexInstance, const dgMatrix& instanceMatrix, const dgVector& instanceVeloc, dgFloat32 maxT, dgContactPoint& contactOut, const dgBody* const referenceBody, const dgCollisionInstance* const referenceInstance, void* const userData, dgInt32 threadId) const;
199
200 //dgInt32 ClosestDistance (dgBody* const bodyA, dgTriplex& contactA, dgBody* const bodyB, dgTriplex& contactB, dgTriplex& normalAB) const;
201 //dgInt32 ClosestDistanceToCompound (dgBody* const compoundBodyA, dgTriplex& contactA, dgBody* const compoundBodyB, dgTriplex& contactB, dgTriplex& normalAB) const;
202 //dgInt32 ClosestDistanceToConvex (dgBody* const bodyA, dgTriplex& contactA, dgBody* const ConvetvBodyB, dgTriplex& contactB, dgTriplex& normalAB) const;
203 dgInt32 ClosestDistance (dgCollisionParamProxy& proxy) const;
204 dgInt32 ClosestDistanceToConvex (dgCollisionParamProxy& proxy) const;
205 dgInt32 ClosestDistanceToCompound (dgCollisionParamProxy& proxy) const;
206
207
208 #ifdef _DEBUG
209 dgVector InternalSupportVertex (const dgVector& dir) const;
210 #endif
211
212 dgNodeBase* BuildTopDown (dgNodeBase** const leafArray, dgInt32 firstBox, dgInt32 lastBox, dgList<dgNodeBase*>::dgListNode** const nextNode);
213
214 dgFloat64 CalculateEntropy (dgList<dgNodeBase*>& list);
215
216 void ImproveNodeFitness (dgNodeBase* const node) const;
217 dgFloat32 CalculateSurfaceArea (dgNodeBase* const node0, dgNodeBase* const node1, dgVector& minBox, dgVector& maxBox) const;
218
219 dgInt32 CalculatePlaneIntersection (const dgVector& normal, const dgVector& point, dgVector* const contactsOut, dgFloat32 normalSign) const;
220
221 void PushNode (const dgMatrix& matrix, dgUpHeap<dgHeapNodePair, dgFloat32>& heap, dgNodeBase* const myNode, dgNodeBase* const otehrNode) const;
222
223
224 dgFloat32 m_boxMinRadius;
225 dgFloat32 m_boxMaxRadius;
226 dgFloat64 m_treeEntropy;
227 dgWorld* m_world;
228 dgNodeBase* m_root;
229 const dgCollisionInstance* m_myInstance;
230 dgThread::dgCriticalSection m_criticalSectionLock;
231 dgTreeArray m_array;
232 dgInt32 m_idIndex;
233
234 static dgVector m_padding;
235 friend class dgBody;
236 friend class dgWorld;
237 friend class dgCollisionScene;
238 };
239
240
241
242 #endif
243
dgCollisionCompound::dgNodePairs::m_treeNode
const void * m_treeNode
Definition: dgCollisionCompound.h:124
dgCollisionCompound::ApplyScale
void ApplyScale(const dgVector &scale)
Definition: dgCollisionCompound.cpp:863
dgCollisionCompound::dgNodeBase::m_size
dgVector m_size
Definition: dgCollisionCompound.h:109
dgCollisionCompound::RemoveCollision
virtual void RemoveCollision(dgTreeArray::dgTreeNode *const node)
Definition: dgCollisionCompound.cpp:1062
dgCollisionCompound::m_treeEntropy
dgFloat64 m_treeEntropy
Definition: dgCollisionCompound.h:226
dgCollisionCompound::m_boxMinRadius
dgFloat32 m_boxMinRadius
Definition: dgCollisionCompound.h:224
dgCollidingPairCollector::dgPair
Definition: dgContact.h:52
dgCollisionCompound::dgOOBBTestData::m_size
dgVector m_size
Definition: dgCollisionCompound.h:64
dgCollisionCompound::m_node
Definition: dgCollisionCompound.h:41
dgCollisionCompound::SetParent
void SetParent(const dgCollisionInstance *const myInstance)
Definition: dgCollisionCompound.cpp:579
dgCollisionCompound::dgNodeBase::m_type
dgInt32 m_type
Definition: dgCollisionCompound.h:112
dgCollisionCompound::dgNodeBase::GetShape
DG_INLINE dgCollisionInstance * GetShape() const
Definition: dgCollisionCompound.h:95
dgCollisionCompound::CalculateInertiaAndCenterOfMass
dgMatrix CalculateInertiaAndCenterOfMass(const dgMatrix &m_alignMatrix, const dgVector &localScale, const dgMatrix &matrix) const
Definition: dgCollisionCompound.cpp:777
dgCollision::OnDebugCollisionMeshCallback
void(dgApi * OnDebugCollisionMeshCallback)(void *userData, int vertexCount, const dgFloat32 *FaceArray, int faceId)
Definition: dgCollision.h:220
dgCollisionBVH
Definition: dgCollisionBVH.h:32
dgFastRayTest
Definition: dgIntersections.h:52
dgCollisionInfo
Definition: dgCollision.h:82
dgCollisionCompound::dgTreeArray
Definition: dgCollisionCompound.h:47
dgBody
Definition: dgBody.h:44
dgCollisionCompound::m_padding
static dgVector m_padding
Definition: dgCollisionCompound.h:234
dgList::dgListNode
Definition: dgList.h:36
dgCollisionCompound::GetCollisionInfo
virtual void GetCollisionInfo(dgCollisionInfo *const info) const
Definition: dgCollisionCompound.cpp:1265
userData
void *const userData
Definition: dgBroadPhase.h:35
dgTree< dgNodeBase *, dgInt32 >::dgTreeNode
friend class dgTreeNode
Definition: dgTree.h:291
DG_INLINE
#define DG_INLINE
Definition: dgTypes.h:178
dgCollisionCompound::dgTreeArray::AddNode
void AddNode(dgNodeBase *const node, dgInt32 index, const dgCollisionInstance *const parent)
Definition: dgCollisionCompound.cpp:54
dgCollisionCompound::CalculateContactsToSingle
dgInt32 CalculateContactsToSingle(dgCollidingPairCollector::dgPair *const pair, dgCollisionParamProxy &proxy) const
Definition: dgCollisionCompound.cpp:2022
dgCollisionCompound::Serialize
virtual void Serialize(dgSerialize callback, void *const userData) const
Definition: dgCollisionCompound.cpp:1273
dgCollisionCompound::dgNodeType
dgNodeType
Definition: dgCollisionCompound.h:38
dgFloat32
float dgFloat32
Definition: dgTypes.h:233
dgInt32
int dgInt32
Definition: dgTypes.h:218
dgCollisionCompound::dgHeapNodePair
Definition: dgCollisionCompound.cpp:41
dgCollisionCompound::SetCollisionBBox
virtual void SetCollisionBBox(const dgVector &p0, const dgVector &p1)
Definition: dgCollisionCompound.cpp:584
dgCollisionCompound::m_myInstance
const dgCollisionInstance * m_myInstance
Definition: dgCollisionCompound.h:229
dgVector
Definition: dgVector.h:639
dgCollisionCompound::ConvexRayCast
virtual dgFloat32 ConvexRayCast(const dgCollisionInstance *const instance, const dgMatrix &instanceMatrix, const dgVector &instanceVeloc, dgFloat32 maxT, dgContactPoint &contactOut, const dgBody *const referenceBody, const dgCollisionInstance *const referenceInstance, void *const userData, dgInt32 threadId) const
Definition: dgCollisionCompound.cpp:2974
dgCollisionCompound::dgOOBBTestData
Definition: dgCollisionCompound.h:55
dgCollisionCompound::dgOOBBTestData::m_absMatrix
dgMatrix m_absMatrix
Definition: dgCollisionCompound.h:62
dgCollisionCompound::CalculateSurfaceArea
dgFloat32 CalculateSurfaceArea(dgNodeBase *const node0, dgNodeBase *const node1, dgVector &minBox, dgVector &maxBox) const
Definition: dgCollisionCompound.cpp:1288
dgCollisionCompound::dgCollisionCompound
dgCollisionCompound(dgWorld *const world)
Definition: dgCollisionCompound.cpp:450
dgCollisionCompound::dgNodeBase::m_parent
dgNodeBase * m_parent
Definition: dgCollisionCompound.h:115
dgCollisionCompound::GetNextNode
dgTreeArray::dgTreeNode * GetNextNode(dgTreeArray::dgTreeNode *const node) const
Definition: dgCollisionCompound.cpp:1171
dgCollisionCompound::~dgCollisionCompound
virtual ~dgCollisionCompound()
Definition: dgCollisionCompound.cpp:572
dgFastRayTest::BoxTest
DG_INLINE dgInt32 BoxTest(const dgVector &minBox, const dgVector &maxBox) const
Definition: dgIntersections.h:81
dgCollisionCompound::m_idIndex
dgInt32 m_idIndex
Definition: dgCollisionCompound.h:232
DG_CLASS_ALLOCATOR
#define DG_CLASS_ALLOCATOR(allocator)
Definition: dgMemory.h:60
dgCollisionCompound::dgOOBBTestData::m_aabbP1
dgVector m_aabbP1
Definition: dgCollisionCompound.h:68
dgCollisionCompound::GetNodeIndex
dgInt32 GetNodeIndex(dgTreeArray::dgTreeNode *const node) const
Definition: dgCollisionCompound.cpp:1149
dgFloat64
double dgFloat64
Definition: dgTypes.h:224
dgCollisionCompound::dgOOBBTestData::m_origin
dgVector m_origin
Definition: dgCollisionCompound.h:63
dgList
Definition: dgList.h:33
dgCollisionCompound::BuildTopDown
dgNodeBase * BuildTopDown(dgNodeBase **const leafArray, dgInt32 firstBox, dgInt32 lastBox, dgList< dgNodeBase *>::dgListNode **const nextNode)
Definition: dgCollisionCompound.cpp:881
dgCollisionCompound::dgNodePairs
Definition: dgCollisionCompound.h:121
dgCollisionCompound::dgOOBBTestData::m_localP0
dgVector m_localP0
Definition: dgCollisionCompound.h:65
dgContactPoint
Definition: dgContact.h:78
dgCollisionCompound::dgNodeBase::m_right
dgNodeBase * m_right
Definition: dgCollisionCompound.h:114
dgCollisionCompound::dgNodeBase::m_left
dgNodeBase * m_left
Definition: dgCollisionCompound.h:113
dgCollisionCompound::CalculateInertia
static void CalculateInertia(void *userData, int vertexCount, const dgFloat32 *const FaceArray, int faceId)
Definition: dgCollisionCompound.cpp:812
dgCollisionCompound::GetBoxMaxRadius
virtual dgFloat32 GetBoxMaxRadius() const
Definition: dgCollisionCompound.cpp:736
dgCollisionCompound::m_world
dgWorld * m_world
Definition: dgCollisionCompound.h:227
dgSerialize
void(dgApi * dgSerialize)(void *const userData, const void *const buffer, size_t size)
Definition: dgTypes.h:280
dgCollisionCompound::CalculateContactsToCollisionTreeContinue
dgInt32 CalculateContactsToCollisionTreeContinue(dgCollidingPairCollector::dgPair *const pair, dgCollisionParamProxy &proxy) const
Definition: dgCollisionCompound.cpp:2669
dgTree
Definition: dgTree.h:88
DG_MSC_VECTOR_ALIGMENT
#define DG_MSC_VECTOR_ALIGMENT
Definition: dgTypes.h:194
dgCollisionCompound::dgNodePairs::m_myNode
dgNodeBase * m_myNode
Definition: dgCollisionCompound.h:125
dgCollisionCompound::CalculateContactsUserDefinedCollision
dgInt32 CalculateContactsUserDefinedCollision(dgCollidingPairCollector::dgPair *const pair, dgCollisionParamProxy &proxy) const
Definition: dgCollisionCompound.cpp:1921
dgCollisionCompound::RayCast
virtual dgFloat32 RayCast(const dgVector &localP0, const dgVector &localP1, dgFloat32 maxT, dgContactPoint &contactOut, const dgBody *const body, void *const userData, OnRayPrecastAction preFilter) const
Definition: dgCollisionCompound.cpp:642
dgCollisionCompound::dgOOBBTestData::m_matrix
dgMatrix m_matrix
Definition: dgCollisionCompound.h:61
dgCollisionCompound::dgNodeBase::m_p1
dgVector m_p1
Definition: dgCollisionCompound.h:108
dgDeserialize
void(dgApi * dgDeserialize)(void *const userData, void *buffer, size_t size)
Definition: dgTypes.h:279
dgCollisionCompound::CalcAABB
virtual void CalcAABB(const dgMatrix &matrix, dgVector &p0, dgVector &p1) const
Definition: dgCollisionCompound.cpp:609
dgCollisionCompound::dgOOBBTestData::m_aabbP0
dgVector m_aabbP0
Definition: dgCollisionCompound.h:67
dgCollisionCompound::dgNodeBase::m_area
dgFloat32 m_area
Definition: dgCollisionCompound.h:111
OnRayPrecastAction
dgUnsigned32(dgApi * OnRayPrecastAction)(const dgBody *const body, const dgCollisionInstance *const collision, void *const userData)
Definition: dgBroadPhase.h:36
dgCollisionInstance
Definition: dgCollisionInstance.h:30
dgCollisionCompound::dgNodeBase::m_origin
dgVector m_origin
Definition: dgCollisionCompound.h:110
dgUpHeap
Definition: dgHeap.h:91
dgCollisionCompound::GetVolume
virtual dgFloat32 GetVolume() const
Definition: dgCollisionCompound.cpp:720
dgCollisionCompound::EndAddRemove
virtual void EndAddRemove(bool flushCache=true)
Definition: dgCollisionCompound.cpp:925
dgCollisionCompound::m_criticalSectionLock
dgThread::dgCriticalSection m_criticalSectionLock
Definition: dgCollisionCompound.h:230
dgCollisionCompound::GetFirstNode
dgTreeArray::dgTreeNode * GetFirstNode() const
Definition: dgCollisionCompound.cpp:1159
dgCollisionScene
Definition: dgCollisionScene.h:31
dgCollisionCompound::ImproveNodeFitness
void ImproveNodeFitness(dgNodeBase *const node) const
Definition: dgCollisionCompound.cpp:1297
dgCollisionCompound::SetCollisionMatrix
virtual void SetCollisionMatrix(dgTreeArray::dgTreeNode *const node, const dgMatrix &matrix)
Definition: dgCollisionCompound.cpp:1073
dgCollisionCompound::GetAABB
void GetAABB(dgVector &p0, dgVector &p1) const
Definition: dgCollisionCompound.cpp:589
dgCollisionCompound::dgTreeArray::dgTreeArray
dgTreeArray(dgMemoryAllocator *const allocator)
Definition: dgCollisionCompound.cpp:49
dgCollisionCompound::CalculateContactsToCompound
dgInt32 CalculateContactsToCompound(dgCollidingPairCollector::dgPair *const pair, dgCollisionParamProxy &proxy) const
Definition: dgCollisionCompound.cpp:1667
dgCollisionCompound::GetCollisionFromNode
dgCollisionInstance * GetCollisionFromNode(dgTreeArray::dgTreeNode *const node) const
Definition: dgCollisionCompound.cpp:1183
dgCollisionCompound::dgNodeBase::m_myNode
dgTreeArray::dgTreeNode * m_myNode
Definition: dgCollisionCompound.h:117
dgCollisionCompound::ConvexRayCastSingleConvex
dgFloat32 ConvexRayCastSingleConvex(const dgCollisionInstance *const convexInstance, const dgMatrix &instanceMatrix, const dgVector &instanceVeloc, dgFloat32 maxT, dgContactPoint &contactOut, const dgBody *const referenceBody, const dgCollisionInstance *const referenceInstance, void *const userData, dgInt32 threadId) const
Definition: dgCollisionCompound.cpp:3000
dgCollisionCompound::CalculateEntropy
dgFloat64 CalculateEntropy(dgList< dgNodeBase *> &list)
Definition: dgCollisionCompound.cpp:905
dgCollisionCompound::ClosestDistance
dgInt32 ClosestDistance(dgCollisionParamProxy &proxy) const
Definition: dgCollisionCompound.cpp:1490
dgCollisionCompound::dgOOBBTestData::m_localP1
dgVector m_localP1
Definition: dgCollisionCompound.h:66
dgCollisionCompound::m_leaf
Definition: dgCollisionCompound.h:40
dgCollisionCompound::CalculateContactsToCollisionTree
dgInt32 CalculateContactsToCollisionTree(dgCollidingPairCollector::dgPair *const pair, dgCollisionParamProxy &proxy) const
Definition: dgCollisionCompound.cpp:2121
dgCollision.h
dgCollisionCompound::CalculatePlaneIntersection
dgInt32 CalculatePlaneIntersection(const dgVector &normal, const dgVector &point, dgVector *const contactsOut, dgFloat32 normalSign) const
Definition: dgCollisionCompound.cpp:626
dgCollisionCompound::CalculateSignature
virtual dgInt32 CalculateSignature() const
Definition: dgCollisionCompound.cpp:601
dgCollision
Definition: dgCollision.h:217
dgCollisionCompound::BeginAddRemove
virtual void BeginAddRemove()
Definition: dgCollisionCompound.cpp:876
dgCollisionCompound::CalculateContactsToCompoundContinue
dgInt32 CalculateContactsToCompoundContinue(dgCollidingPairCollector::dgPair *const pair, dgCollisionParamProxy &proxy) const
Definition: dgCollisionCompound.cpp:2483
dgCollisionCompound::dgNodePairs::m_treeNodeIsLeaf
dgInt32 m_treeNodeIsLeaf
Definition: dgCollisionCompound.h:126
dgCollisionCompound::dgNodeBase::m_p0
dgVector m_p0
Definition: dgCollisionCompound.h:107
dgCollisionCompound::dgNodeBase::m_shape
dgCollisionInstance * m_shape
Definition: dgCollisionCompound.h:116
dgMatrix
Definition: dgMatrix.h:40
dgCollisionCompound::MassProperties
virtual void MassProperties()
Definition: dgCollisionCompound.cpp:819
dgCollisionCompound::dgSpliteInfo
Definition: dgCollisionCompound.cpp:353
dgMemoryAllocator
Definition: dgMemory.h:73
dgCollisionCompound::dgNodeBase
Definition: dgCollisionCompound.h:79
dgCollisionCompound::m_boxMaxRadius
dgFloat32 m_boxMaxRadius
Definition: dgCollisionCompound.h:225
dgCollisionCompound::dgNodeBase::BoxIntersect
DG_INLINE dgInt32 BoxIntersect(const dgFastRayTest &ray, const dgVector &boxP0, const dgVector &boxP1) const
Definition: dgCollisionCompound.h:100
dgCollisionCompound::DG_GCC_VECTOR_ALIGMENT
DG_MSC_VECTOR_ALIGMENT class dgCollisionCompound::dgOOBBTestData DG_GCC_VECTOR_ALIGMENT
dgCollisionCompound::m_array
dgTreeArray m_array
Definition: dgCollisionCompound.h:231
dgCollisionCompound::CalculateContacts
virtual dgInt32 CalculateContacts(dgCollidingPairCollector::dgPair *const pair, dgCollisionParamProxy &proxy) const
Definition: dgCollisionCompound.cpp:1445
dgWorld
Definition: dgWorld.h:129
dgCollisionCompound::SupportVertex
virtual dgVector SupportVertex(const dgVector &dir, dgInt32 *const vertexIndex) const
Definition: dgCollisionCompound.cpp:1191
dgCollisionCompound::AddCollision
virtual dgTreeArray::dgTreeNode * AddCollision(dgCollisionInstance *const part)
Definition: dgCollisionCompound.cpp:998
dgThread::dgCriticalSection
Definition: dgThread.h:35
dgCollisionCompound::GetBoxMinRadius
virtual dgFloat32 GetBoxMinRadius() const
Definition: dgCollisionCompound.cpp:731
dgCollisionCompound::DebugCollision
virtual void DebugCollision(const dgMatrix &matrix, dgCollision::OnDebugCollisionMeshCallback callback, void *const userData) const
Definition: dgCollisionCompound.cpp:632
dgCollisionCompound::ClosestDistanceToConvex
dgInt32 ClosestDistanceToConvex(dgCollisionParamProxy &proxy) const
Definition: dgCollisionCompound.cpp:1509
dgCollisionCompound::FindNodeByIndex
dgTreeArray::dgTreeNode * FindNodeByIndex(dgInt32 index) const
Definition: dgCollisionCompound.cpp:1154
dgCollisionCompound::PushNode
void PushNode(const dgMatrix &matrix, dgUpHeap< dgHeapNodePair, dgFloat32 > &heap, dgNodeBase *const myNode, dgNodeBase *const otehrNode) const
Definition: dgCollisionCompound.cpp:1579
dgCollisionCompound::m_root
dgNodeBase * m_root
Definition: dgCollisionCompound.h:228
dgCollisionCompound::ClosestDistanceToCompound
dgInt32 ClosestDistanceToCompound(dgCollisionParamProxy &proxy) const
Definition: dgCollisionCompound.cpp:1592
dgCollisionCompound::CalculateMassProperties
dgFloat32 CalculateMassProperties(const dgMatrix &offset, dgVector &inertia, dgVector &crossInertia, dgVector &centerOfMass) const
Definition: dgCollisionCompound.cpp:769
dgCollisionCompound::CalculateContactsToSingleContinue
dgInt32 CalculateContactsToSingleContinue(dgCollidingPairCollector::dgPair *const pair, dgCollisionParamProxy &proxy) const
Definition: dgCollisionCompound.cpp:2354
dgCollisionCompound::CalculateVolumeIntegral
virtual dgVector CalculateVolumeIntegral(const dgMatrix &globalMatrix, const dgVector &plane, const dgCollisionInstance &parentScale) const
Definition: dgCollisionCompound.cpp:743
dgCollisionCompound
Definition: dgCollisionCompound.h:35
dgCollisionParamProxy
Definition: dgContact.h:93
dgCollisionCompound::CalculateContactsToHeightField
dgInt32 CalculateContactsToHeightField(dgCollidingPairCollector::dgPair *const pair, dgCollisionParamProxy &proxy) const
Definition: dgCollisionCompound.cpp:1815