| 476 | /////////////////////////////////////////////////////////////////////////////// |
| 477 | |
| 478 | void SampleBridges::onInit() |
| 479 | { |
| 480 | PhysXSample::onInit(); |
| 481 | PxSceneWriteLock scopedLock(*mScene); |
| 482 | |
| 483 | mApplication.setMouseCursorHiding(true); |
| 484 | mApplication.setMouseCursorRecentering(true); |
| 485 | |
| 486 | getRenderer()->setAmbientColor(RendererColor(170, 170, 170)); |
| 487 | // mScene->setGravity(PxVec3(0.0f, -98.1f, 0.0f)); |
| 488 | getActiveScene().setGravity(PxVec3(0.0f, -9.81f, 0.0f)); |
| 489 | |
| 490 | { |
| 491 | { |
| 492 | RAWTexture data; |
| 493 | data.mName = "rock_distance_diffuse.tga"; |
| 494 | RenderTexture* rockTexture = createRenderTextureFromRawTexture(data); |
| 495 | |
| 496 | mRockMaterial = SAMPLE_NEW(RenderMaterial)(*getRenderer(), PxVec3(1.0f, 1.0f, 1.0f), 1.0f, false, 0xffffffff, rockTexture); |
| 497 | mRenderMaterials.push_back(mRockMaterial); |
| 498 | } |
| 499 | |
| 500 | { |
| 501 | RAWTexture data; |
| 502 | data.mName = "pier_diffuse.dds"; |
| 503 | RenderTexture* woodTexture = createRenderTextureFromRawTexture(data); |
| 504 | |
| 505 | mWoodMaterial = SAMPLE_NEW(RenderMaterial)(*getRenderer(), PxVec3(1.0f, 1.0f, 1.0f), 1.0f, false, 0xffffffff, woodTexture); |
| 506 | mRenderMaterials.push_back(mWoodMaterial); |
| 507 | } |
| 508 | |
| 509 | { |
| 510 | RAWTexture data; |
| 511 | data.mName = "divingBoardFloor_diffuse.dds"; |
| 512 | RenderTexture* platformTexture = createRenderTextureFromRawTexture(data); |
| 513 | |
| 514 | mPlatformMaterial = SAMPLE_NEW(RenderMaterial)(*getRenderer(), PxVec3(1.0f, 1.0f, 1.0f), 1.0f, false, 0xffffffff, platformTexture); |
| 515 | mRenderMaterials.push_back(mPlatformMaterial); |
| 516 | } |
| 517 | |
| 518 | importRAWFile("SampleBridges.raw", gGlobalScale); |
| 519 | importRAWFile("sky_mission_race1.raw", 1.0f); |
| 520 | } |
| 521 | |
| 522 | #ifdef CCT_ON_BRIDGES |
| 523 | mControllerManager = PxCreateControllerManager(getActiveScene()); |
| 524 | |
| 525 | ControlledActorDesc desc; |
| 526 | desc.mType = PxControllerShapeType::eCAPSULE; |
| 527 | desc.mPosition = mControllerInitialPosition; |
| 528 | desc.mSlopeLimit = SLOPE_LIMIT; |
| 529 | desc.mContactOffset = CONTACT_OFFSET; |
| 530 | desc.mStepOffset = STEP_OFFSET; |
| 531 | desc.mInvisibleWallHeight = INVISIBLE_WALLS_HEIGHT; |
| 532 | desc.mMaxJumpHeight = MAX_JUMP_HEIGHT; |
| 533 | desc.mRadius = gControllerRadius; |
| 534 | desc.mHeight = gStandingSize; |
| 535 | desc.mCrouchHeight = gCrouchingSize; |
nothing calls this directly
no test coverage detected