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

Method helpRender

physx/samples/samplelargeworld/SampleLargeWorld.cpp:606–662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

604}
605
606void SampleLargeWorld::helpRender(PxU32 x, PxU32 y, PxU8 textAlpha)
607{
608 Renderer* renderer = getRenderer();
609 const PxU32 yInc = 18;
610 const PxReal scale = 0.5f;
611 const PxReal shadowOffset = 6.0f;
612 const RendererColor textColor(255, 255, 255, textAlpha);
613 const bool isMouseSupported = getApplication().getPlatform()->getSampleUserInput()->mouseSupported();
614 const bool isPadSupported = getApplication().getPlatform()->getSampleUserInput()->gamepadSupported();
615 const char* msg;
616
617 if (isMouseSupported && isPadSupported)
618 renderer->print(x, y += yInc, "Use mouse or right stick to rotate", scale, shadowOffset, textColor);
619 else if (isMouseSupported)
620 renderer->print(x, y += yInc, "Use mouse to rotate", scale, shadowOffset, textColor);
621 else if (isPadSupported)
622 renderer->print(x, y += yInc, "Use right stick to rotate", scale, shadowOffset, textColor);
623 if (isPadSupported)
624 renderer->print(x, y += yInc, "Use left stick to move",scale, shadowOffset, textColor);
625 msg = mApplication.inputMoveInfoMsg("Press "," to move", CAMERA_MOVE_FORWARD,CAMERA_MOVE_BACKWARD, CAMERA_MOVE_LEFT, CAMERA_MOVE_RIGHT);
626 if(msg)
627 renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor);
628 msg = mApplication.inputInfoMsg("Press "," to move fast", CAMERA_SHIFT_SPEED, -1);
629 if(msg)
630 renderer->print(x, y += yInc, msg, scale, shadowOffset, textColor);
631 msg = mApplication.inputInfoMsg("Press "," to throw an object", SPAWN_DEBUG_OBJECT, -1);
632 if(msg)
633 renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor);
634
635 msg = mApplication.inputInfoMsg("Press "," to toggle fly camera", FLY_CAMERA, -1);
636 if(msg)
637 renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor);
638
639 msg = mApplication.inputInfoMsg("Press "," to increase fly camera speed", CAMERA_SPEED_INCREASE, -1);
640 if(msg)
641 renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor);
642
643 msg = mApplication.inputInfoMsg("Press "," to decrease fly camera speed", CAMERA_SPEED_DECREASE, -1);
644 if(msg)
645 renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor);
646
647 msg = mApplication.inputInfoMsg("Press "," to reset CCT position", RETRY, -1);
648 if(msg)
649 renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor);
650
651 msg = mApplication.inputInfoMsg("Press "," to throw an important object", THROW_IMPORTANTOBJECT, -1);
652 if(msg)
653 renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor);
654
655 msg = mApplication.inputInfoMsg("Press "," to throw an unimportant object", THROW_UNIMPORTANCTOBJECT, -1);
656 if(msg)
657 renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor);
658
659 msg = mApplication.inputInfoMsg("Press "," to pick up the nearest objects maximum=5, or release objects", PICK_NEARSETOBJECT, -1);
660 if(msg)
661 renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor);
662}
663

Callers

nothing calls this directly

Calls 7

getSampleUserInputMethod · 0.80
getPlatformMethod · 0.80
inputMoveInfoMsgMethod · 0.80
inputInfoMsgMethod · 0.80
mouseSupportedMethod · 0.45
gamepadSupportedMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected