예제 #1
0
        public void Multiply_VectorScalar_Operator(double4 vec, double scale, double4 expected)
        {
            var actual = vec * scale;

            Assert.Equal(expected, actual);
        }
예제 #2
0
        public void UnitX_IsUnit()
        {
            var expected = new double4(1, 0, 0, 0);

            Assert.Equal(expected, double4.UnitX);
        }
예제 #3
0
        public void UnitW_IsUnit()
        {
            var expected = new double4(0, 0, 0, 1);

            Assert.Equal(expected, double4.UnitW);
        }
예제 #4
0
        public void TransformPremult_4D_Static(double4x4 mat, double4 vec, double4 expected)
        {
            var actual = double4x4.TransformPremult(vec, mat);

            Assert.Equal(expected, -actual);
        }
예제 #5
0
        public void TransformPremult_4D_Operator(double4x4 mat, double4 vec, double4 expected)
        {
            var actual = vec * mat;

            Assert.Equal(expected, -actual);
        }
예제 #6
0
        public void Zero_IsZero()
        {
            var expected = new double4(0, 0, 0, 0);

            Assert.Equal(expected, double4.Zero);
        }
예제 #7
0
        public void Transform_double4(double4 vec, QuaternionD quat, double4 expected)
        {
            var actual = QuaternionD.Transform(vec, quat);

            Assert.Equal(expected, actual);
        }
예제 #8
0
        public void Min_IsZero(double4 left, double4 right, double4 expected)
        {
            var actual = double4.Min(left, right);

            Assert.Equal(expected, actual);
        }
예제 #9
0
        public void Max_IsOne(double4 left, double4 right, double4 expected)
        {
            var actual = double4.Max(left, right);

            Assert.Equal(expected, actual);
        }
예제 #10
0
        public void Multiply_VectorScalar_Static(double4 vec, double scale, double4 expected)
        {
            var actual = double4.Multiply(vec, scale);

            Assert.Equal(expected, actual);
        }
예제 #11
0
        public void Divide_Vector_Scalar_Static(double4 vec, double scale, double4 expected)
        {
            var actual = double4.Divide(vec, scale);

            Assert.Equal(expected, actual);
        }
예제 #12
0
        public void Subtract_Static(double4 left, double4 right, double4 expected)
        {
            var actual = double4.Subtract(left, right);

            Assert.Equal(expected, actual);
        }
예제 #13
0
        public void Add_Static(double4 left, double4 right, double4 expected)
        {
            var actual = double4.Add(left, right);

            Assert.Equal(expected, actual);
        }
예제 #14
0
        public void NormalizeFast_Instance(double4 vec, double4 expected)
        {
            var actual = vec.NormalizeFast();

            Assert.Equal(expected, actual);
        }
예제 #15
0
        public void Multiply_ScalarVector_Operator(double4 vec, double scale, double4 expected)
        {
            var actual = scale * vec;

            Assert.Equal(expected, actual);
        }
예제 #16
0
        public void Clamp_TestClamp(double4 vec, double4 min, double4 max, double4 expected)
        {
            var actual = double4.Clamp(vec, min, max);

            Assert.Equal(expected, actual);
        }
예제 #17
0
        public void Divide_Operator(double4 vec, double scale, double4 expected)
        {
            var actual = vec / scale;

            Assert.Equal(expected, actual);
        }
예제 #18
0
        public void NormalizeFast_Static(double4 vec, double4 expected)
        {
            var actual = double4.NormalizeFast(vec);

            Assert.Equal(expected, actual);
        }
예제 #19
0
        public void One_IsOne()
        {
            var expected = new double4(1, 1, 1, 1);

            Assert.Equal(expected, double4.One);
        }
예제 #20
0
        public void Lerp_TestLerp(double4 left, double4 right, double blend, double4 expected)
        {
            var actual = double4.Lerp(left, right, blend);

            Assert.Equal(expected, actual);
        }
예제 #21
0
        public void Transform_4D_Static(double4x4 mat, double4 vec, double4 expected)
        {
            var actual = double4x4.Transform(mat, vec);

            Assert.Equal(expected, actual);
        }
예제 #22
0
        public void Barycentric_Edges(double4 a, double4 b, double4 c, double u, double v, double4 expected)
        {
            var actual = double4.BaryCentric(a, b, c, u, v);

            Assert.Equal(expected, actual);
        }
예제 #23
0
        public void Transform_4D_Operator(double4x4 mat, double4 vec, double4 expected)
        {
            var actual = mat * vec;

            Assert.Equal(expected, actual);
        }
예제 #24
0
        public void Subtract_Operator(double4 left, double4 right, double4 expected)
        {
            var actual = left - right;

            Assert.Equal(expected, actual);
        }
예제 #25
0
 /// <summary>
 /// Constructs a new double3 from the given double4.
 /// </summary>
 /// <param name="v">The double4 to copy components from.</param>
 public double3(double4 v)
 {
     x = v.x;
     y = v.y;
     z = v.z;
 }
예제 #26
0
 public double2(double4 v)
 {
     x = v.x;
     y = v.y;
 }