Ejemplo n.º 1
0
        /// <summary>
        /// Creates a player camera from a free camera.
        /// </summary>
        /// <param name="freeCamera">The free camera to use as a basis.</param>
        /// <param name="player">The player to attach to.</param>
        /// <returns></returns>
        internal static PlayerCamera FromFreeCamera(FreeCamera freeCamera, Player player)
        {
            var pc = new PlayerCamera(player);

            pc._yaw   = freeCamera.Yaw;
            pc._pitch = freeCamera.Pitch;
            return(pc);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a free camera from a player camera.
        /// </summary>
        /// <param name="playerCamera">The player camera to use as a basis.</param>
        /// <returns></returns>
        internal static FreeCamera FromPlayerCamera(PlayerCamera playerCamera)
        {
            var fc = new FreeCamera(playerCamera.Player.EyePosition);

            fc._yaw   = playerCamera.Yaw;
            fc._pitch = playerCamera.Pitch;
            return(fc);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Disables no-clip.
        /// </summary>
        private void DisableNoClip()
        {
            var fc = _camera as FreeCamera;

            _position    = fc.Position;
            _position.Y -= PlayerSizeY / 3.0f;

            _camera = PlayerCamera.FromFreeCamera(fc, this);
            _camera.Update(null);

            _isNoClipEnabled = false;
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a free camera from a player camera.
 /// </summary>
 /// <param name="playerCamera">The player camera to use as a basis.</param>
 /// <returns></returns>
 internal static FreeCamera FromPlayerCamera( PlayerCamera playerCamera )
 {
     var fc = new FreeCamera( playerCamera.Player.EyePosition );
     fc._yaw = playerCamera.Yaw;
     fc._pitch = playerCamera.Pitch;
     return fc;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Creates a player camera from a free camera.
 /// </summary>
 /// <param name="freeCamera">The free camera to use as a basis.</param>
 /// <param name="player">The player to attach to.</param>
 /// <returns></returns>
 internal static PlayerCamera FromFreeCamera( FreeCamera freeCamera, Player player )
 {
     var pc = new PlayerCamera( player );
     pc._yaw = freeCamera.Yaw;
     pc._pitch = freeCamera.Pitch;
     return pc;
 }