Beispiel #1
0
        public void ClampToZeroStatic2()
        {
            Vector4F v = new Vector4F(0.1f, 0.1f, -0.1f, 0.09f);

            v = Vector4F.ClampToZero(v, 0.11f);
            Assert.AreEqual(Vector4F.Zero, v);
            v = new Vector4F(0.1f, -0.11f, 0.11f, 0.0f);
            v = Vector4F.ClampToZero(v, 0.1f);
            Assert.AreNotEqual(Vector4F.Zero, v);
        }
Beispiel #2
0
        public void ClampToZeroStatic1()
        {
            Vector4F v = new Vector4F(
                Numeric.EpsilonF / 2, Numeric.EpsilonF / 2, -Numeric.EpsilonF / 2, -Numeric.EpsilonF / 2);

            v = Vector4F.ClampToZero(v);
            Assert.AreEqual(Vector4F.Zero, v);
            v = new Vector4F(-Numeric.EpsilonF * 2, Numeric.EpsilonF, Numeric.EpsilonF * 2, Numeric.EpsilonF);
            v = Vector4F.ClampToZero(v);
            Assert.AreNotEqual(Vector4F.Zero, v);
        }
Beispiel #3
0
 public void ClampToZero2()
 {
     Vector4F v = new Vector4F(0.1f, 0.1f, -0.1f, 0.09f);
       v.ClampToZero(0.11f);
       Assert.AreEqual(Vector4F.Zero, v);
       v = new Vector4F(0.1f, -0.11f, 0.11f, 0.0f);
       v.ClampToZero(0.1f);
       Assert.AreNotEqual(Vector4F.Zero, v);
 }
Beispiel #4
0
 public void ClampToZero1()
 {
     Vector4F v = new Vector4F(
     Numeric.EpsilonF / 2, Numeric.EpsilonF / 2, -Numeric.EpsilonF / 2, -Numeric.EpsilonF / 2);
       v.ClampToZero();
       Assert.AreEqual(Vector4F.Zero, v);
       v = new Vector4F(-Numeric.EpsilonF * 2, Numeric.EpsilonF, Numeric.EpsilonF * 2, Numeric.EpsilonF);
       v.ClampToZero();
       Assert.AreNotEqual(Vector4F.Zero, v);
 }