Esempio n. 1
0
        public override void OverrideLoadedProperties()
        {
            base.OverrideLoadedProperties();

            /* should be set by engine, so reset properties works as expected */
            _alphaAnimationComponent = Components.First(c => c.Id == AlphaAnimationComponentId) as PropertyAnimationComponent;
            _alphaAnimationComponent.Property = "StarColor";
            _alphaAnimationComponent.StartValue = StarColor.ToString().Replace("(", string.Empty).Replace(")", string.Empty);

            var stopColor = new Vector4(StarColor.X, StarColor.Y, StarColor.Z, 0);

            _alphaAnimationComponent.StopValue = stopColor.ToString().Replace("(", string.Empty).Replace(")", string.Empty);
            _alphaAnimationComponent.DurationSeconds = 0.5f;

            _rotationAnimationComponent = Components.First(c => c.Id == RotationAnimationComponentId) as PropertyAnimationComponent;
            _rotationAnimationComponent.Property = "Rotation";
            _rotationAnimationComponent.StartValue = new Vector3(0, 0, this.Rotation.Z).ToString().Replace("(", string.Empty).Replace(")", string.Empty);
            _rotationAnimationComponent.StopValue = new Vector3(0, 6.28f / 2f, this.Rotation.Z).ToString().Replace("(", string.Empty).Replace(")", string.Empty);
            _rotationAnimationComponent.DurationSeconds = 0.5f;

            DistanceSorting = true;

            _grabbed = false;

            _flare.Position = this.WorldPosition;
        }
Esempio n. 2
0
        public void Vector4ToStringTest()
        {
            Vector4 target = new Vector4(-1.0f, 2.2f, 3.3f, -4.4f);

            string expected = "{X:-1 Y:2.2 Z:3.3 W:-4.4}";
            string actual;
            actual = target.ToString();
            Assert.AreEqual(expected, actual, "Vector4.ToString did not return the expected value.");
        }
Esempio n. 3
0
        public void TestMemberFn_ToString_i ()
        {
            Vector4 a = new Vector4(42, -17, 13, 44);

            String result = a.ToString();

            String expected = "{X:42 Y:-17 Z:13 W:44}";

            Assert.That(result, Is.EqualTo(expected));
        }
Esempio n. 4
0
 public float[] GetShapeArray(string filename, Vector4 color, bool inverted)
 {
     if (!shapeArrayDict.ContainsKey(filename + color.ToString()))
     {
         shapeArrayDict[filename + color.ToString()] = modelReader.GetFloatArray(filename, color, inverted);
         //Debug.WriteLine("Made a dict entry: " + filename+color.ToString());
     }
     return shapeArrayDict[filename + color.ToString()];
 }
Esempio n. 5
0
 public static Vector4 ColorVec4ToVector4(Vector4 color)
 {
     #if DEBUG
     Console.WriteLine(color.ToString() + " -> " + new Vector4((color.X / 255), (color.Y / 255), (color.Z / 255), (color.W / 255)).ToString());
     #endif
     return new Vector4((color.X / 255), (color.Y / 255), (color.Z / 255), (color.W / 255));
 }