protected override void OnSystemAdd() { physicsSystem = (Bullet2PhysicsSystem)Services.GetSafeServiceAs <IPhysicsSystem>(); simulation = physicsSystem.Create(this); //setup debug device and debug shader //var gfxDevice = Services.GetSafeServiceAs<IGraphicsDeviceService>(); //Simulation.DebugGraphicsDevice = gfxDevice.GraphicsDevice; }
protected override void OnSystemAdd() { physicsSystem = (Bullet2PhysicsSystem)Services.GetSafeServiceAs <IPhysicsSystem>(); renderSystem = Services.GetSafeServiceAs <RenderSystem>(); //setup debug device and debug shader var gfxDevice = Services.GetSafeServiceAs <IGraphicsDeviceService>(); physicsSystem.PhysicsEngine.DebugGraphicsDevice = gfxDevice.GraphicsDevice; //Debug primitives render, should happen about the last steps of the pipeline renderSystem.Pipeline.EndPass += DebugShapesDraw; }
protected override void OnSystemAdd() { try { physicsSystem = (Bullet2PhysicsSystem)Services.GetSafeServiceAs <IPhysicsSystem>(); } catch (ServiceNotFoundException) { physicsSystem = new Bullet2PhysicsSystem(Services); var game = Services.GetSafeServiceAs <IGame>(); game.GameSystems.Add(physicsSystem); } simulation = physicsSystem.Create(this); //setup debug device and debug shader //var gfxDevice = Services.GetSafeServiceAs<IGraphicsDeviceService>(); //Simulation.DebugGraphicsDevice = gfxDevice.GraphicsDevice; }