RavEngine
Loading...
Searching...
No Matches
GuVecConvexHull.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved.
26// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
27// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
28
29#ifndef GU_VEC_CONVEXHULL_H
30#define GU_VEC_CONVEXHULL_H
31
32#include "common/PxPhysXCommonConfig.h"
33#include "geometry/PxMeshScale.h"
34#include "GuConvexMesh.h"
35#include "GuVecConvex.h"
36#include "GuConvexMeshData.h"
37#include "GuBigConvexData.h"
38#include "GuConvexSupportTable.h"
39#include "GuCubeIndex.h"
40#include "foundation/PxFPU.h"
41#include "foundation/PxVecQuat.h"
42#include "GuShapeConvex.h"
43
44namespace physx
45{
46namespace Gu
47{
48#define CONVEX_MARGIN_RATIO 0.1f
49#define CONVEX_MIN_MARGIN_RATIO 0.05f
50#define CONVEX_SWEEP_MARGIN_RATIO 0.025f
51#define TOLERANCE_MARGIN_RATIO 0.08f
52#define TOLERANCE_MIN_MARGIN_RATIO 0.05f
53
54
55 //This margin is used in Persistent contact manifold
56 PX_SUPPORT_FORCE_INLINE aos::FloatV CalculatePCMConvexMargin(const Gu::ConvexHullData* hullData, const aos::Vec3VArg scale,
57 const PxReal toleranceLength, const PxReal toleranceRatio = TOLERANCE_MIN_MARGIN_RATIO)
58 {
59
60 using namespace aos;
61 const Vec3V extents= V3Mul(V3LoadU(hullData->mInternal.mExtents), scale);
62 const FloatV min = V3ExtractMin(extents);
63 const FloatV toleranceMargin = FLoad(toleranceLength * toleranceRatio);
64 //ML: 25% of the minimum extents of the internal AABB as this convex hull's margin
65 return FMin(FMul(min, FLoad(0.25f)), toleranceMargin);
66 }
67
68 PX_SUPPORT_FORCE_INLINE aos::FloatV CalculateMTDConvexMargin(const Gu::ConvexHullData* hullData, const aos::Vec3VArg scale)
69 {
70 using namespace aos;
71 const Vec3V extents = V3Mul(V3LoadU(hullData->mInternal.mExtents), scale);
72 const FloatV min = V3ExtractMin(extents);
73 //ML: 25% of the minimum extents of the internal AABB as this convex hull's margin
74 return FMul(min, FLoad(0.25f));
75 }
76
77
78 //This minMargin is used in PCM contact gen
79 PX_SUPPORT_FORCE_INLINE void CalculateConvexMargin(const InternalObjectsData& internalObject, PxReal& margin, PxReal& minMargin, PxReal& sweepMargin,
80 const aos::Vec3VArg scale)
81 {
82 using namespace aos;
83
84 const Vec3V extents = V3Mul(V3LoadU(internalObject.mExtents), scale);
85 const FloatV min_ = V3ExtractMin(extents);
86
87 PxReal minExtent;
88 FStore(min_, &minExtent);
89
90 //margin is used as acceptanceTolerance for overlap.
91 margin = minExtent * CONVEX_MARGIN_RATIO;
92 //minMargin is used in the GJK termination condition
93 minMargin = minExtent * CONVEX_MIN_MARGIN_RATIO;
94 //this is used for sweep(gjkRaycast)
95 sweepMargin = minExtent * CONVEX_SWEEP_MARGIN_RATIO;
96 }
97
98
99 PX_SUPPORT_FORCE_INLINE aos::Mat33V ConstructSkewMatrix(const aos::Vec3VArg scale, const aos::QuatVArg rotation)
100 {
101 using namespace aos;
102 Mat33V rot;
103 QuatGetMat33V(rotation, rot.col0, rot.col1, rot.col2);
104 Mat33V trans = M33Trnsps(rot);
105 trans.col0 = V3Scale(trans.col0, V3GetX(scale));
106 trans.col1 = V3Scale(trans.col1, V3GetY(scale));
107 trans.col2 = V3Scale(trans.col2, V3GetZ(scale));
108 return M33MulM33(trans, rot);
109 }
110
111 PX_SUPPORT_FORCE_INLINE void ConstructSkewMatrix(const aos::Vec3VArg scale, const aos::QuatVArg rotation, aos::Mat33V& vertex2Shape, aos::Mat33V& shape2Vertex, aos::Vec3V& center, const bool idtScale)
112 {
113 using namespace aos;
114
115 PX_ASSERT(!V3AllEq(scale, V3Zero()));
116
117 if(idtScale)
118 {
119 //create identity buffer
120 const Mat33V identity = M33Identity();
121 vertex2Shape = identity;
122 shape2Vertex = identity;
123 }
124 else
125 {
126 const FloatV scaleX = V3GetX(scale);
127 const Vec3V invScale = V3Recip(scale);
128
129 //this is uniform scale
130 if(V3AllEq(V3Splat(scaleX), scale))
131 {
132 vertex2Shape = M33Diagonal(scale);
133 shape2Vertex = M33Diagonal(invScale);
134 }
135 else
136 {
137 Mat33V rot;
138 QuatGetMat33V(rotation, rot.col0, rot.col1, rot.col2);
139 const Mat33V trans = M33Trnsps(rot);
140 /*
141 vertex2shape
142 skewMat = Inv(R)*Diagonal(scale)*R;
143 */
144
145 const Mat33V temp(V3Scale(trans.col0, scaleX), V3Scale(trans.col1, V3GetY(scale)), V3Scale(trans.col2, V3GetZ(scale)));
146 vertex2Shape = M33MulM33(temp, rot);
147
148 //don't need it in the support function
149 /*
150 shape2Vertex
151 invSkewMat =(invSkewMat)= Inv(R)*Diagonal(1/scale)*R;
152 */
153
154 shape2Vertex.col0 = V3Scale(trans.col0, V3GetX(invScale));
155 shape2Vertex.col1 = V3Scale(trans.col1, V3GetY(invScale));
156 shape2Vertex.col2 = V3Scale(trans.col2, V3GetZ(invScale));
157 shape2Vertex = M33MulM33(shape2Vertex, rot);
158
159 //shape2Vertex = M33Inverse(vertex2Shape);
160 }
161
162 //transform center to shape space
163 center = M33MulV3(vertex2Shape, center);
164 }
165 }
166
167 PX_SUPPORT_FORCE_INLINE aos::Mat33V ConstructVertex2ShapeMatrix(const aos::Vec3VArg scale, const aos::QuatVArg rotation)
168 {
169 using namespace aos;
170 Mat33V rot;
171 QuatGetMat33V(rotation, rot.col0, rot.col1, rot.col2);
172 const Mat33V trans = M33Trnsps(rot);
173 /*
174 vertex2shape
175 skewMat = Inv(R)*Diagonal(scale)*R;
176 */
177
178 const Mat33V temp(V3Scale(trans.col0, V3GetX(scale)), V3Scale(trans.col1, V3GetY(scale)), V3Scale(trans.col2, V3GetZ(scale)));
179 return M33MulM33(temp, rot);
180 }
181
182
183 class ConvexHullV : public ConvexV
184 {
185
186 class TinyBitMap
187 {
188 public:
189 PxU32 m[8];
190 PX_FORCE_INLINE TinyBitMap() { m[0] = m[1] = m[2] = m[3] = m[4] = m[5] = m[6] = m[7] = 0; }
191 PX_FORCE_INLINE void set(PxU8 v) { m[v >> 5] |= 1 << (v & 31); }
192 PX_FORCE_INLINE bool get(PxU8 v) const { return (m[v >> 5] & 1 << (v & 31)) != 0; }
193 };
194
195
196 public:
200 PX_SUPPORT_INLINE ConvexHullV() : ConvexV(ConvexType::eCONVEXHULL)
201 {
202 }
203
204 PX_SUPPORT_INLINE ConvexHullV(const Gu::ConvexHullData* _hullData, const aos::Vec3VArg _center, const aos::Vec3VArg scale, const aos::QuatVArg scaleRot,
205 const bool idtScale) :
206 ConvexV(ConvexType::eCONVEXHULL, _center)
207 {
208 using namespace aos;
209
210 hullData = _hullData;
211 const PxVec3* PX_RESTRICT tempVerts = _hullData->getHullVertices();
212 verts = tempVerts;
213 numVerts = _hullData->mNbHullVertices;
214 CalculateConvexMargin(_hullData->mInternal, margin, minMargin, sweepMargin, scale);
215 ConstructSkewMatrix(scale, scaleRot, vertex2Shape, shape2Vertex, center, idtScale);
216 data = _hullData->mBigConvexRawData;
217 }
218
219 PX_SUPPORT_INLINE ConvexHullV(const Gu::ConvexHullData* _hullData, const aos::Vec3VArg _center) :
220 ConvexV(ConvexType::eCONVEXHULL, _center)
221 {
222 using namespace aos;
223
224 hullData = _hullData;
225 verts = _hullData->getHullVertices();
226 numVerts = _hullData->mNbHullVertices;
227 data = _hullData->mBigConvexRawData;
228 }
229
230 //this is used by CCD system
231 PX_SUPPORT_INLINE ConvexHullV(const PxGeometry& geom) : ConvexV(ConvexType::eCONVEXHULL, aos::V3Zero())
232 {
233 using namespace aos;
234 const PxConvexMeshGeometry& convexGeom = static_cast<const PxConvexMeshGeometry&>(geom);
235 const Gu::ConvexHullData* hData = _getHullData(convexGeom);
236
237 const Vec3V vScale = V3LoadU_SafeReadW(convexGeom.scale.scale); // PT: safe because 'rotation' follows 'scale' in PxMeshScale
238 const QuatV vRot = QuatVLoadU(&convexGeom.scale.rotation.x);
239 const bool idtScale = convexGeom.scale.isIdentity();
240
241 hullData = hData;
242 const PxVec3* PX_RESTRICT tempVerts = hData->getHullVertices();
243 verts = tempVerts;
244 numVerts = hData->mNbHullVertices;
245 CalculateConvexMargin(hData->mInternal, margin, minMargin, sweepMargin, vScale);
246 ConstructSkewMatrix(vScale, vRot, vertex2Shape, shape2Vertex, center, idtScale);
247
248 data = hData->mBigConvexRawData;
249 }
250
251 //this is used by convex vs tetrahedron collision
252 PX_SUPPORT_INLINE ConvexHullV(const Gu::PolygonalData& polyData, const Cm::FastVertex2ShapeScaling& convexScale) :
253 ConvexV(ConvexType::eCONVEXHULL, aos::V3LoadU(polyData.mCenter))
254 {
255 using namespace aos;
256
257 const Vec3V vScale = V3LoadU(polyData.mScale.scale);
258
259 verts = polyData.mVerts;
260 numVerts = PxU8(polyData.mNbVerts);
261 CalculateConvexMargin(polyData.mInternal, margin, minMargin, sweepMargin, vScale);
262
263 const PxMat33& v2s = convexScale.getVertex2ShapeSkew();
264 const PxMat33& s2v = convexScale.getShape2VertexSkew();
265
266 vertex2Shape.col0 = V3LoadU(v2s.column0);
267 vertex2Shape.col1 = V3LoadU(v2s.column1);
268 vertex2Shape.col2 = V3LoadU(v2s.column2);
269
270 shape2Vertex.col0 = V3LoadU(s2v.column0);
271 shape2Vertex.col1 = V3LoadU(s2v.column1);
272 shape2Vertex.col2 = V3LoadU(s2v.column2);
273
274 data = polyData.mBigData;
275
276 }
277
278 PX_SUPPORT_INLINE void initialize(const Gu::ConvexHullData* _hullData, const aos::Vec3VArg _center, const aos::Vec3VArg scale,
279 const aos::QuatVArg scaleRot, const bool idtScale)
280 {
281 using namespace aos;
282
283 const PxVec3* tempVerts = _hullData->getHullVertices();
284 CalculateConvexMargin(_hullData->mInternal, margin, minMargin, sweepMargin, scale);
285 ConstructSkewMatrix(scale, scaleRot, vertex2Shape, shape2Vertex, center, idtScale);
286
287 verts = tempVerts;
288 numVerts = _hullData->mNbHullVertices;
289 //rot = _rot;
290
291 center = _center;
292
293 // searchIndex = 0;
294 data = _hullData->mBigConvexRawData;
295
296 hullData = _hullData;
297 if (_hullData->mBigConvexRawData)
298 {
299 PxPrefetchLine(hullData->mBigConvexRawData->mValencies);
300 PxPrefetchLine(hullData->mBigConvexRawData->mValencies, 128);
301 PxPrefetchLine(hullData->mBigConvexRawData->mAdjacentVerts);
302 }
303 }
304
305
306
307 PX_FORCE_INLINE void resetMargin(const PxReal toleranceLength)
308 {
309 const PxReal toleranceMinMargin = toleranceLength * TOLERANCE_MIN_MARGIN_RATIO;
310 const PxReal toleranceMargin = toleranceLength * TOLERANCE_MARGIN_RATIO;
311
312 margin = PxMin(margin, toleranceMargin);
313 minMargin = PxMin(minMargin, toleranceMinMargin);
314 }
315
316 PX_FORCE_INLINE aos::Vec3V supportPoint(const PxI32 index)const
317 {
318 using namespace aos;
319
320 return M33MulV3(vertex2Shape, V3LoadU_SafeReadW(verts[index])); // PT: safe because of the way vertex memory is allocated in ConvexHullData (and 'verts' is initialized with ConvexHullData::getHullVertices())
321 }
322
323 PX_NOINLINE PxU32 hillClimbing(const aos::Vec3VArg _dir)const
324 {
325 using namespace aos;
326
327 const Gu::Valency* valency = data->mValencies;
328 const PxU8* adjacentVerts = data->mAdjacentVerts;
329
330 //NotSoTinyBitMap visited;
331 PxU32 smallBitMap[8] = {0,0,0,0,0,0,0,0};
332
333 // PxU32 index = searchIndex;
334 PxU32 index = 0;
335
336 {
337 PxVec3 vertexSpaceDirection;
338 V3StoreU(_dir, vertexSpaceDirection);
339 const PxU32 offset = ComputeCubemapNearestOffset(vertexSpaceDirection, data->mSubdiv);
340 //const PxU32 offset = ComputeCubemapOffset(vertexSpaceDirection, data->mSubdiv);
341 index = data->mSamples[offset];
342 }
343
344 Vec3V maxPoint = V3LoadU_SafeReadW(verts[index]); // PT: safe because of the way vertex memory is allocated in ConvexHullData (and 'verts' is initialized with ConvexHullData::getHullVertices())
345 FloatV max = V3Dot(maxPoint, _dir);
346
347 PxU32 initialIndex = index;
348
349 do
350 {
351 initialIndex = index;
352 const PxU32 numNeighbours = valency[index].mCount;
353 const PxU32 offset = valency[index].mOffset;
354
355 for(PxU32 a = 0; a < numNeighbours; ++a)
356 {
357 const PxU32 neighbourIndex = adjacentVerts[offset + a];
358
359 const Vec3V vertex = V3LoadU_SafeReadW(verts[neighbourIndex]); // PT: safe because of the way vertex memory is allocated in ConvexHullData (and 'verts' is initialized with ConvexHullData::getHullVertices())
360 const FloatV dist = V3Dot(vertex, _dir);
361 if(FAllGrtr(dist, max))
362 {
363 const PxU32 ind = neighbourIndex>>5;
364 const PxU32 mask = PxU32(1 << (neighbourIndex & 31));
365 if((smallBitMap[ind] & mask) == 0)
366 {
367 smallBitMap[ind] |= mask;
368 max = dist;
369 index = neighbourIndex;
370 }
371 }
372 }
373
374 }while(index != initialIndex);
375
376 return index;
377 }
378
379 PX_SUPPORT_INLINE PxU32 bruteForceSearch(const aos::Vec3VArg _dir)const
380 {
381 using namespace aos;
382 //brute force
383 PxVec3 dir;
384 V3StoreU(_dir, dir);
385
386 PxReal max = verts[0].dot(dir);
387 PxU32 maxIndex = 0;
388
389 for (PxU32 i = 1; i < numVerts; ++i)
390 {
391 const PxReal dist = verts[i].dot(dir);
392 if (dist > max)
393 {
394 max = dist;
395 maxIndex = i;
396 }
397 }
398 return maxIndex;
399 }
400
401 //points are in vertex space, _dir in vertex space
402 PX_NOINLINE PxU32 supportVertexIndex(const aos::Vec3VArg _dir)const
403 {
404 using namespace aos;
405 if(data)
406 return hillClimbing(_dir);
407 else
408 return bruteForceSearch(_dir);
409 }
410
411 //dir is in the vertex space
412 PX_SUPPORT_INLINE void bruteForceSearchMinMax(const aos::Vec3VArg _dir, aos::FloatV& min, aos::FloatV& max)const
413 {
414 using namespace aos;
415
416 //brute force
417 PxVec3 dir;
418 V3StoreU(_dir, dir);
419 //get the support point from the orignal margin
420 PxReal _max = verts[0].dot(dir);
421 PxReal _min = _max;
422
423 for(PxU32 i = 1; i < numVerts; ++i)
424 {
425 const PxReal dist = verts[i].dot(dir);
426 _max = PxMax(dist, _max);
427 _min = PxMin(dist, _min);
428 }
429 min = FLoad(_min);
430 max = FLoad(_max);
431 }
432
433 //This function is used in the full contact manifold generation code, points are in vertex space.
434 //This function support scaling, _dir is in the shape space
435 PX_SUPPORT_INLINE void supportVertexMinMax(const aos::Vec3VArg _dir, aos::FloatV& min, aos::FloatV& max)const
436 {
437 using namespace aos;
438
439 //dir is in the vertex space
440 const Vec3V dir = M33TrnspsMulV3(vertex2Shape, _dir);
441
442 if(data)
443 {
444 const PxU32 maxIndex= hillClimbing(dir);
445 const PxU32 minIndex= hillClimbing(V3Neg(dir));
446 const Vec3V maxPoint= M33MulV3(vertex2Shape, V3LoadU_SafeReadW(verts[maxIndex])); // PT: safe because of the way vertex memory is allocated in ConvexHullData (and 'verts' is initialized with ConvexHullData::getHullVertices())
447 const Vec3V minPoint= M33MulV3(vertex2Shape, V3LoadU_SafeReadW(verts[minIndex])); // PT: safe because of the way vertex memory is allocated in ConvexHullData (and 'verts' is initialized with ConvexHullData::getHullVertices())
448 min = V3Dot(_dir, minPoint);
449 max = V3Dot(_dir, maxPoint);
450 }
451 else
452 {
453 //dir is in the vertex space
454 bruteForceSearchMinMax(dir, min, max);
455 }
456 }
457
458 //This function is used in the full contact manifold generation code
459 PX_SUPPORT_INLINE void populateVerts(const PxU8* inds, PxU32 numInds, const PxVec3* originalVerts, aos::Vec3V* _verts)const
460 {
461 using namespace aos;
462
463 for(PxU32 i=0; i<numInds; ++i)
464 _verts[i] = M33MulV3(vertex2Shape, V3LoadU_SafeReadW(originalVerts[inds[i]])); // PT: safe because of the way vertex memory is allocated in ConvexHullData (and 'populateVerts' is always called with polyData.mVerts)
465 }
466
467 //This function is used in epa
468 //dir is in the shape space
469 PX_SUPPORT_INLINE aos::Vec3V supportLocal(const aos::Vec3VArg dir)const
470 {
471 using namespace aos;
472 //scale dir and put it in the vertex space
473 const Vec3V _dir = M33TrnspsMulV3(vertex2Shape, dir);
474 const PxU32 maxIndex = supportVertexIndex(_dir);
475 return M33MulV3(vertex2Shape, V3LoadU_SafeReadW(verts[maxIndex])); // PT: safe because of the way vertex memory is allocated in ConvexHullData (and 'verts' is initialized with ConvexHullData::getHullVertices())
476 }
477
478 //this is used in the sat test for the full contact gen
479 PX_SUPPORT_INLINE void supportLocal(const aos::Vec3VArg dir, aos::FloatV& min, aos::FloatV& max)const
480 {
481 using namespace aos;
482 //dir is in the shape space
483 supportVertexMinMax(dir, min, max);
484 }
485
486 //This function is used in epa
487 PX_SUPPORT_INLINE aos::Vec3V supportRelative(const aos::Vec3VArg dir, const aos::PxMatTransformV& aTob, const aos::PxMatTransformV& aTobT) const
488 {
489 using namespace aos;
490
491 //transform dir into the shape space
492// const Vec3V dir_ = aTob.rotateInv(dir);//relTra.rotateInv(dir);
493 const Vec3V dir_ = aTobT.rotate(dir);//relTra.rotateInv(dir);
494 const Vec3V maxPoint =supportLocal(dir_);
495 //translate maxPoint from shape space of a back to the b space
496 return aTob.transform(maxPoint);//relTra.transform(maxPoint);
497 }
498
499 //dir in the shape space, this function is used in gjk
500 PX_SUPPORT_INLINE aos::Vec3V supportLocal(const aos::Vec3VArg dir, PxI32& index)const
501 {
502 using namespace aos;
503 //scale dir and put it in the vertex space, for non-uniform scale, we don't want the scale in the dir, therefore, we are using
504 //the transpose of the inverse of shape2Vertex(which is vertex2shape). This will allow us igore the scale and keep the rotation
505 const Vec3V dir_ = M33TrnspsMulV3(vertex2Shape, dir);
506 //get the extreme point index
507 const PxU32 maxIndex = supportVertexIndex(dir_);
508 index = PxI32(maxIndex);
509 //p is in the shape space
510 return M33MulV3(vertex2Shape, V3LoadU_SafeReadW(verts[index])); // PT: safe because of the way vertex memory is allocated in ConvexHullData (and 'verts' is initialized with ConvexHullData::getHullVertices())
511 }
512
513 //this function is used in gjk
514 PX_SUPPORT_INLINE aos::Vec3V supportRelative( const aos::Vec3VArg dir, const aos::PxMatTransformV& aTob,
515 const aos::PxMatTransformV& aTobT, PxI32& index)const
516 {
517 using namespace aos;
518
519 //transform dir from b space to the shape space of a space
520// const Vec3V dir_ = aTob.rotateInv(dir);//relTra.rotateInv(dir);//M33MulV3(skewInvRot, dir);
521 const Vec3V dir_ = aTobT.rotate(dir);//relTra.rotateInv(dir);//M33MulV3(skewInvRot, dir);
522 const Vec3V p = supportLocal(dir_, index);
523 //transfrom from a to b space
524 return aTob.transform(p);
525 }
526
527 aos::Mat33V vertex2Shape;//inv(R)*S*R
528 aos::Mat33V shape2Vertex;//inv(vertex2Shape)
529
530 const Gu::ConvexHullData* hullData;
531 const BigConvexRawData* data;
532 const PxVec3* verts;
533 PxU8 numVerts;
534 };
535
536}
537
538}
539
540#endif //
Definition GuVecConvexHull.h:184
PX_SUPPORT_INLINE ConvexHullV()
Constructor.
Definition GuVecConvexHull.h:200
Definition GuVecConvex.h:58
3 Element vector class.
Definition PxVec3.h:50
PX_CUDA_CALLABLE PX_FORCE_INLINE float dot(const PxVec3 &v) const
returns the scalar product of this and other.
Definition PxVec3.h:276
GLM_FUNC_DECL GLM_CONSTEXPR genType identity()
Builds an identity matrix.
Definition matrix_transform.inl:4
#define PX_RESTRICT
Definition PxPreprocessor.h:355
#define PX_NOINLINE
Definition PxPreprocessor.h:346
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PX_CUDA_CALLABLE PX_FORCE_INLINE T PxMax(T a, T b)
The return value is the greater of the two specified values.
Definition PxMath.h:72
PX_FORCE_INLINE void PxPrefetchLine(const void *ptr, uint32_t offset=0)
Definition PxUnixIntrinsics.h:83
PX_CUDA_CALLABLE PX_FORCE_INLINE T PxMin(T a, T b)
The return value is the lesser of the two specified values.
Definition PxMath.h:88
Gu::Valency * mValencies
A list of mNbVerts valencies (= number of neighbors)
Definition GuBigConvexData.h:83
PxU8 * mAdjacentVerts
List of adjacent vertices.
Definition GuBigConvexData.h:84
Definition GuConvexMeshData.h:109
BigConvexRawData * mBigConvexRawData
Hill climbing data, only for large convexes! else NULL.
Definition GuConvexMeshData.h:129
PX_FORCE_INLINE const PxVec3 * getHullVertices() const
< Convex hull vertices
Definition GuConvexMeshData.h:152
PxU8 mNbHullVertices
Number of vertices in the convex hull.
Definition GuConvexMeshData.h:125
Definition GuVecConvex.h:43