Esempio n. 1
0
        protected override void OnInitialize()
        {
            PhysicsContext = new Physics();
            DebugDrawMode = debugMode;

            light = new Light();
            light.Type = LightType.Point;
            light.Range = 140;
            light.Position = new Vector3(10, 30, 50);
            light.Diffuse = Color.LemonChiffon;
            light.Attenuation0 = 1.0f;

            softBodyMaterial = new Material();
            softBodyMaterial.Diffuse = Color.White;
            softBodyMaterial.Ambient = new Color4(Ambient);

            flagTex = Texture.FromFile(Device, "bullet_logo.png");

            FarPlane = 200f;
            Freelook.SetEyeTarget(eye, target);

            Fps.Text = "Move using mouse and WASD+shift\n" +
                "F3 - Toggle debug\n" +
                "F11 - Toggle fullscreen\n" +
                "Space - Shoot box";

            base.OnInitialize();
        }
Esempio n. 2
0
        protected override void OnInitialize()
        {
            Physics = new Physics();
            Physics.World.SetInternalTickCallback(PickingPreTickCallback, this, true);

            light = new Light();
            light.Type = LightType.Point;
            light.Range = 75;
            light.Position = new Vector3(10, 25, 0);
            light.Diffuse = Color.LemonChiffon;
            light.Attenuation0 = 1.0f;

            softBodyMaterial = new SlimDX.Direct3D9.Material();
            softBodyMaterial.Diffuse = Color.White;
            softBodyMaterial.Ambient = new Color4(Ambient);

            Fps.Text = "Move using mouse and WASD+shift\n" +
                "F3 - Toggle debug\n" +
                "F11 - Toggle fullscreen\n" +
                "Space - Shoot box\n\n" +
                "B - Previous Demo\n" +
                "N - Next Demo";

            Freelook.SetEyeTarget(eye, target);

            base.OnInitialize();
        }
Esempio n. 3
0
        protected override void OnInitialize()
        {
            Physics = new Physics(this);

            wheel = Mesh.CreateCylinder(Device, Physics.wheelRadius, Physics.wheelRadius, Physics.wheelWidth, 10, 10);

            Ambient = Color.Black.ToArgb();

            light = new Light();
            light.Type = LightType.Point;
            light.Range = 500;
            light.Position = new Vector3(0, 100, 0);
            light.Direction = -Vector3.UnitY;
            light.Diffuse = Color.White;
            light.Attenuation0 = 0.75f;

            bodyMaterial = new Material();
            bodyMaterial.Diffuse = Color.Blue;
            bodyMaterial.Ambient = new Color4(Ambient);

            wheelMaterial = new Material();
            wheelMaterial.Diffuse = Color.Red;
            wheelMaterial.Ambient = new Color4(Ambient);

            Fps.Text = "F2 - Toggle view mode: Tracking\n" +
                "F3 - Toggle debug\n" +
                "F11 - Toggle fullscreen";

            FarPlane = 600f;
            Freelook.SetEyeTarget(new Vector3(30, 10, 0), target);

            base.OnInitialize();
        }
Esempio n. 4
0
        protected override void OnInitialize()
        {
            Physics = new Physics();
            IsDebugDrawEnabled = true;

            light = new Light();
            light.Type = LightType.Point;
            light.Range = 70;
            light.Position = new Vector3(10, 25, 10);
            light.Diffuse = Color.LemonChiffon;
            light.Attenuation0 = 0.5f;

            Freelook.SetEyeTarget(eye, target);

            base.OnInitialize();
        }
Esempio n. 5
0
        protected override void OnInitialize()
        {
            Physics = new Physics();

            light = new Light();
            light.Type = LightType.Point;
            light.Range = 400;
            light.Position = new Vector3(10, 25, 10);
            light.Diffuse = Color.LemonChiffon;
            light.Attenuation0 = 1.0f;

            Fps.Text = fpsText + "\nCCD enabled (P to disable)";

            Freelook.SetEyeTarget(eye, Vector3.Zero);

            base.OnInitialize();
        }
Esempio n. 6
0
        protected override void OnInitialize()
        {
            PhysicsContext = new Physics();

            light = new Light();
            light.Type = LightType.Point;
            light.Range = 70;
            light.Position = new Vector3(10, 25, 10);
            light.Diffuse = Color.LemonChiffon;
            light.Attenuation0 = 1.0f;

            Freelook.SetEyeTarget(eye, target);

            Fps.Text = "Move using mouse and WASD+shift\n" +
                "F3 - Toggle debug\n" +
                "F11 - Toggle fullscreen\n" +
                "Space - Shoot box";

            base.OnInitialize();
        }
Esempio n. 7
0
        protected override void OnInitialize()
        {
            Physics = new Physics();

            light = new Light();
            light.Type = LightType.Directional;
            light.Range = 500;
            light.Position = new Vector3(50, 50, 0);
            light.Direction = new Vector3(0, -1, 0);
            light.Diffuse = Color.LemonChiffon;
            light.Attenuation0 = 0.5f;

            FarPlane = 800f;
            Freelook.SetEyeTarget(eye, target);

            Fps.Text = "Move using mouse and WASD+shift\n" +
                "F3 - Toggle debug\n" +
                "F11 - Toggle fullscreen\n" +
                "Space - Shoot box\n" +
                ". - Shoot Bunny";

            base.OnInitialize();
        }
Esempio n. 8
0
        void RenderLight(Light light)
        {
            lightWorldVar.SetMatrixTranspose(light.World);
            lightPositionRadiusVar.Set(new Vector4(light.Position, light.Radius));
            lightColorVar.Set(light.Color);
            lightAccumulationPass.Apply(_immediateContext);

            _immediateContext.DrawIndexed(pointLightVolumeIndices.Length, 0, 0);
        }