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

Method onInit

physx/samples/samplevehicle/SampleVehicle.cpp:393–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391///////////////////////////////////////////////////////////////////////////////
392
393void SampleVehicle::onInit()
394{
395 mNbThreads = PxMax(PxI32(shdfnd::Thread::getNbPhysicalCores())-1, 0);
396
397 PhysXSample::onInit();
398
399 PxSceneWriteLock scopedLock(*mScene);
400
401#if defined(SERIALIZE_VEHICLE_BINARY)
402 mMemory = NULL;
403#endif
404
405 //Create physx objects.
406 createStandardMaterials();
407 createVehicles();
408 createTrack(mTerrainSize, mTerrainWidth, mTerrainSize*4.0f);
409 createObstacles();
410
411 //Setup camera.
412 setCameraController(NULL);
413
414 //Setup debug render data.
415 setupTelemetryData();
416
417 //Setup the waypoint system.
418 mWayPoints.setWayPoints(gWayPoints,gNumWayPoints);
419
420 //Load the skydome.
421 gLoadType = LOAD_TYPE_SKYDOME;
422 importRAWFile("sky_mission_race1.raw", 1.0f);
423
424 //Set up the fog.
425 getRenderer()->setFog(SampleRenderer::RendererColor(40,40,40), 225.0f);
426}
427
428void SampleVehicle::newMesh(const RAWMesh& data)
429{

Callers

nothing calls this directly

Calls 5

PxMaxFunction · 0.85
getNbPhysicalCoresFunction · 0.85
setWayPointsMethod · 0.80
setFogMethod · 0.80
RendererColorClass · 0.50

Tested by

no test coverage detected