Esempio n. 1
0
            public void Movement_AccDecFull_ShortRun()
            {
                // Configuration
                MovementSpeed movementSpeed  = new MovementSpeed(1.5f, 0.8f, -0.4f);
                Vector3       movementVector = new Vector3(0f, 0f, -0.14f);

                // Action
                MovementAnimationHelper animHelper = new MovementAnimationHelper(movementSpeed, movementVector);

                Vector3 pos = animHelper.GetPartialMoveDistance(animHelper.MovementTime);

                // Asserts
                Assert.True(animHelper.AccelerationTime > TimeSpan.Zero);
                Assert.True(animHelper.DecelerationTime > TimeSpan.Zero);
                Assert.True(animHelper.DecelerationTime > animHelper.AccelerationTime);
                Assert.True(animHelper.FullSpeedTime == TimeSpan.Zero);
                Assert.True(animHelper.MovementTime < TimeSpan.FromSeconds(15.0));
            }
Esempio n. 2
0
 /// <summary>
 /// Called each time the CurrentTime value gets updated.
 /// </summary>
 protected override void OnCurrentTimeUpdated(IAnimationUpdateState updateState, AnimationState animationState)
 {
     m_targetObject.Position = m_startVector + m_moveHelper.GetPartialMoveDistance(base.CurrentTime);
 }
Esempio n. 3
0
 /// <summary>
 /// Called each time the CurrentTime value gets updated.
 /// </summary>
 protected override void OnCurrentTimeUpdated(IAnimationUpdateState updateState, AnimationState animationState)
 {
     _targetObject.Position = _startVector + Vector3Ex.GetXY(_moveHelper.GetPartialMoveDistance(this.CurrentTime));
 }