Example #1
0
        public override void Prepare()
        {
            FOV = 15;
            SetAmbientLight(1, 1, 1, 0.0f);
            SetCameraPosition(0, 0, 50f);
            SetCameraTarget(0, 0, 0);

            //SetTextureSkybox(@".\textures\skybox1.dds");
            //SetTextureBackgroundBrightnessMultiplier(4);

            for (int i = 0; i < 5; i++)
            {
                Immovable c = new Immovable();
                c.SetModel("KWCube");
                c.SetPosition(i * 3f - 6f, 0, 0);
                c.SetScale(1, 1, 1);
                c.SetGlow(1, 1, 1, i / 5f);
                c.IsShadowCaster = false;
                AddGameObject(c);
            }

            for (int i = 0; i < 5; i++)
            {
                Immovable c = new Immovable();
                c.SetModel("KWCube");
                c.SetPosition(i * 3f - 6f, 4, 0);
                c.SetScale(0.25f, 0.075f, 0.5f);
                c.SetGlow(1, 1, 1, i / 5f);
                c.IsShadowCaster = false;
                AddGameObject(c);
            }

            DebugShowPerformanceInTitle = PerformanceUnit.FramesPerSecond;
        }
Example #2
0
        public override void Act(KeyboardState ks, MouseState ms)
        {
            if (ks[Key.Escape])
            {
                CurrentWindow.SetWorld(new GameWorldStart());
                return;
            }

            Vector3 mousepos3d = HelperIntersection.GetMouseIntersectionPoint(ms, Plane.Y, 1);

            _sphere.SetPosition(mousepos3d);
            if (HelperIntersection.IsPointInsideGameObject(mousepos3d, t))
            {
                t.SetGlow(1, 0, 0, 1);
            }
            else
            {
                t.SetGlow(1, 0, 0, 0);
            }
        }