FPhysXVehicleManager::FPhysXVehicleManager(PxScene* PhysXScene) : Scene(PhysXScene) , WheelRaycastBatchQuery(NULL) #if PX_DEBUG_VEHICLE_ON , TelemetryData4W(NULL) , TelemetryVehicle(NULL) #endif { // Set the correct basis vectors with Z up, X forward. It's very IMPORTANT to set the Ackermann axle separation and frontWidth, rearWidth accordingly PxVehicleSetBasisVectors( PxVec3(0,0,1), PxVec3(1,0,0) ); }
void phx::app::base::init() { neb::app::base::init(); // Physx // Foundation px_foundation_ = PxCreateFoundation( PX_PHYSICS_VERSION, px_default_allocator_callback_, px_default_error_callback_); assert(px_foundation_); bool recordMemoryAllocations = true; // Profile Zone Manager px_profile_zone_manager_ = &::physx::PxProfileZoneManager::createProfileZoneManager( px_foundation_ ); assert( px_profile_zone_manager_ ); // Physics px_physics_ = PxCreatePhysics( PX_PHYSICS_VERSION, *px_foundation_, physx::PxTolerancesScale(), recordMemoryAllocations, px_profile_zone_manager_ ); assert( px_physics_ ); // cooking /** @todo fix cooking signature */ auto scales = physx::PxTolerancesScale(); px_cooking_ = PxCreateCooking( PX_PHYSICS_VERSION, *px_foundation_, ::physx::PxCookingParams(scales) ); assert( px_cooking_ ); // Extensions assert( PxInitExtensions( *px_physics_ ) ); // character controller manager /** @todo fix cooking signature */ /* px_character_controller_manager_ = ::PxCreateControllerManager( *px_foundation_ ); assert( px_character_controller_manager_ );*/ // vehicle assert( PxInitVehicleSDK(*px_physics_) ); PxVehicleSetBasisVectors(physx::PxVec3(0,1,0), physx::PxVec3(0,0,-1)); PxVehicleSetUpdateMode(physx::PxVehicleUpdateMode::Enum::eACCELERATION); }