internal Uniform6DTransformation(AnimatableWrapper wrapper, Motion6D.ReferenceFrame frame, bool realtime, double[] changeFrameTime, TimeSpan forecastTime) { transform.Children.Add(rotate_uniform); // Adds uniform rotation transform.Children.Add(rotate_const); // Adds constant rptation transform.Children.Add(translation); // Adds translation rotate_const.Rotation = quaternionConstRotation; // Setting quaterion for constant rotation rotate_uniform.Rotation = angle_uniform; // Setting axis rotation for uniform rotation this.wrapper = wrapper; animatable = wrapper.Animatable; dependencyProperty = wrapper.DependencyProperty; this.frame = frame; this.changeFrameTime = changeFrameTime; From = 0; To = 1; calculator = new Motion6D.Uniform6D.Uniform6DMotion(frame, rotationAxis, changeFrameTime, forecastTime.TotalSeconds, wrapper.Animated.CoordinateError, wrapper.Animated.AngleError); animated = wrapper.Animated; forecast = animated.ForecastTime; this.realtime = realtime; if (realtime) { calculator.InitializePrediction(forecast.TotalSeconds); } calculator.Change += Motion_Change; }
void IAnimatedObject.InitAnimation(AnimationType animationType) { if (animationType == AnimationType.Asynchronous) { animatableChildren[0] = new AnimatableWrapper(pCamera, PerspectiveCamera.TransformProperty, this, false, null); animatableChildren[0].OnFinish += Stop; update = null; } else { animatableChildren[0] = null; update = UpdateImage; SetTransform(); } }
void IAnimatedObject.InitRealtime(AnimationType animationType, double[] changeFrameTime) { this.changeFrameTime = changeFrameTime; if (animationType == AnimationType.Synchronous) { update = UpdateImage; animatableChildren[0] = null; } else { update = null; animatableChildren[0] = new AnimatableWrapper(pCamera, PerspectiveCamera.TransformProperty, this, true, changeFrameTime); animatableChildren[0].OnFinish += Stop; update = null; } }
void IAnimatedObject.InitRealtime(AnimationType animationType, double[] changeFrameTime) { if (animationType == AnimationType.Asynchronous) { List <AnimatableWrapper> l = new List <AnimatableWrapper>(); foreach (Visual3D visual in visuals.Values) { AnimatableWrapper aw = new AnimatableWrapper(visual, Visual3D.TransformProperty, this, true, changeFrameTime); aw.OnFinish += AniCount; l.Add(aw); } animatableChildren = l.ToArray(); aniCount = l.Count; } else { animatableChildren = new AnimatableWrapper[0]; } }