/// <summary> /// stops all animators. /// </summary> public void StopAllAnimations() { LeftRight.End(); UpDown.End(); Roll.End(); Forward.End(); }
private void SetAnimator(RotationAnimator Animator, int Kind, float value, long Duration, bool KeepCenter) { Camera.MakeConsistent(); Animator.End(); Animator.Duration = Duration; Animator.ToValue = value; switch (Kind) { case 0: // LeftRight if (KeepCenter) { RotationAxis = new LineType(Center, UpVector); } else { RotationAxis = new LineType(Position, UpVector); } break; case 1: // UpDown if (KeepCenter) { RotationAxis = new LineType(Center, Base.BaseX); } else { RotationAxis = new LineType(Position, Base.BaseX); } break; case 2: // Rollup RotationAxis = new LineType(Position, Base.BaseZ); break; default: break; } Animator.Start(); }
private void SetAnimatorSpeed(RotationAnimator Animator, int Kind, double Speed, bool KeepCenter) { Camera.MakeConsistent(); Animator.End(); Animator.Duration = -1; Animator.SpeedInUnitsPerMilliSec = Speed; switch (Kind) { case 0: // LeftRight if (KeepCenter) { RotationAxis = new LineType(Center, UpVector); } else { RotationAxis = new LineType(Position, UpVector); } break; case 1: // UpDown if (KeepCenter) { RotationAxis = new LineType(Center, Base.BaseX); } else { RotationAxis = new LineType(Position, Base.BaseX); } break; case 2: // Rollup RotationAxis = new LineType(Position, Base.BaseZ); break; default: break; } Animator.Start(); }