示例#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;
 }