Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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;
        }