MCPcopy Create free account
hub / github.com/begla/Intrinsic / init

Method init

IntrinsicCore/src/IntrinsicCorePhysicsSystem.cpp:61–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59physx::PxScene* System::_pxScene;
60
61void System::init()
62{
63 static physx::PxDefaultAllocator defaultAllocator;
64
65 physx::PxTolerancesScale toleranceScale;
66
67 _pxFoundation = PxCreateFoundation(PX_FOUNDATION_VERSION, defaultAllocator,
68 _physXErrorCallback);
69 _INTR_ASSERT(_pxFoundation);
70
71 _pxPhysics = PxCreatePhysics(PX_PHYSICS_VERSION, *_pxFoundation,
72 toleranceScale, false, nullptr);
73 _INTR_ASSERT(_pxPhysics);
74
75 _pxCooking = PxCreateCooking(PX_PHYSICS_VERSION, *_pxFoundation,
76 physx::PxCookingParams(toleranceScale));
77 _INTR_ASSERT(_pxCooking);
78
79 physx::PxCookingParams params(_pxPhysics->getTolerancesScale());
80 params.meshCookingHint = physx::PxMeshCookingHint::eSIM_PERFORMANCE;
81 _pxCooking->setParams(params);
82
83 _pxCpuDispatcher = physx::PxDefaultCpuDispatcherCreate(
84 Application::_scheduler.GetNumTaskThreads());
85 _INTR_ASSERT(_pxCpuDispatcher);
86
87 physx::PxSceneDesc sceneDesc = physx::PxSceneDesc(toleranceScale);
88 sceneDesc.cpuDispatcher = _pxCpuDispatcher;
89 sceneDesc.gravity = physx::PxVec3(0.0f, -30.0f, 0.0f);
90 sceneDesc.filterShader = &physx::PxDefaultSimulationFilterShader;
91
92 _pxScene = _pxPhysics->createScene(sceneDesc);
93 _INTR_ASSERT(_pxScene);
94
95 // Updates internal PhysX parameters
96 setDebugRenderingFlags(_debugRenderingFlags);
97}
98
99// <-
100

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected