| 925 | /////////////////////////////////////////////////////////////////////////////// |
| 926 | |
| 927 | void SampleSubmarine::helpRender(PxU32 x, PxU32 y, PxU8 textAlpha) |
| 928 | { |
| 929 | SampleRenderer::Renderer* renderer = getRenderer(); |
| 930 | const PxU32 yInc = 18; |
| 931 | const PxReal scale = 0.5f; |
| 932 | const PxReal shadowOffset = 6.0f; |
| 933 | const RendererColor textColor(255, 255, 255, textAlpha); |
| 934 | const bool isMouseSupported = getApplication().getPlatform()->getSampleUserInput()->mouseSupported(); |
| 935 | const bool isPadSupported = getApplication().getPlatform()->getSampleUserInput()->gamepadSupported(); |
| 936 | const char* msg; |
| 937 | |
| 938 | msg = mApplication.inputInfoMsg("Press "," to toggle various debug visualization", TOGGLE_VISUALIZATION, -1); |
| 939 | if(msg) |
| 940 | renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor); |
| 941 | msg = mApplication.inputInfoMsg("Press "," to restart", SCENE_RESET,-1); |
| 942 | if(msg) |
| 943 | renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor); |
| 944 | if (isMouseSupported && isPadSupported) |
| 945 | renderer->print(x, y += yInc, "Use mouse or right stick to rotate the camera", scale, shadowOffset, textColor); |
| 946 | else if (isMouseSupported) |
| 947 | renderer->print(x, y += yInc, "Use mouse to rotate the camera", scale, shadowOffset, textColor); |
| 948 | else if (isPadSupported) |
| 949 | renderer->print(x, y += yInc, "Use right stick to rotate the camera", scale, shadowOffset, textColor); |
| 950 | msg = mApplication.inputInfoMsg("Press "," to switch between submarine/crab/flyCam", CAMERA_SWITCH, -1); |
| 951 | if(msg) |
| 952 | renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor); |
| 953 | |
| 954 | if(mCameraAttachedToActor == mSubmarineActor) |
| 955 | { |
| 956 | renderer->print(x, y += yInc, "Submarine Controller:", scale, shadowOffset, textColor); |
| 957 | const char* msg = mApplication.inputInfoMsg("Press "," to move along view direction", SUBMARINE_FORWARD, SUBMARINE_BACKWARD); |
| 958 | if(msg) |
| 959 | renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor); |
| 960 | msg = mApplication.inputInfoMsg("Press "," to raise and dive", SUBMARINE_UP, SUBMARINE_DOWN); |
| 961 | if(msg) |
| 962 | renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor); |
| 963 | } |
| 964 | else if(gCrab && (mCameraAttachedToActor == gCrab->getCrabBody())) |
| 965 | { |
| 966 | renderer->print(x, y += yInc, "Crab Controller:", scale, shadowOffset, textColor); |
| 967 | if (isPadSupported) |
| 968 | renderer->print(x, y += yInc, "Use left stick to move the crab", scale, shadowOffset, textColor); |
| 969 | const char* msg = mApplication.inputMoveInfoMsg("Press "," to move the crab", CRAB_FORWARD, CRAB_BACKWARD, CRAB_LEFT, CRAB_RIGHT); |
| 970 | if(msg) |
| 971 | renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor); |
| 972 | } |
| 973 | else |
| 974 | { |
| 975 | renderer->print(x, y += yInc, "Fly Cam Controller:", scale, shadowOffset, textColor); |
| 976 | if (isPadSupported) |
| 977 | renderer->print(x, y += yInc, "Use left stick to move",scale, shadowOffset, textColor); |
| 978 | const char* msg = mApplication.inputMoveInfoMsg("Press "," to move", CAMERA_MOVE_FORWARD,CAMERA_MOVE_BACKWARD, CAMERA_MOVE_LEFT, CAMERA_MOVE_RIGHT); |
| 979 | if(msg) |
| 980 | renderer->print(x, y += yInc, msg,scale, shadowOffset, textColor); |
| 981 | msg = mApplication.inputInfoMsg("Press "," to move fast", CAMERA_SHIFT_SPEED, -1); |
| 982 | if(msg) |
| 983 | renderer->print(x, y += yInc, msg, scale, shadowOffset, textColor); |
| 984 | } |
nothing calls this directly
no test coverage detected