MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / visualize

Method visualize

deps/physx/physx/source/physx/src/NpRigidDynamic.cpp:556–577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

554
555#if PX_ENABLE_DEBUG_VISUALIZATION
556void NpRigidDynamic::visualize(Cm::RenderOutput& out, NpScene* npScene)
557{
558 NpRigidDynamicT::visualize(out, npScene);
559
560 if (getScbBodyFast().getActorFlags() & PxActorFlag::eVISUALIZATION)
561 {
562 PX_ASSERT(npScene);
563 const PxReal scale = npScene->getVisualizationParameter(PxVisualizationParameter::eSCALE);
564
565 const PxReal massAxes = scale * npScene->getVisualizationParameter(PxVisualizationParameter::eBODY_MASS_AXES);
566 if (massAxes != 0.0f)
567 {
568 PxReal sleepTime = getScbBodyFast().getWakeCounter() / npScene->getWakeCounterResetValueInteral();
569 PxU32 color = PxU32(0xff * (sleepTime>1.0f ? 1.0f : sleepTime));
570 color = getScbBodyFast().isSleeping() ? 0xff0000 : (color<<16 | color<<8 | color);
571 PxVec3 dims = invertDiagInertia(getScbBodyFast().getInverseInertia());
572 dims = getDimsFromBodyInertia(dims, 1.0f / getScbBodyFast().getInverseMass());
573
574 out << color << getScbBodyFast().getBody2World() << Cm::DebugBox(dims * 0.5f);
575 }
576 }
577}
578#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