private void ViewCubeClicked(Vector3 lookDirection, Vector3 upDirection) { var target = CameraCore.Position + CameraCore.LookDirection; float distance = CameraCore.LookDirection.Length(); lookDirection *= distance; var newPosition = target - lookDirection; CameraCore.AnimateTo(newPosition, lookDirection, upDirection, 500); }
/// <summary> /// Looks at. /// </summary> /// <param name="camera">The camera.</param> /// <param name="target">The target.</param> /// <param name="newLookDirection">The new look direction.</param> /// <param name="newUpDirection">The new up direction.</param> /// <param name="animationTime">The animation time.</param> public static void LookAt( this CameraCore camera, Vector3 target, Vector3 newLookDirection, Vector3 newUpDirection, float animationTime) { Vector3 newPosition = target - newLookDirection; camera.AnimateTo(newPosition, newLookDirection, newUpDirection, animationTime); }