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

Method drawDebug

physx/samples/samplebase/RenderBaseActor.cpp:235–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235void RenderBaseActor::drawDebug(RenderPhysX3Debug* debug)
236{
237// return;
238
239 if(!mPhysicsShape)
240 return;
241
242 if(0 && mEnableCCD)
243 {
244 const PxBounds3 bounds = PxShapeExt::getWorldBounds(*mPhysicsShape, *mPhysicsActor);
245 const PxReal scale = (bounds.maximum - bounds.minimum).magnitude();
246
247 const PxTransform pose = PxShapeExt::getGlobalPose(*mPhysicsShape, *mPhysicsActor);
248 debug->addLine(pose.p, pose.p+PxVec3(scale, 0.0f, 0.0f), RendererColor(0, 255, 0));
249 debug->addLine(pose.p, pose.p+PxVec3(0.0f, scale, 0.0f), RendererColor(0, 255, 0));
250 debug->addLine(pose.p, pose.p+PxVec3(0.0f, 0.0f, scale), RendererColor(0, 255, 0));
251
252 const PxVec3 shapeCenter = getShapeCenter(mPhysicsActor, mPhysicsShape, mCCDWitnessOffset);
253//shdfnd::printFormatted("Render: %f | %f | %f\n", shapeCenter.x, shapeCenter.y, shapeCenter.z);
254
255 debug->addLine(shapeCenter, shapeCenter+PxVec3(scale, 0.0f, 0.0f), RendererColor(255, 0, 0));
256 debug->addLine(shapeCenter, shapeCenter+PxVec3(0.0f, scale, 0.0f), RendererColor(255, 0, 0));
257 debug->addLine(shapeCenter, shapeCenter+PxVec3(0.0f, 0.0f, scale), RendererColor(255, 0, 0));
258 return;
259 }
260
261/*
262 BasicRandom rnd(42);
263
264 const PxTransform globalShapePose = PxShapeExt::getGlobalPose(*mPhysicsShape);
265
266 const RendererColor colorPurple(255, 0, 255);
267 for(PxU32 i=0;i<50;i++)
268 {
269 PxVec3 dir;
270 rnd.unitRandomPt(dir);
271
272 PxVec3 localCenter;
273 const PxReal internalRadius = computeInternalRadius(mPhysicsShape, dir, localCenter, mCCDWitnessOffset);
274
275 const PxVec3 center = globalShapePose.transform(localCenter);
276
277 debug->addLine(center, center+dir*internalRadius, colorPurple);
278 }*/
279}

Callers

nothing calls this directly

Calls 5

addLineMethod · 0.80
RendererColorClass · 0.70
getShapeCenterFunction · 0.70
PxVec3Class · 0.50
magnitudeMethod · 0.45

Tested by

no test coverage detected