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

Method helpRender

physx/samples/samplecustomgravity/SampleCustomGravity.cpp:261–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261void SampleCustomGravity::helpRender(PxU32 x, PxU32 y, PxU8 textAlpha)
262{
263 SampleRenderer::Renderer* renderer = getRenderer();
264 const PxU32 yInc = 18;
265 const PxReal scale = 0.5f;
266 const PxReal shadowOffset = 6.0f;
267 const RendererColor textColor(255, 255, 255, textAlpha);
268 const bool isMouseSupported = getApplication().getPlatform()->getSampleUserInput()->mouseSupported();
269 const bool isPadSupported = getApplication().getPlatform()->getSampleUserInput()->gamepadSupported();
270 const char* msg;
271
272 if (isMouseSupported && isPadSupported)
273 renderer->print(x, y += yInc, "Use mouse or right stick to rotate the camera", scale, shadowOffset, textColor);
274 else if (isMouseSupported)
275 renderer->print(x, y += yInc, "Use mouse to rotate the camera", scale, shadowOffset, textColor);
276 else if (isPadSupported)
277 renderer->print(x, y += yInc, "Use right stick to rotate the camera", scale, shadowOffset, textColor);
278 if (isPadSupported)
279 renderer->print(x, y += yInc, "Use left stick to move",scale, shadowOffset, textColor);
280 msg = mApplication.inputMoveInfoMsg("Press "," to move", CAMERA_MOVE_FORWARD,CAMERA_MOVE_BACKWARD, CAMERA_MOVE_LEFT, CAMERA_MOVE_RIGHT);
281 if(msg)
282 renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor);
283 msg = mApplication.inputInfoMsg("Press "," to move fast", CAMERA_SHIFT_SPEED, -1);
284 if(msg)
285 renderer->print(x, y += yInc, msg, scale, shadowOffset, textColor);
286 msg = mApplication.inputInfoMsg("Press "," to jump", CAMERA_JUMP,-1);
287 if(msg)
288 renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor);
289 msg = mApplication.inputInfoMsg("Press "," to throw an object", SPAWN_DEBUG_OBJECT, -1);
290 if(msg)
291 renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor);
292}
293
294void SampleCustomGravity::descriptionRender(PxU32 x, PxU32 y, PxU8 textAlpha)
295{

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