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

Method visualize

physx/source/physx/src/NpRigidDynamic.cpp:544–565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542
543#if PX_ENABLE_DEBUG_VISUALIZATION
544void NpRigidDynamic::visualize(Cm::RenderOutput& out, NpScene* npScene)
545{
546 NpRigidDynamicT::visualize(out, npScene);
547
548 if (getScbBodyFast().getActorFlags() & PxActorFlag::eVISUALIZATION)
549 {
550 PX_ASSERT(npScene);
551 const PxReal scale = npScene->getVisualizationParameter(PxVisualizationParameter::eSCALE);
552
553 const PxReal massAxes = scale * npScene->getVisualizationParameter(PxVisualizationParameter::eBODY_MASS_AXES);
554 if (massAxes != 0.0f)
555 {
556 PxReal sleepTime = getScbBodyFast().getWakeCounter() / npScene->getWakeCounterResetValueInteral();
557 PxU32 color = PxU32(0xff * (sleepTime>1.0f ? 1.0f : sleepTime));
558 color = getScbBodyFast().isSleeping() ? 0xff0000 : (color<<16 | color<<8 | color);
559 PxVec3 dims = invertDiagInertia(getScbBodyFast().getInverseInertia());
560 dims = getDimsFromBodyInertia(dims, 1.0f / getScbBodyFast().getInverseMass());
561
562 out << color << getScbBodyFast().getBody2World() << Cm::DebugBox(dims * 0.5f);
563 }
564 }
565}
566#endif

Callers

nothing calls this directly

Calls 9

invertDiagInertiaFunction · 0.85
getDimsFromBodyInertiaFunction · 0.85
DebugBoxClass · 0.85
getInverseMassMethod · 0.80
visualizeFunction · 0.70
getActorFlagsMethod · 0.45
getWakeCounterMethod · 0.45
isSleepingMethod · 0.45

Tested by

no test coverage detected