/// <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); }
/// <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); }
/// <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; }
/// <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; }
/// <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; }