示例#1
0
        public void UpdatePositions(float t)
        {
            collisionSystem.RecalculateCollisions(0);
            collisionSystem.RecalculateClosestCollision();
            Vector3d direction    = PlayerSphere.Direction;
            float?   newRotationY = collisionSystem.Update(RotationY, t);

            if (direction != PlayerSphere.Direction)
            {
                //Vector3d direction = new Vector3d();
                //direction.Set(s1.Direction);
                //direction.Normalize();
                //
                //CollisionForm.RotationY = rotationY;
                //CollisionForm.NewRotationY = 57.29577f * (float)Math.Atan2(direction.X, direction.Z);

                //direction = new Vector3d(PlayerSphere.Direction);
                //direction.Set(PlayerSphere.Direction);
                //direction.Normalize();
                float rotationY = 57.29577f * (float)Math.Atan2(PlayerSphere.Direction.Z, PlayerSphere.Direction.X);
                Console.WriteLine($"Update.Direction {direction.ToString("")}");
                Console.WriteLine($"Update.Reaction {PlayerSphere.Direction.ToString("")}");
                Console.WriteLine($"Update.Rotation {RotationY} -> {rotationY}");

                if (newRotationY.HasValue && newRotationY.Value != rotationY)
                {
                    //System.Diagnostics.Debugger.Break();
                }

                RotationY = rotationY;
                UpdateDirections();
            }
        }
示例#2
0
 public void Update()
 {
     Vehicle.Update();
     CollisionSystem.Update(0, 1);
 }