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

Method customizeRender

physx/samples/samplevehicle/SampleVehicle.cpp:955–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

953}
954
955void SampleVehicle::customizeRender()
956{
957 drawHud();
958 if(mDebugRenderFlag)
959 {
960 drawFocusVehicleGraphsAndPrintTireSurfaces();
961 }
962
963 const PxU32 width=getCamera().getScreenWidth();
964 const PxU32 height=getCamera().getScreenHeight();
965
966 const PxU32 xCentre=280*width/800;
967 const PxU32 xRight=570*width/800;
968 const PxU32 yBottom=600*height/600;
969
970 const PxU32 yInc=18;
971
972 Renderer* renderer = getRenderer();
973
974 char time[64];
975 sprintf(time, "Curr Lap Time: %1.1f \n", mWayPoints.getTimeElapsed());
976 renderer->print(xRight, yBottom - yInc*2, time);
977 sprintf(time, "Best Lap Time: %1.1f \n", mWayPoints.getMinTimeElapsed());
978 renderer->print(xRight, yBottom - yInc*3, time);
979
980 if(!mCameraController.getIsLockedOnVehicleTransform())
981 {
982 renderer->print(xCentre, yBottom - yInc*4, "Camera decoupled from car");
983 }
984}
985
986///////////////////////////////////////////////////////////////////////////////
987

Callers

nothing calls this directly

Calls 6

getScreenWidthMethod · 0.80
getScreenHeightMethod · 0.80
getTimeElapsedMethod · 0.80
getMinTimeElapsedMethod · 0.80
printMethod · 0.45

Tested by

no test coverage detected