/// <summary> /// Gets a ViewPoint out of this camera object. /// </summary> public virtual Camera3DViewPoint GetViewPoint() { Camera3DViewPoint result = new Camera3DViewPoint(); result.Position = this.Position; result.Rotation = this.TargetRotation; return(result); }
/// <summary> /// Initializes a new instance of the <see cref="CameraStraightMoveAnimation"/> class. /// </summary> /// <param name="targetCamera">The camera to be animated.</param> /// <param name="targetViewPoint">The target view point.</param> /// <param name="animationTime">The animation time.</param> public CameraStraightMoveAnimation(Camera3DBase targetCamera, Camera3DViewPoint targetViewPoint, TimeSpan animationTime) : base(targetCamera, AnimationType.FixedTime, animationTime) { targetCamera.EnsureNotNull(nameof(targetCamera)); targetViewPoint.EnsureNotNull(nameof(targetViewPoint)); m_camera = targetCamera; m_cameraPerspective = m_camera as PerspectiveCamera3D; m_cameraOrthographic = m_camera as OrthographicCamera3D; m_viewPointSource = m_camera.GetViewPoint(); m_viewPointTarget = targetViewPoint; }
/// <summary> /// Applies the data from the given ViewPoint object. /// </summary> /// <param name="camera3DViewPoint">The ViewPoint to be applied.</param> public virtual void ApplyViewPoint(Camera3DViewPoint camera3DViewPoint) { this.Position = camera3DViewPoint.Position; this.TargetRotation = camera3DViewPoint.Rotation; }
/// <summary> /// Applies the data from the given ViewPoint object. /// </summary> /// <param name="camera3DViewPoint">The ViewPoint to be applied.</param> public override void ApplyViewPoint(Camera3DViewPoint camera3DViewPoint) { base.ApplyViewPoint(camera3DViewPoint); m_zoomFactor = camera3DViewPoint.OrthographicZoomFactor; }
/// <summary> /// Moves the given Camera to the given ViewPoint. /// </summary> /// <param name="sequenceBuilder">AnimationSequenceBuilder building the animation.</param> /// <param name="targetViewPoint">The target ViewPoint object.</param> /// <param name="animationTime">Total time for the animation.</param> public static IAnimationSequenceBuilder <TargetObject> CameraStraightMoveTo <TargetObject>(this IAnimationSequenceBuilder <TargetObject> sequenceBuilder, Camera3DViewPoint targetViewPoint, TimeSpan animationTime) where TargetObject : Camera3DBase { sequenceBuilder.Add( new CameraStraightMoveAnimation(sequenceBuilder.TargetObject as Camera3DBase, targetViewPoint, animationTime)); return(sequenceBuilder); }