Ejemplo n.º 1
0
        public void ShouldIgnoreByIfToIsSet()
        {
            var animation = new Vector3FromToByAnimation();

            animation.From = null;
            animation.To   = new Vector3(4.0f, 40.0f, 400.0f);
            animation.By   = new Vector3(10.0f, 100.0f, 1000.0f);
            Assert.AreEqual(new Vector3(0.0f, 0.0f, 0.0f), animation.GetValue(TimeSpan.FromSeconds(0.0), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(10.0f, 100.0f, 1000.0f)));
            Assert.AreEqual(new Vector3(2.0f, 20.0f, 200.0f), animation.GetValue(TimeSpan.FromSeconds(0.5), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(10.0f, 100.0f, 1000.0f)));
            Assert.AreEqual(new Vector3(4.0f, 40.0f, 400.0f), animation.GetValue(TimeSpan.FromSeconds(1.0), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(10.0f, 100.0f, 1000.0f)));
        }
Ejemplo n.º 2
0
        public void AnimateTo()
        {
            var animation = new Vector3FromToByAnimation();

            animation.From = null;
            animation.To   = new Vector3(2.0f, 20.0f, 200.0f);
            animation.By   = null;
            Assert.AreEqual(new Vector3(0.0f, 0.0f, 0.0f), animation.GetValue(TimeSpan.FromSeconds(0.0), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(10.0f, 100.0f, 1000.0f)));
            Assert.AreEqual(new Vector3(1.0f, 10.0f, 100.0f), animation.GetValue(TimeSpan.FromSeconds(0.5), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(10.0f, 100.0f, 1000.0f)));
            Assert.AreEqual(new Vector3(2.0f, 20.0f, 200.0f), animation.GetValue(TimeSpan.FromSeconds(1.0), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(10.0f, 100.0f, 1000.0f)));
        }