MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / getTriangle

Method getTriangle

physx/source/geomutils/src/mesh/GuMeshQuery.cpp:103–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101} // namespace
102
103void physx::PxMeshQuery::getTriangle(const PxTriangleMeshGeometry& triGeom, const PxTransform& globalPose, PxTriangleID triangleIndex, PxTriangle& triangle, PxU32* vertexIndices, PxU32* adjacencyIndices)
104{
105 TriangleMesh* tm = static_cast<TriangleMesh*>(triGeom.triangleMesh);
106
107 PX_CHECK_AND_RETURN(triangleIndex<tm->getNbTriangles(), "PxMeshQuery::getTriangle: triangle index is out of bounds");
108
109 if(adjacencyIndices && !tm->getAdjacencies())
110 Ps::getFoundation().error(PxErrorCode::eINVALID_OPERATION, __FILE__, __LINE__, "Adjacency information not created. Set buildTriangleAdjacencies on Cooking params.");
111
112 const Cm::Matrix34 vertex2worldSkew = globalPose * triGeom.scale;
113 tm->computeWorldTriangle(triangle, triangleIndex, vertex2worldSkew, triGeom.scale.hasNegativeDeterminant(), vertexIndices, adjacencyIndices);
114}
115
116///////////////////////////////////////////////////////////////////////////////
117

Callers 15

onEventMethod · 0.45
buildFromMeshMethod · 0.45
BuildBV4FromRootFunction · 0.45
refitMethod · 0.45
onEventMethod · 0.45
onEventMethod · 0.45
onEventMethod · 0.45
onEventMethod · 0.45
SweepAnyShapeHeightfieldFunction · 0.45

Calls 5

getAdjacenciesMethod · 0.80
errorMethod · 0.80
computeWorldTriangleMethod · 0.80
getNbTrianglesMethod · 0.45

Tested by 1

onEventMethod · 0.36