RavEngine
Loading...
Searching...
No Matches
GuMidphaseInterface.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_MIDPHASE_INTERFACE_H
30#define GU_MIDPHASE_INTERFACE_H
31
32#include "GuOverlapTests.h"
33#include "GuRaycastTests.h"
34#include "GuTriangleMesh.h"
35#include "GuTetrahedronMesh.h"
36#include "foundation/PxVecMath.h"
37#include "PxQueryReport.h"
38#include "geometry/PxMeshQuery.h" // PT: TODO: revisit this include
39
40// PT: this file contains the common interface for all midphase implementations. Specifically the Midphase namespace contains the
41// midphase-related entry points, dispatching calls to the proper implementations depending on the triangle mesh's type. The rest of it
42// is simply classes & structs shared by all implementations.
43
44namespace physx
45{
46 class PxMeshScale;
47 class PxTriangleMeshGeometry;
48namespace Cm
49{
50 class FastVertex2ShapeScaling;
51}
52
53namespace Gu
54{
55 struct ConvexHullData;
56
57 struct CallbackMode { enum Enum { eANY, eCLOSEST, eMULTIPLE }; };
58
59 template<typename HitType>
61 {
62 CallbackMode::Enum mode;
63
64 MeshHitCallback(CallbackMode::Enum aMode) : mode(aMode) {}
65
66 PX_FORCE_INLINE bool inAnyMode() const { return mode == CallbackMode::eANY; }
67 PX_FORCE_INLINE bool inClosestMode() const { return mode == CallbackMode::eCLOSEST; }
68 PX_FORCE_INLINE bool inMultipleMode() const { return mode == CallbackMode::eMULTIPLE; }
69
70 virtual PxAgain processHit( // all reported coords are in mesh local space including hit.position
71 const HitType& hit, const PxVec3& v0, const PxVec3& v1, const PxVec3& v2, PxReal& shrunkMaxT, const PxU32* vIndices) = 0;
72
73 virtual ~MeshHitCallback() {}
74 };
75
76 template<typename HitType>
78 {
79 CallbackMode::Enum mode;
80
81 TetMeshHitCallback(CallbackMode::Enum aMode) : mode(aMode) {}
82
83 PX_FORCE_INLINE bool inAnyMode() const { return mode == CallbackMode::eANY; }
84 PX_FORCE_INLINE bool inClosestMode() const { return mode == CallbackMode::eCLOSEST; }
85 PX_FORCE_INLINE bool inMultipleMode() const { return mode == CallbackMode::eMULTIPLE; }
86
87 virtual PxAgain processHit( // all reported coords are in mesh local space including hit.position
88 const HitType& hit, const PxVec3& v0, const PxVec3& v1, const PxVec3& v2, const PxVec3& v3, PxReal& shrunkMaxT, const PxU32* vIndices) = 0;
89
90 virtual ~TetMeshHitCallback() {}
91 };
92
93
94
96
98 {
99 PxU32* mResults;
100 PxU32 mNbResults;
101 PxU32 mMaxResults;
102 PxU32 mStartIndex;
103 PxU32 mNbSkipped;
104 bool mOverflow;
105
106 PX_FORCE_INLINE LimitedResults(PxU32* results, PxU32 maxResults, PxU32 startIndex)
107 : mResults(results), mMaxResults(maxResults), mStartIndex(startIndex)
108 {
109 reset();
110 }
111
112 PX_FORCE_INLINE void reset()
113 {
114 mNbResults = 0;
115 mNbSkipped = 0;
116 mOverflow = false;
117 }
118
119 PX_FORCE_INLINE bool add(PxU32 index)
120 {
121 if(mNbResults>=mMaxResults)
122 {
123 mOverflow = true;
124 return false;
125 }
126
127 if(mNbSkipped>=mStartIndex)
128 mResults[mNbResults++] = index;
129 else
130 mNbSkipped++;
131
132 return true;
133 }
134 };
135
136 // RTree forward declarations
137 PX_PHYSX_COMMON_API PxU32 raycast_triangleMesh_RTREE(const TriangleMesh* mesh, const PxTriangleMeshGeometry& meshGeom, const PxTransform& pose,
138 const PxVec3& rayOrigin, const PxVec3& rayDir, PxReal maxDist,
139 PxHitFlags hitFlags, PxU32 maxHits, PxGeomRaycastHit* PX_RESTRICT hits, PxU32 stride);
140 PX_PHYSX_COMMON_API bool intersectSphereVsMesh_RTREE(const Sphere& sphere, const TriangleMesh& triMesh, const PxTransform& meshTransform, const PxMeshScale& meshScale, LimitedResults* results);
141 PX_PHYSX_COMMON_API bool intersectBoxVsMesh_RTREE (const Box& box, const TriangleMesh& triMesh, const PxTransform& meshTransform, const PxMeshScale& meshScale, LimitedResults* results);
142 PX_PHYSX_COMMON_API bool intersectCapsuleVsMesh_RTREE(const Capsule& capsule, const TriangleMesh& triMesh, const PxTransform& meshTransform, const PxMeshScale& meshScale, LimitedResults* results);
143 PX_PHYSX_COMMON_API void intersectOBB_RTREE(const TriangleMesh* mesh, const Box& obb, MeshHitCallback<PxGeomRaycastHit>& callback, bool bothTriangleSidesCollide, bool checkObbIsAligned);
144 PX_PHYSX_COMMON_API bool sweepCapsule_MeshGeom_RTREE( const TriangleMesh* mesh, const PxTriangleMeshGeometry& triMeshGeom, const PxTransform& pose,
145 const Gu::Capsule& lss, const PxVec3& unitDir, const PxReal distance,
146 PxGeomSweepHit& sweepHit, PxHitFlags hitFlags, const PxReal inflation);
147 PX_PHYSX_COMMON_API bool sweepBox_MeshGeom_RTREE( const TriangleMesh* mesh, const PxTriangleMeshGeometry& triMeshGeom, const PxTransform& pose,
148 const Gu::Box& box, const PxVec3& unitDir, const PxReal distance,
149 PxGeomSweepHit& sweepHit, PxHitFlags hitFlags, const PxReal inflation);
150 PX_PHYSX_COMMON_API void sweepConvex_MeshGeom_RTREE(const TriangleMesh* mesh, const Gu::Box& hullBox, const PxVec3& localDir, const PxReal distance, SweepConvexMeshHitCallback& callback, bool anyHit);
151 PX_PHYSX_COMMON_API void pointMeshDistance_RTREE(const TriangleMesh* mesh, const PxTriangleMeshGeometry& meshGeom, const PxTransform& pose, const PxVec3& point, float maxDist, PxU32& index, float& dist, PxVec3& closestPt);
152
153 // BV4 forward declarations
154 PX_PHYSX_COMMON_API PxU32 raycast_triangleMesh_BV4( const TriangleMesh* mesh, const PxTriangleMeshGeometry& meshGeom, const PxTransform& pose,
155 const PxVec3& rayOrigin, const PxVec3& rayDir, PxReal maxDist,
156 PxHitFlags hitFlags, PxU32 maxHits, PxGeomRaycastHit* PX_RESTRICT hits, PxU32 stride);
157 PX_PHYSX_COMMON_API bool intersectSphereVsMesh_BV4 (const Sphere& sphere, const TriangleMesh& triMesh, const PxTransform& meshTransform, const PxMeshScale& meshScale, LimitedResults* results);
158 PX_PHYSX_COMMON_API bool intersectBoxVsMesh_BV4 (const Box& box, const TriangleMesh& triMesh, const PxTransform& meshTransform, const PxMeshScale& meshScale, LimitedResults* results);
159 PX_PHYSX_COMMON_API bool intersectCapsuleVsMesh_BV4 (const Capsule& capsule, const TriangleMesh& triMesh, const PxTransform& meshTransform, const PxMeshScale& meshScale, LimitedResults* results);
160 PX_PHYSX_COMMON_API void intersectOBB_BV4(const TriangleMesh* mesh, const Box& obb, MeshHitCallback<PxGeomRaycastHit>& callback, bool bothTriangleSidesCollide, bool checkObbIsAligned);
161 PX_PHYSX_COMMON_API void intersectOBB_BV4(const TetrahedronMesh* mesh, const Box& obb, TetMeshHitCallback<PxGeomRaycastHit>& callback);
162 PX_PHYSX_COMMON_API bool sweepCapsule_MeshGeom_BV4( const TriangleMesh* mesh, const PxTriangleMeshGeometry& triMeshGeom, const PxTransform& pose,
163 const Gu::Capsule& lss, const PxVec3& unitDir, const PxReal distance,
164 PxGeomSweepHit& sweepHit, PxHitFlags hitFlags, const PxReal inflation);
165 PX_PHYSX_COMMON_API bool sweepBox_MeshGeom_BV4( const TriangleMesh* mesh, const PxTriangleMeshGeometry& triMeshGeom, const PxTransform& pose,
166 const Gu::Box& box, const PxVec3& unitDir, const PxReal distance,
167 PxGeomSweepHit& sweepHit, PxHitFlags hitFlags, const PxReal inflation);
168 PX_PHYSX_COMMON_API void sweepConvex_MeshGeom_BV4(const TriangleMesh* mesh, const Gu::Box& hullBox, const PxVec3& localDir, const PxReal distance, SweepConvexMeshHitCallback& callback, bool anyHit);
169 PX_PHYSX_COMMON_API void pointMeshDistance_BV4(const TriangleMesh* mesh, const PxTriangleMeshGeometry& meshGeom, const PxTransform& pose, const PxVec3& point, float maxDist, PxU32& index, float& dist, PxVec3& closestPt);
170 PX_PHYSX_COMMON_API bool intersectMeshVsMesh_BV4(PxReportCallback<PxGeomIndexPair>& callback, const TriangleMesh& triMesh0, const TriangleMesh& triMesh1, const PxTransform& meshPose0, const PxTransform& meshPose1, const PxMeshScale& meshScale0, const PxMeshScale& meshScale1, PxMeshMeshQueryFlags meshMeshFlags);
171
172 typedef PxU32 (*MidphaseRaycastFunction)( const TriangleMesh* mesh, const PxTriangleMeshGeometry& meshGeom, const PxTransform& pose,
173 const PxVec3& rayOrigin, const PxVec3& rayDir, PxReal maxDist,
174 PxHitFlags hitFlags, PxU32 maxHits, PxGeomRaycastHit* PX_RESTRICT hits, PxU32 stride);
175
176 typedef bool (*MidphaseSphereOverlapFunction) (const Sphere& sphere, const TriangleMesh& triMesh, const PxTransform& meshTransform, const PxMeshScale& meshScale, LimitedResults* results);
177 typedef bool (*MidphaseBoxOverlapFunction) (const Box& box, const TriangleMesh& triMesh, const PxTransform& meshTransform, const PxMeshScale& meshScale, LimitedResults* results);
178 typedef bool (*MidphaseCapsuleOverlapFunction) (const Capsule& capsule, const TriangleMesh& triMesh, const PxTransform& meshTransform, const PxMeshScale& meshScale, LimitedResults* results);
179 typedef void (*MidphaseBoxCBOverlapFunction) (const TriangleMesh* mesh, const Box& obb, MeshHitCallback<PxGeomRaycastHit>& callback, bool bothTriangleSidesCollide, bool checkObbIsAligned);
180
181 typedef bool (*MidphaseCapsuleSweepFunction)( const TriangleMesh* mesh, const PxTriangleMeshGeometry& triMeshGeom, const PxTransform& pose,
182 const Gu::Capsule& lss, const PxVec3& unitDir, const PxReal distance,
183 PxGeomSweepHit& sweepHit, PxHitFlags hitFlags, const PxReal inflation);
184 typedef bool (*MidphaseBoxSweepFunction)( const TriangleMesh* mesh, const PxTriangleMeshGeometry& triMeshGeom, const PxTransform& pose,
185 const Gu::Box& box, const PxVec3& unitDir, const PxReal distance,
186 PxGeomSweepHit& sweepHit, PxHitFlags hitFlags, const PxReal inflation);
187 typedef void (*MidphaseConvexSweepFunction)( const TriangleMesh* mesh, const Gu::Box& hullBox, const PxVec3& localDir, const PxReal distance, SweepConvexMeshHitCallback& callback, bool anyHit);
188 typedef void (*MidphasePointMeshFunction)(const TriangleMesh* mesh, const PxTriangleMeshGeometry& meshGeom, const PxTransform& pose, const PxVec3& point, float maxDist, PxU32& index, float& dist, PxVec3& closestPt);
189
190 static const MidphaseRaycastFunction gMidphaseRaycastTable[PxMeshMidPhase::eLAST] =
191 {
192 raycast_triangleMesh_RTREE,
193 raycast_triangleMesh_BV4,
194 };
195
196 static const MidphaseSphereOverlapFunction gMidphaseSphereOverlapTable[PxMeshMidPhase::eLAST] =
197 {
198 intersectSphereVsMesh_RTREE,
199 intersectSphereVsMesh_BV4,
200 };
201
202 static const MidphaseBoxOverlapFunction gMidphaseBoxOverlapTable[PxMeshMidPhase::eLAST] =
203 {
204 intersectBoxVsMesh_RTREE,
205 intersectBoxVsMesh_BV4,
206 };
207
208 static const MidphaseCapsuleOverlapFunction gMidphaseCapsuleOverlapTable[PxMeshMidPhase::eLAST] =
209 {
210 intersectCapsuleVsMesh_RTREE,
211 intersectCapsuleVsMesh_BV4,
212 };
213
214 static const MidphaseBoxCBOverlapFunction gMidphaseBoxCBOverlapTable[PxMeshMidPhase::eLAST] =
215 {
216 intersectOBB_RTREE,
217 intersectOBB_BV4,
218 };
219
220 static const MidphaseBoxSweepFunction gMidphaseBoxSweepTable[PxMeshMidPhase::eLAST] =
221 {
222 sweepBox_MeshGeom_RTREE,
223 sweepBox_MeshGeom_BV4,
224 };
225
226 static const MidphaseCapsuleSweepFunction gMidphaseCapsuleSweepTable[PxMeshMidPhase::eLAST] =
227 {
228 sweepCapsule_MeshGeom_RTREE,
229 sweepCapsule_MeshGeom_BV4,
230 };
231
232 static const MidphaseConvexSweepFunction gMidphaseConvexSweepTable[PxMeshMidPhase::eLAST] =
233 {
234 sweepConvex_MeshGeom_RTREE,
235 sweepConvex_MeshGeom_BV4,
236 };
237
238 static const MidphasePointMeshFunction gMidphasePointMeshTable[PxMeshMidPhase::eLAST] =
239 {
240 pointMeshDistance_RTREE,
241 pointMeshDistance_BV4,
242 };
243
244namespace Midphase
245{
246 // \param[in] mesh triangle mesh to raycast against
247 // \param[in] meshGeom geometry object associated with the mesh
248 // \param[in] meshTransform pose/transform of geometry object
249 // \param[in] rayOrigin ray's origin
250 // \param[in] rayDir ray's unit dir
251 // \param[in] maxDist ray's length/max distance
252 // \param[in] hitFlags query behavior flags
253 // \param[in] maxHits max number of hits = size of 'hits' buffer
254 // \param[out] hits result buffer where to write raycast hits
255 // \return number of hits written to 'hits' result buffer
256 // \note there's no mechanism to report overflow. Returned number of hits is just clamped to maxHits.
257 PX_FORCE_INLINE PxU32 raycastTriangleMesh( const TriangleMesh* mesh, const PxTriangleMeshGeometry& meshGeom, const PxTransform& meshTransform,
258 const PxVec3& rayOrigin, const PxVec3& rayDir, PxReal maxDist,
259 PxHitFlags hitFlags, PxU32 maxHits, PxGeomRaycastHit* PX_RESTRICT hits, PxU32 stride)
260 {
261 const PxU32 index = PxU32(mesh->getConcreteType() - PxConcreteType::eTRIANGLE_MESH_BVH33);
262 return gMidphaseRaycastTable[index](mesh, meshGeom, meshTransform, rayOrigin, rayDir, maxDist, hitFlags, maxHits, hits, stride);
263 }
264
265 // \param[in] sphere sphere
266 // \param[in] mesh triangle mesh
267 // \param[in] meshTransform pose/transform of triangle mesh
268 // \param[in] meshScale mesh scale
269 // \param[out] results results object if multiple hits are needed, NULL if a simple boolean answer is enough
270 // \return true if at least one overlap has been found
271 PX_FORCE_INLINE bool intersectSphereVsMesh(const Sphere& sphere, const TriangleMesh& mesh, const PxTransform& meshTransform, const PxMeshScale& meshScale, LimitedResults* results)
272 {
273 const PxU32 index = PxU32(mesh.getConcreteType() - PxConcreteType::eTRIANGLE_MESH_BVH33);
274 return gMidphaseSphereOverlapTable[index](sphere, mesh, meshTransform, meshScale, results);
275 }
276
277
278 // \param[in] box box
279 // \param[in] mesh triangle mesh
280 // \param[in] meshTransform pose/transform of triangle mesh
281 // \param[in] meshScale mesh scale
282 // \param[out] results results object if multiple hits are needed, NULL if a simple boolean answer is enough
283 // \return true if at least one overlap has been found
284 PX_FORCE_INLINE bool intersectBoxVsMesh(const Box& box, const TriangleMesh& mesh, const PxTransform& meshTransform, const PxMeshScale& meshScale, LimitedResults* results)
285 {
286 const PxU32 index = PxU32(mesh.getConcreteType() - PxConcreteType::eTRIANGLE_MESH_BVH33);
287 return gMidphaseBoxOverlapTable[index](box, mesh, meshTransform, meshScale, results);
288 }
289
290 // \param[in] capsule capsule
291 // \param[in] mesh triangle mesh
292 // \param[in] meshTransform pose/transform of triangle mesh
293 // \param[in] meshScale mesh scale
294 // \param[out] results results object if multiple hits are needed, NULL if a simple boolean answer is enough
295 // \return true if at least one overlap has been found
296 PX_FORCE_INLINE bool intersectCapsuleVsMesh(const Capsule& capsule, const TriangleMesh& mesh, const PxTransform& meshTransform, const PxMeshScale& meshScale, LimitedResults* results)
297 {
298 const PxU32 index = PxU32(mesh.getConcreteType() - PxConcreteType::eTRIANGLE_MESH_BVH33);
299 return gMidphaseCapsuleOverlapTable[index](capsule, mesh, meshTransform, meshScale, results);
300 }
301
302 // \param[in] mesh triangle mesh
303 // \param[in] box box
304 // \param[in] callback callback object, called each time a hit is found
305 // \param[in] bothTriangleSidesCollide true for double-sided meshes
306 // \param[in] checkObbIsAligned true to use a dedicated codepath for axis-aligned boxes
307 PX_FORCE_INLINE void intersectOBB(const TriangleMesh* mesh, const Box& obb, MeshHitCallback<PxGeomRaycastHit>& callback, bool bothTriangleSidesCollide, bool checkObbIsAligned = true)
308 {
309 const PxU32 index = PxU32(mesh->getConcreteType() - PxConcreteType::eTRIANGLE_MESH_BVH33);
310 gMidphaseBoxCBOverlapTable[index](mesh, obb, callback, bothTriangleSidesCollide, checkObbIsAligned);
311 }
312
313 // \param[in] mesh tetrahedron mesh
314 // \param[in] box box
315 // \param[in] callback callback object, called each time a hit is found
316 PX_FORCE_INLINE void intersectOBB(const TetrahedronMesh* mesh, const Box& obb, TetMeshHitCallback<PxGeomRaycastHit>& callback)
317 {
318 intersectOBB_BV4(mesh, obb, callback);
319 }
320
321 // \param[in] mesh triangle mesh
322 // \param[in] meshGeom geometry object associated with the mesh
323 // \param[in] meshTransform pose/transform of geometry object
324 // \param[in] capsule swept capsule
325 // \param[in] unitDir sweep's unit dir
326 // \param[in] distance sweep's length/max distance
327 // \param[out] sweepHit hit result
328 // \param[in] hitFlags query behavior flags
329 // \param[in] inflation optional inflation value for swept shape
330 // \return true if a hit was found, false otherwise
331 PX_FORCE_INLINE bool sweepCapsuleVsMesh(const TriangleMesh* mesh, const PxTriangleMeshGeometry& meshGeom, const PxTransform& meshTransform,
332 const Gu::Capsule& capsule, const PxVec3& unitDir, const PxReal distance,
333 PxGeomSweepHit& sweepHit, PxHitFlags hitFlags, const PxReal inflation)
334 {
335 const PxU32 index = PxU32(mesh->getConcreteType() - PxConcreteType::eTRIANGLE_MESH_BVH33);
336 return gMidphaseCapsuleSweepTable[index](mesh, meshGeom, meshTransform, capsule, unitDir, distance, sweepHit, hitFlags, inflation);
337 }
338
339 // \param[in] mesh triangle mesh
340 // \param[in] meshGeom geometry object associated with the mesh
341 // \param[in] meshTransform pose/transform of geometry object
342 // \param[in] box swept box
343 // \param[in] unitDir sweep's unit dir
344 // \param[in] distance sweep's length/max distance
345 // \param[out] sweepHit hit result
346 // \param[in] hitFlags query behavior flags
347 // \param[in] inflation optional inflation value for swept shape
348 // \return true if a hit was found, false otherwise
349 PX_FORCE_INLINE bool sweepBoxVsMesh(const TriangleMesh* mesh, const PxTriangleMeshGeometry& meshGeom, const PxTransform& meshTransform,
350 const Gu::Box& box, const PxVec3& unitDir, const PxReal distance,
351 PxGeomSweepHit& sweepHit, PxHitFlags hitFlags, const PxReal inflation)
352 {
353 const PxU32 index = PxU32(mesh->getConcreteType() - PxConcreteType::eTRIANGLE_MESH_BVH33);
354 return gMidphaseBoxSweepTable[index](mesh, meshGeom, meshTransform, box, unitDir, distance, sweepHit, hitFlags, inflation);
355 }
356
357 // \param[in] mesh triangle mesh
358 // \param[in] hullBox hull's bounding box
359 // \param[in] localDir sweep's unit dir, in local/mesh space
360 // \param[in] distance sweep's length/max distance
361 // \param[in] callback callback object, called each time a hit is found
362 // \param[in] anyHit true for PxHitFlag::eMESH_ANY queries
363 PX_FORCE_INLINE void sweepConvexVsMesh(const TriangleMesh* mesh, const Gu::Box& hullBox, const PxVec3& localDir, const PxReal distance, SweepConvexMeshHitCallback& callback, bool anyHit)
364 {
365 const PxU32 index = PxU32(mesh->getConcreteType() - PxConcreteType::eTRIANGLE_MESH_BVH33);
366 gMidphaseConvexSweepTable[index](mesh, hullBox, localDir, distance, callback, anyHit);
367 }
368
369 PX_FORCE_INLINE void pointMeshDistance(const TriangleMesh* mesh, const PxTriangleMeshGeometry& meshGeom, const PxTransform& pose, const PxVec3& point, float maxDist
370 , PxU32& closestIndex, float& dist, PxVec3& closestPt)
371 {
372 const PxU32 index = PxU32(mesh->getConcreteType() - PxConcreteType::eTRIANGLE_MESH_BVH33);
373 gMidphasePointMeshTable[index](mesh, meshGeom, pose, point, maxDist, closestIndex, dist, closestPt);
374 }
375}
376}
377}
378#endif // GU_MIDPHASE_INTERFACE_H
Represents an oriented bounding box.
Definition GuBox.h:72
Represents a capsule.
Definition GuCapsule.h:47
Definition GuSphere.h:46
Definition GuTetrahedronMesh.h:120
Definition GuTriangleMesh.h:78
A class expressing a nonuniform scaling transformation.
Definition PxMeshScale.h:69
Base class for callback reporting an unknown number of items to users.
Definition PxReportCallback.h:60
class representing a rigid euclidean transform as a quaternion and a vector
Definition PxTransform.h:49
Triangle mesh geometry class.
Definition PxTriangleMeshGeometry.h:81
3 Element vector class.
Definition PxVec3.h:50
#define PX_RESTRICT
Definition PxPreprocessor.h:355
#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
bool PxAgain
Describes query behavior after returning a partial query result via a callback.
Definition PxQueryReport.h:78
Definition GuMidphaseInterface.h:57
Definition GuMidphaseInterface.h:98
Definition GuMidphaseInterface.h:61
Definition GuSweepMesh.h:117
Definition GuMidphaseInterface.h:78
Stores results of raycast queries.
Definition PxGeometryHit.h:151
Stores results of sweep queries.
Definition PxGeometryHit.h:175