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

My Project

dgCollisionInstance.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 _DG_COLLISION_INSTANCE_H_
23 #define _DG_COLLISION_INSTANCE_H_
24
25
26 #define DG_MAX_COLLISION_AABB_PADDING dgFloat32 (1.0f / 16.0f)
27
28 #include "dgCollision.h"
29
30 class dgCollisionInstance
31 {
32 public:
33 enum dgScaleType
34 {
35 m_unit,
36 m_uniform,
37 m_nonUniform,
38 m_global,
39 };
40
41 DG_CLASS_ALLOCATOR(allocator)
42 dgCollisionInstance();
43 dgCollisionInstance(const dgCollisionInstance& instance);
44 dgCollisionInstance(const dgCollisionInstance& meshInstance, const dgCollision* const shape);
45 dgCollisionInstance(const dgWorld* const world, const dgCollision* const childCollision, dgInt32 shapeID, const dgMatrix& matrix);
46 dgCollisionInstance(const dgWorld* const world, dgDeserialize deserialization, void* const userData);
47 ~dgCollisionInstance();
48
49 dgCollisionInstance* AddRef ();
50 dgInt32 Release ();
51
52 void SetScale (const dgVector& scale);
53 const dgVector& GetScale () const;
54 const dgVector& GetInvScale () const;
55
56 void SetGlobalScale (const dgVector& scale);
57
58 dgScaleType GetScaleType() const;
59 dgScaleType GetCombinedScaleType(dgScaleType type) const;
60
61 const dgMatrix& GetLocalMatrix () const;
62 const dgMatrix& GetGlobalMatrix () const;
63 const dgMatrix& GetAlignMatrix () const;
64 void SetLocalMatrix (const dgMatrix& matrix);
65 void SetGlobalMatrix (const dgMatrix& matrix);
66
67 dgUnsigned32 GetUserDataID () const;
68 void SetUserDataID (dgUnsigned32 userData);
69
70 void* GetUserData () const;
71 void SetUserData (void* const userData);
72
73 const void* GetCollisionHandle () const;
74 const dgCollisionInstance* GetParent () const;
75
76 dgVector GetBoxSize() const;
77 dgVector GetBoxOrigin() const;
78
79 dgFloat32 GetUmbraClipSize () const;
80
81 const dgWorld* GetWorld() const;
82 const dgCollision* GetChildShape() const;
83
84 void SetWorld (dgWorld* const world);
85 void SetChildShape (dgCollision* const shape);
86
87 dgFloat32 GetVolume () const;
88 void GetCollisionInfo(dgCollisionInfo* const info) const;
89
90 dgInt32 IsType (dgCollision::dgRTTI type) const ;
91 dgMemoryAllocator* GetAllocator() const;
92
93 bool GetCollisionMode() const;
94 void SetCollisionMode(bool mode);
95
96 void SetBreakImpulse(dgFloat32 force);
97 dgFloat32 GetBreakImpulse() const;
98
99 dgUnsigned32 GetSignature () const;
100 dgCollisionID GetCollisionPrimityType () const;
101
102 void CalcObb (dgVector& origin, dgVector& size) const;
103 void CalcAABB (const dgMatrix& matrix, dgVector& p0, dgVector& p1) const;
104 dgFloat32 RayCast (const dgVector& localP0, const dgVector& localP1, dgFloat32 maxT, dgContactPoint& contactOut, OnRayPrecastAction preFilter, const dgBody* const body, void* const userData) const;
105 dgFloat32 ConvexRayCast (const dgCollisionInstance* const convexShape, const dgMatrix& localMatrix, const dgVector& localVeloc, dgFloat32 maxT, dgContactPoint& contactOut, OnRayPrecastAction preFilter, const dgBody* const referenceBody, void* const userData, dgInt32 threadId) const;
106
107 dgFloat32 GetBoxMinRadius () const;
108 dgFloat32 GetBoxMaxRadius () const;
109 dgMatrix CalculateInertia () const;
110 void DebugCollision (const dgMatrix& matrix, dgCollision::OnDebugCollisionMeshCallback callback, void* const userData) const;
111
112 dgVector SupportVertex (const dgVector& dir, dgInt32* const vertexIndex) const;
113 dgInt32 CalculatePlaneIntersection (const dgVector& normal, const dgVector& point, dgVector* const contactsOut, dgFloat32 normalSign) const;
114
115 dgInt32 CalculateSignature () const;
116 void SetCollisionBBox (const dgVector& p0, const dgVector& p1);
117
118 dgInt32 GetConvexVertexCount() const;
119
120 void Serialize(dgSerialize callback, void* const userData, bool saveShape = true) const;
121 void CalculateBuoyancyAcceleration (const dgMatrix& matrix, const dgVector& origin, const dgVector& gravity, const dgVector& fluidPlane, dgFloat32 fluidDensity, dgFloat32 fluidViscosity, dgVector& accel, dgVector& alpha);
122
123
124 dgMatrix m_globalMatrix;
125 dgMatrix m_localMatrix;
126 dgMatrix m_aligmentMatrix;
127 dgVector m_scale;
128 dgVector m_invScale;
129 dgVector m_maxScale;
130 dgUnsigned32 m_userDataID;
131 dgInt32 m_refCount;
132
133 void* m_userData;
134 const dgWorld* m_world;
135 const dgCollision* m_childShape;
136 const void* m_subCollisionHandle;
137 const dgCollisionInstance* m_parent;
138 dgInt32 m_collisionMode;
139 dgScaleType m_scaleType;
140
141 static dgVector m_padding;
142 };
143
144 DG_INLINE dgCollisionInstance::dgCollisionInstance(const dgCollisionInstance& meshInstance, const dgCollision* const shape)
145 :m_globalMatrix(meshInstance.m_globalMatrix)
146 ,m_localMatrix (meshInstance.m_localMatrix)
147 ,m_aligmentMatrix (meshInstance.m_aligmentMatrix)
148 ,m_scale(meshInstance.m_scale)
149 ,m_invScale(meshInstance.m_invScale)
150 ,m_maxScale(meshInstance.m_maxScale)
151 ,m_userDataID(meshInstance.m_userDataID)
152 ,m_refCount(1)
153 ,m_userData(NULL)
154 ,m_world(meshInstance.m_world)
155 ,m_childShape (shape)
156 ,m_subCollisionHandle(NULL)
157 ,m_parent(NULL)
158 ,m_collisionMode(meshInstance.m_collisionMode)
159 ,m_scaleType(meshInstance.m_scaleType)
160 {
161 if (m_childShape) {
162 m_childShape->AddRef();
163 }
164 }
165
166
167 DG_INLINE dgCollisionInstance* dgCollisionInstance::AddRef ()
168 {
169 m_refCount ++;
170 return this;
171 }
172
173 DG_INLINE dgInt32 dgCollisionInstance::Release ()
174 {
175 m_refCount --;
176 if (m_refCount) {
177 return m_refCount;
178 }
179 delete this;
180 return 0;
181 }
182
183
184 DG_INLINE dgInt32 dgCollisionInstance::IsType (dgCollision::dgRTTI type) const
185 {
186 return m_childShape->IsType (type);
187 }
188
189 DG_INLINE const dgWorld* dgCollisionInstance::GetWorld() const
190 {
191 return m_world;
192 }
193
194 DG_INLINE const dgCollision* dgCollisionInstance::GetChildShape() const
195 {
196 return m_childShape;
197 }
198
199
200 DG_INLINE void dgCollisionInstance::SetWorld (dgWorld* const world)
201 {
202 m_world = world;
203 }
204
205 DG_INLINE void dgCollisionInstance::SetChildShape (dgCollision* const shape)
206 {
207 shape->AddRef();
208 if (m_childShape) {
209 m_childShape->Release();
210 }
211
212 m_childShape = shape;
213 }
214
215
216 DG_INLINE void dgCollisionInstance::GetCollisionInfo(dgCollisionInfo* const info) const
217 {
218 info->m_offsetMatrix = m_localMatrix;
219 info->m_userDadaID = m_userDataID;
220 // info->m_scale = m_scale;
221 m_childShape->GetCollisionInfo(info);
222 }
223
224
225 DG_INLINE const dgVector& dgCollisionInstance::GetScale () const
226 {
227 return m_scale;
228 }
229
230 DG_INLINE const dgVector& dgCollisionInstance::GetInvScale () const
231 {
232 return m_invScale;
233 }
234
235
236 DG_INLINE const dgMatrix& dgCollisionInstance::GetLocalMatrix () const
237 {
238 return m_localMatrix;
239 }
240
241 DG_INLINE const dgMatrix& dgCollisionInstance::GetGlobalMatrix () const
242 {
243 return m_globalMatrix;
244 }
245
246 DG_INLINE const dgMatrix& dgCollisionInstance::GetAlignMatrix () const
247 {
248 return m_aligmentMatrix;
249 }
250
251 DG_INLINE void dgCollisionInstance::SetGlobalMatrix (const dgMatrix& matrix)
252 {
253 m_globalMatrix = matrix;
254 }
255
256
257 DG_INLINE dgMemoryAllocator* dgCollisionInstance::GetAllocator() const
258 {
259 return m_childShape->GetAllocator();
260 }
261
262 DG_INLINE dgFloat32 dgCollisionInstance::GetVolume () const
263 {
264 return m_childShape->GetVolume() * m_scale.m_x * m_scale.m_y * m_scale.m_z;
265 }
266
267
268 DG_INLINE bool dgCollisionInstance::GetCollisionMode() const
269 {
270 return m_collisionMode ? true : false;
271 }
272
273 DG_INLINE void dgCollisionInstance::SetCollisionMode(bool mode)
274 {
275 m_collisionMode = mode ? 1 : 0;
276 }
277
278
279 DG_INLINE void dgCollisionInstance::SetBreakImpulse(dgFloat32 force)
280 {
281 dgAssert (0);
282 // m_destructionImpulse = force;
283 }
284
285 DG_INLINE dgFloat32 dgCollisionInstance::GetBreakImpulse() const
286 {
287 // return m_destructionImpulse;
288 return dgFloat32 (1.0e20f);
289 }
290
291 DG_INLINE void* dgCollisionInstance::GetUserData () const
292 {
293 return m_userData;
294 }
295
296
297 DG_INLINE const void* dgCollisionInstance::GetCollisionHandle () const
298 {
299 return m_subCollisionHandle;
300 }
301
302 DG_INLINE const dgCollisionInstance* dgCollisionInstance::GetParent () const
303 {
304 return m_parent;
305 }
306
307 DG_INLINE void dgCollisionInstance::SetUserData (void* const userData)
308 {
309 m_userData = userData;
310 }
311
312
313 DG_INLINE dgUnsigned32 dgCollisionInstance::GetUserDataID () const
314 {
315 return m_userDataID;
316 }
317
318 DG_INLINE void dgCollisionInstance::SetUserDataID (dgUnsigned32 userDataId)
319 {
320 m_userDataID = userDataId;
321 }
322
323 DG_INLINE dgUnsigned32 dgCollisionInstance::GetSignature () const
324 {
325 return m_childShape->GetSignature();
326 }
327
328 DG_INLINE dgCollisionID dgCollisionInstance::GetCollisionPrimityType () const
329 {
330 return m_childShape->GetCollisionPrimityType();
331 }
332
333 DG_INLINE dgFloat32 dgCollisionInstance::GetBoxMinRadius () const
334 {
335 return m_childShape->GetBoxMinRadius() * m_maxScale.m_x;
336 }
337
338 DG_INLINE dgFloat32 dgCollisionInstance::GetBoxMaxRadius () const
339 {
340 //return m_childShape->GetBoxMaxRadius() * m_maxScale.m_x;
341 return GetBoxMinRadius ();
342 }
343
344
345 DG_INLINE dgVector dgCollisionInstance::SupportVertex(const dgVector& dir, dgInt32* const vertexIndex) const
346 {
347 dgAssert (dgAbsf(dir % dir - dgFloat32 (1.0f)) < dgFloat32 (1.0e-2f));
348 dgAssert (dir.m_w == dgFloat32 (0.0f));
349 switch (m_scaleType)
350 {
351 case m_unit:
352 {
353 return m_childShape->SupportVertex (dir, vertexIndex);
354 }
355 case m_uniform:
356 {
357 return m_scale.CompProduct4 (m_childShape->SupportVertex (dir, vertexIndex));
358 }
359 case m_nonUniform:
360 {
361 // support((p * S), n) = S * support (p, n * transp(S))
362 dgVector dir1 (m_scale.CompProduct4(dir));
363 dir1 = dir1.CompProduct4(dir1.InvMagSqrt());
364 return m_scale.CompProduct4(m_childShape->SupportVertex (dir1, vertexIndex));
365 }
366
367 case m_global:
368 default:
369 {
370 dgVector dir1 (m_aligmentMatrix.UnrotateVector(m_scale.CompProduct4(dir)));
371 dir1 = dir1.CompProduct4(dir1.InvMagSqrt());
372 return m_scale.CompProduct4(m_aligmentMatrix.TransformVector (m_childShape->SupportVertex (dir1, vertexIndex)));
373 }
374 }
375 }
376
377
378
379 DG_INLINE void dgCollisionInstance::SetCollisionBBox (const dgVector& p0, const dgVector& p1)
380 {
381 dgAssert (0);
382 }
383
384 DG_INLINE dgInt32 dgCollisionInstance::CalculateSignature () const
385 {
386 dgAssert (0);
387 return 0;
388 }
389
390
391 DG_INLINE dgInt32 dgCollisionInstance::GetConvexVertexCount() const
392 {
393 return m_childShape->GetConvexVertexCount();
394 }
395
396
397 DG_INLINE dgVector dgCollisionInstance::GetBoxSize() const
398 {
399 switch (m_scaleType)
400 {
401 case m_unit:
402 case m_uniform:
403 case m_nonUniform:
404 return m_childShape->m_boxSize.CompProduct4(m_scale);
405
406 case m_global:
407 default:
408 return m_childShape->m_boxSize.CompProduct4(m_maxScale);
409 }
410 }
411
412 DG_INLINE dgVector dgCollisionInstance::GetBoxOrigin() const
413 {
414 switch (m_scaleType)
415 {
416 case m_unit:
417 case m_uniform:
418 case m_nonUniform:
419 return m_childShape->m_boxOrigin.CompProduct4(m_scale);
420
421 case m_global:
422 default:
423 return m_aligmentMatrix.TransformVector(m_childShape->m_boxOrigin).CompProduct4(m_scale);
424 }
425 }
426
427 DG_INLINE dgFloat32 dgCollisionInstance::GetUmbraClipSize () const
428 {
429 return m_childShape->GetUmbraClipSize() * m_maxScale.m_x;
430 }
431
432 DG_INLINE dgCollisionInstance::dgScaleType dgCollisionInstance::GetScaleType() const
433 {
434 return m_scaleType;
435 }
436
437 DG_INLINE dgCollisionInstance::dgScaleType dgCollisionInstance::GetCombinedScaleType(dgCollisionInstance::dgScaleType type) const
438 {
439 return dgMax(m_scaleType, type);
440 }
441
442 DG_INLINE void dgCollisionInstance::CalcObb (dgVector& origin, dgVector& size) const
443 {
444 size = m_childShape->GetObbSize();
445 origin = m_childShape->GetObbOrigin();
446
447 switch (m_scaleType)
448 {
449 case m_unit:
450 {
451 size += m_padding;
452 break;
453 }
454
455 case m_uniform:
456 case m_nonUniform:
457 {
458 size = size.CompProduct4(m_scale) + m_padding;
459 origin = origin.CompProduct4(m_scale);
460 break;
461 }
462 case m_global:
463 {
464 dgAssert (0);
465 // dgMatrix matrix1 (matrix);
466 // matrix1[0] = matrix1[0].Scale4(m_scale.m_x);
467 // matrix1[1] = matrix1[1].Scale4(m_scale.m_y);
468 // matrix1[2] = matrix1[2].Scale4(m_scale.m_z);
469 // m_childShape->CalcAABB (m_aligmentMatrix * matrix1, p0, p1);
470 // p0 -= m_padding;
471 // p1 += m_padding;
472 break;
473 }
474 }
475
476 dgAssert (size.m_w == dgFloat32 (0.0f));
477 dgAssert (origin.m_w == dgFloat32 (0.0f));
478 }
479
480 #endif
481
dgCollision::GetBoxMinRadius
virtual dgFloat32 GetBoxMinRadius() const =0
dgCollisionInfo::m_userDadaID
dgInt32 m_userDadaID
Definition: dgCollision.h:191
dgCollisionInstance::m_userData
void * m_userData
Definition: dgCollisionInstance.h:133
dgCollisionInstance::GetWorld
const dgWorld * GetWorld() const
Definition: dgCollisionInstance.h:189
dgCollisionInstance::m_scaleType
dgScaleType m_scaleType
Definition: dgCollisionInstance.h:139
dgCollisionInstance::GetBoxSize
dgVector GetBoxSize() const
Definition: dgCollisionInstance.h:397
dgCollisionInstance::CalculateBuoyancyAcceleration
void CalculateBuoyancyAcceleration(const dgMatrix &matrix, const dgVector &origin, const dgVector &gravity, const dgVector &fluidPlane, dgFloat32 fluidDensity, dgFloat32 fluidViscosity, dgVector &accel, dgVector &alpha)
Definition: dgCollisionInstance.cpp:693
dgCollisionInstance::SupportVertex
dgVector SupportVertex(const dgVector &dir, dgInt32 *const vertexIndex) const
Definition: dgCollisionInstance.h:345
dgAbsf
DG_INLINE dgFloat32 dgAbsf(dgFloat32 x)
Definition: dgTypes.h:627
dgCollisionInstance::GetScaleType
dgScaleType GetScaleType() const
Definition: dgCollisionInstance.h:432
dgCollisionInfo
Definition: dgCollision.h:82
dgMatrix::UnrotateVector
dgVector UnrotateVector(const dgVector &v) const
Definition: dgMatrix.h:206
dgBody
Definition: dgBody.h:44
dgCollisionInstance::m_scale
dgVector m_scale
Definition: dgCollisionInstance.h:127
dgCollision::GetVolume
virtual dgFloat32 GetVolume() const =0
dgCollisionInstance::GetInvScale
const dgVector & GetInvScale() const
Definition: dgCollisionInstance.h:230
dgCollision::m_boxOrigin
dgVector m_boxOrigin
Definition: dgCollision.h:306
userData
void *const userData
Definition: dgBroadPhase.h:35
DG_INLINE
#define DG_INLINE
Definition: dgTypes.h:178
dgAssert
#define dgAssert(x)
Definition: dgTypes.h:158
dgCollisionInstance::GetParent
const dgCollisionInstance * GetParent() const
Definition: dgCollisionInstance.h:302
dgFloat32
float dgFloat32
Definition: dgTypes.h:233
dgInt32
int dgInt32
Definition: dgTypes.h:218
dgMatrix::TransformVector
dgVector TransformVector(const dgVector &v) const
Definition: dgMatrix.h:222
dgCollisionInstance::RayCast
dgFloat32 RayCast(const dgVector &localP0, const dgVector &localP1, dgFloat32 maxT, dgContactPoint &contactOut, OnRayPrecastAction preFilter, const dgBody *const body, void *const userData) const
Definition: dgCollisionInstance.cpp:589
dgCollisionInstance::m_localMatrix
dgMatrix m_localMatrix
Definition: dgCollisionInstance.h:125
dgMax
DG_INLINE T dgMax(T A, T B)
Definition: dgTypes.h:299
dgVector
Definition: dgVector.h:639
dgCollision::AddRef
const dgCollision * AddRef() const
Definition: dgCollision.h:337
dgCollisionInstance::CalculateInertia
dgMatrix CalculateInertia() const
Definition: dgCollisionInstance.cpp:467
dgCollision::GetCollisionInfo
virtual void GetCollisionInfo(dgCollisionInfo *const info) const
Definition: dgCollision.cpp:144
dgVector::m_z
dgFloat32 m_z
Definition: dgVector.h:1027
dgCollisionInstance::GetConvexVertexCount
dgInt32 GetConvexVertexCount() const
Definition: dgCollisionInstance.h:391
dgCollisionInstance::SetLocalMatrix
void SetLocalMatrix(const dgMatrix &matrix)
Definition: dgCollisionInstance.cpp:441
dgCollision::dgRTTI
dgRTTI
Definition: dgCollision.h:222
dgCollision::m_boxSize
dgVector m_boxSize
Definition: dgCollision.h:305
dgCollisionInstance::GetBoxOrigin
dgVector GetBoxOrigin() const
Definition: dgCollisionInstance.h:412
DG_CLASS_ALLOCATOR
#define DG_CLASS_ALLOCATOR(allocator)
Definition: dgMemory.h:60
dgCollisionInstance::GetUserData
void * GetUserData() const
Definition: dgCollisionInstance.h:291
dgCollisionInstance::GetBoxMinRadius
dgFloat32 GetBoxMinRadius() const
Definition: dgCollisionInstance.h:333
dgCollisionInstance::IsType
dgInt32 IsType(dgCollision::dgRTTI type) const
Definition: dgCollisionInstance.h:184
dgCollisionInstance::Release
dgInt32 Release()
Definition: dgCollisionInstance.h:173
dgCollisionInstance::GetCollisionPrimityType
dgCollisionID GetCollisionPrimityType() const
Definition: dgCollisionInstance.h:328
dgCollisionInstance::CalcAABB
void CalcAABB(const dgMatrix &matrix, dgVector &p0, dgVector &p1) const
Definition: dgCollisionInstance.cpp:541
dgCollision::GetObbOrigin
const dgVector & GetObbOrigin() const
Definition: dgCollision.h:387
dgCollision::GetUmbraClipSize
dgFloat32 GetUmbraClipSize() const
Definition: dgCollision.h:366
dgCollisionInstance::SetScale
void SetScale(const dgVector &scale)
Definition: dgCollisionInstance.cpp:350
dgContactPoint
Definition: dgContact.h:78
dgCollisionInstance::SetGlobalScale
void SetGlobalScale(const dgVector &scale)
Definition: dgCollisionInstance.cpp:383
dgCollision::GetObbSize
virtual dgVector GetObbSize() const
Definition: dgCollision.h:382
dgCollisionInstance::SetUserData
void SetUserData(void *const userData)
Definition: dgCollisionInstance.h:307
dgSerialize
void(dgApi * dgSerialize)(void *const userData, const void *const buffer, size_t size)
Definition: dgTypes.h:280
dgCollision::GetCollisionPrimityType
dgCollisionID GetCollisionPrimityType() const
Definition: dgCollision.h:321
dgCollisionInstance::m_maxScale
dgVector m_maxScale
Definition: dgCollisionInstance.h:129
dgCollisionInstance::GetGlobalMatrix
const dgMatrix & GetGlobalMatrix() const
Definition: dgCollisionInstance.h:241
dgVector::m_x
dgFloat32 m_x
Definition: dgVector.h:1025
dgDeserialize
void(dgApi * dgDeserialize)(void *const userData, void *buffer, size_t size)
Definition: dgTypes.h:279
dgCollision::IsType
dgInt32 IsType(dgRTTI type) const
Definition: dgCollision.h:377
dgCollisionInstance::DebugCollision
void DebugCollision(const dgMatrix &matrix, dgCollision::OnDebugCollisionMeshCallback callback, void *const userData) const
Definition: dgCollisionInstance.cpp:457
dgCollisionInstance::ConvexRayCast
dgFloat32 ConvexRayCast(const dgCollisionInstance *const convexShape, const dgMatrix &localMatrix, const dgVector &localVeloc, dgFloat32 maxT, dgContactPoint &contactOut, OnRayPrecastAction preFilter, const dgBody *const referenceBody, void *const userData, dgInt32 threadId) const
Definition: dgCollisionInstance.cpp:674
dgCollisionInstance::CalcObb
void CalcObb(dgVector &origin, dgVector &size) const
Definition: dgCollisionInstance.h:442
dgCollisionInstance::SetCollisionBBox
void SetCollisionBBox(const dgVector &p0, const dgVector &p1)
Definition: dgCollisionInstance.h:379
dgCollisionInstance::m_subCollisionHandle
const void * m_subCollisionHandle
Definition: dgCollisionInstance.h:136
dgCollisionInstance::CalculateSignature
dgInt32 CalculateSignature() const
Definition: dgCollisionInstance.h:384
OnRayPrecastAction
dgUnsigned32(dgApi * OnRayPrecastAction)(const dgBody *const body, const dgCollisionInstance *const collision, void *const userData)
Definition: dgBroadPhase.h:36
dgCollisionInstance::SetChildShape
void SetChildShape(dgCollision *const shape)
Definition: dgCollisionInstance.h:205
dgVector::InvMagSqrt
DG_INLINE dgVector InvMagSqrt() const
Definition: dgVector.h:918
dgCollisionInstance::m_nonUniform
Definition: dgCollisionInstance.h:37
dgCollisionInstance
Definition: dgCollisionInstance.h:30
dgCollisionInstance::m_invScale
dgVector m_invScale
Definition: dgCollisionInstance.h:128
dgCollisionInstance::SetCollisionMode
void SetCollisionMode(bool mode)
Definition: dgCollisionInstance.h:273
dgCollisionInstance::GetBoxMaxRadius
dgFloat32 GetBoxMaxRadius() const
Definition: dgCollisionInstance.h:338
dgCollisionInstance::GetCollisionInfo
void GetCollisionInfo(dgCollisionInfo *const info) const
Definition: dgCollisionInstance.h:216
dgUnsigned32
unsigned dgUnsigned32
Definition: dgTypes.h:219
dgCollisionInstance::SetBreakImpulse
void SetBreakImpulse(dgFloat32 force)
Definition: dgCollisionInstance.h:279
dgCollisionInstance::m_unit
Definition: dgCollisionInstance.h:35
dgCollisionInstance::GetChildShape
const dgCollision * GetChildShape() const
Definition: dgCollisionInstance.h:194
dgVector::CompProduct4
DG_INLINE dgVector CompProduct4(const dgVector &A) const
Definition: dgVector.h:851
dgCollisionInstance::GetCollisionHandle
const void * GetCollisionHandle() const
Definition: dgCollisionInstance.h:297
dgCollisionInstance::GetUserDataID
dgUnsigned32 GetUserDataID() const
Definition: dgCollisionInstance.h:313
dgCollisionInstance::m_global
Definition: dgCollisionInstance.h:38
dgCollisionInstance::GetCollisionMode
bool GetCollisionMode() const
Definition: dgCollisionInstance.h:268
dgCollisionInstance::m_globalMatrix
dgMatrix m_globalMatrix
Definition: dgCollisionInstance.h:124
dgCollision::SupportVertex
virtual dgVector SupportVertex(const dgVector &dir, dgInt32 *const vertexIndex) const =0
dgCollisionInstance::GetSignature
dgUnsigned32 GetSignature() const
Definition: dgCollisionInstance.h:323
dgCollisionInstance::dgScaleType
dgScaleType
Definition: dgCollisionInstance.h:33
dgCollision.h
dgCollision
Definition: dgCollision.h:217
dgCollisionInstance::Serialize
void Serialize(dgSerialize callback, void *const userData, bool saveShape=true) const
Definition: dgCollisionInstance.cpp:324
dgCollisionInstance::m_aligmentMatrix
dgMatrix m_aligmentMatrix
Definition: dgCollisionInstance.h:126
dgCollisionInstance::GetAlignMatrix
const dgMatrix & GetAlignMatrix() const
Definition: dgCollisionInstance.h:246
dgCollisionInstance::m_parent
const dgCollisionInstance * m_parent
Definition: dgCollisionInstance.h:137
dgCollisionInstance::GetBreakImpulse
dgFloat32 GetBreakImpulse() const
Definition: dgCollisionInstance.h:285
dgCollisionInstance::m_collisionMode
dgInt32 m_collisionMode
Definition: dgCollisionInstance.h:138
dgCollisionInstance::CalculatePlaneIntersection
dgInt32 CalculatePlaneIntersection(const dgVector &normal, const dgVector &point, dgVector *const contactsOut, dgFloat32 normalSign) const
Definition: dgCollisionInstance.cpp:491
dgCollisionInstance::m_userDataID
dgUnsigned32 m_userDataID
Definition: dgCollisionInstance.h:130
dgMatrix
Definition: dgMatrix.h:40
dgMemoryAllocator
Definition: dgMemory.h:73
dgCollisionInstance::GetVolume
dgFloat32 GetVolume() const
Definition: dgCollisionInstance.h:262
dgCollisionInstance::m_uniform
Definition: dgCollisionInstance.h:36
dgWorld
Definition: dgWorld.h:129
dgCollisionInstance::GetAllocator
dgMemoryAllocator * GetAllocator() const
Definition: dgCollisionInstance.h:257
dgCollisionInstance::m_refCount
dgInt32 m_refCount
Definition: dgCollisionInstance.h:131
dgCollision::GetSignature
dgUnsigned32 GetSignature() const
Definition: dgCollision.h:326
dgCollisionInstance::m_childShape
const dgCollision * m_childShape
Definition: dgCollisionInstance.h:135
dgCollisionInfo::m_offsetMatrix
dgMatrix m_offsetMatrix
Definition: dgCollision.h:189
dgCollisionInstance::GetLocalMatrix
const dgMatrix & GetLocalMatrix() const
Definition: dgCollisionInstance.h:236
dgVector::m_w
dgFloat32 m_w
Definition: dgVector.h:1028
dgCollisionInstance::AddRef
dgCollisionInstance * AddRef()
Definition: dgCollisionInstance.h:167
dgCollision::Release
virtual dgInt32 Release() const
Definition: dgCollision.h:343
dgCollisionInstance::GetUmbraClipSize
dgFloat32 GetUmbraClipSize() const
Definition: dgCollisionInstance.h:427
dgCollisionInstance::SetUserDataID
void SetUserDataID(dgUnsigned32 userData)
Definition: dgCollisionInstance.h:318
dgCollisionInstance::SetWorld
void SetWorld(dgWorld *const world)
Definition: dgCollisionInstance.h:200
dgCollisionInstance::GetCombinedScaleType
dgScaleType GetCombinedScaleType(dgScaleType type) const
Definition: dgCollisionInstance.h:437
dgCollisionInstance::GetScale
const dgVector & GetScale() const
Definition: dgCollisionInstance.h:225
dgCollisionInstance::SetGlobalMatrix
void SetGlobalMatrix(const dgMatrix &matrix)
Definition: dgCollisionInstance.h:251
dgCollisionInstance::m_padding
static dgVector m_padding
Definition: dgCollisionInstance.h:141
dgCollisionInstance::m_world
const dgWorld * m_world
Definition: dgCollisionInstance.h:134
dgCollisionID
dgCollisionID
Definition: dgCollision.h:52
dgCollision::GetConvexVertexCount
virtual dgInt32 GetConvexVertexCount() const
Definition: dgCollision.h:372
dgCollision::GetAllocator
dgMemoryAllocator * GetAllocator() const
Definition: dgCollision.h:360
dgVector::m_y
dgFloat32 m_y
Definition: dgVector.h:1026