コード例 #1
0
        protected override void Update(GameTime gameTime)
        {
            MouseState    mouse    = Mouse.GetState();
            KeyboardState keyboard = Keyboard.GetState();
            float         dt       = (float)gameTime.ElapsedGameTime.TotalSeconds;

            Camera.Update(ref mouse, ref keyboard, gameTime);
            view = Camera.View;
            proj = Camera.Projection;
            // TODO: Add your update logic here
            if (keyboard.IsKeyDown(Keys.F9))
            {
                Debugger.Break();
            }
            if (keyboard.IsKeyDown(Keys.F8))
            {
                allowdebugging = true;
            }

            if (StairsHitbox.Contains(Camera.Position) == ContainmentType.Contains)
            {
                Camera.Position = new Vector3(7.7071533f, 7f, -7.641618f) + (Camera.Position - StairsHitbox.Center);
            }
            if (Illusion1Hitbox.Contains(Camera.Position) == ContainmentType.Contains)
            {
                Camera.Position = new Vector3(-13.212797f, 0.68984985f, -14.558798f) + (Camera.Position - Illusion1Hitbox.Center);
            }
            if (Illusion2Hitbox.Contains(Camera.Position) == ContainmentType.Contains)
            {
                Camera.Position = new Vector3(-12.98f, 0.68984985f, -19.84f) + (Camera.Position - Illusion2Hitbox.Center);
            }
            if (Camera.CameraFrustum.Contains(new Vector3(3.96f, 0.76f, -6.12f)) != ContainmentType.Disjoint ||
                Camera.CameraFrustum.Contains(new Vector3(4.67f, 0.17f, -6.12f)) != ContainmentType.Disjoint)
            {
                if (MollerTrumbore.RayMeshCollision(new Ray(Camera.Position, Camera.LookDir), StairsCol2.Model, Matrix.Identity) != null)
                {
                    _illusion_visible = true;
                }
            }
            else
            {
                _illusion_visible = false;
            }

            Space.Update(dt);
            base.Update(gameTime);
        }
コード例 #2
0
 private void Update()
 {
     m_space.Update();
 }