Removed fake casts.

This commit is contained in:
Jarl Gullberg 2017-06-01 22:09:04 +02:00
parent a2a9c922d4
commit 5c4ef39c92
No known key found for this signature in database
GPG key ID: 750FF6F6BDA72D23
4 changed files with 28 additions and 28 deletions

View file

@ -42,22 +42,22 @@ module Matrix4 =
Assert.Equal(a, A.M11)
Assert.Equal(b, A.M12)
Assert.Equal(c, A.M13)
Assert.Equal((float32)0, A.M14)
Assert.Equal(0.0f, A.M14)
Assert.Equal(d, A.M21)
Assert.Equal(e, A.M22)
Assert.Equal(f, A.M23)
Assert.Equal((float32)0, A.M24)
Assert.Equal(0.0f, A.M24)
Assert.Equal(g, A.M31)
Assert.Equal(h, A.M32)
Assert.Equal(i, A.M33)
Assert.Equal((float32)0, A.M34)
Assert.Equal(0.0f, A.M34)
Assert.Equal((float32)0, A.M41)
Assert.Equal((float32)0, A.M42)
Assert.Equal((float32)0, A.M43)
Assert.Equal((float32)1, A.M44)
Assert.Equal(0.0f, A.M41)
Assert.Equal(0.0f, A.M42)
Assert.Equal(0.0f, A.M43)
Assert.Equal(1.0f, A.M44)
[<Property>]
let ``Four-vector4 constructor sets all components to the correct values`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) =

View file

@ -318,7 +318,7 @@ module Vector2 =
[<Property>]
let ``Vector inequality operator is by component`` (x, y) =
let v1 = Vector2(x, y)
let v2 = Vector2(x + (float32)1 , y + (float32)1)
let v2 = Vector2(x + 1.0f , y + 1.0f)
let inequality = v1 <> v2
Assert.True(inequality)
@ -556,7 +556,7 @@ module Vector2 =
//
[<Property>]
let ``Transformation by quaternion is the same as multiplication by quaternion and its conjugate`` (v : Vector2, q : Quaternion) =
let vectorQuat = Quaternion(v.X, v.Y, (float32)0, (float32)0)
let vectorQuat = Quaternion(v.X, v.Y, 0.0f, 0.0f)
let inverse = Quaternion.Invert(q)
let transformedQuat = q * vectorQuat * inverse
@ -566,7 +566,7 @@ module Vector2 =
[<Property>]
let ``Transformation by quaternion by reference is the same as multiplication by quaternion and its conjugate`` (v : Vector2, q : Quaternion) =
let vectorQuat = Quaternion(v.X, v.Y, (float32)0, (float32)0)
let vectorQuat = Quaternion(v.X, v.Y, 0.0f, 0.0f)
let inverse = Quaternion.Invert(q)
let transformedQuat = q * vectorQuat * inverse

View file

@ -37,7 +37,7 @@ module Vector3 =
Assert.Equal(a, v2.X)
Assert.Equal(b, v2.Y)
Assert.Equal((float32)0, v2.Z)
Assert.Equal(0.0f, v2.Z)
[<Property>]
let ``Vector3 value constructor sets all components to the correct values`` (a, b, c) =
@ -413,7 +413,7 @@ module Vector3 =
[<Property>]
let ``Vector inequality operator is by component`` (x, y, z) =
let v1 = Vector3(x, y, z)
let v2 = Vector3(x + (float32)1 , y + (float32)1, z + (float32)1)
let v2 = Vector3(x + 1.0f , y + 1.0f, z + 1.0f)
let inequality = v1 <> v2
Assert.True(inequality)
@ -660,25 +660,25 @@ module Vector3 =
//
[<Property>]
let ``Unit X is correct`` =
let unitX = Vector3((float32)1, (float32)0, (float32)0)
let unitX = Vector3(1.0f, 0.0f, 0.0f)
Assert.Equal(Vector3.UnitX, unitX)
[<Property>]
let ``Unit Y is correct`` =
let unitY = Vector3((float32)0, (float32)1, (float32)0)
let unitY = Vector3(0.0f, 1.0f, 0.0f)
Assert.Equal(Vector3.UnitY, unitY)
[<Property>]
let ``Unit Z is correct`` =
let unitZ = Vector3((float32)0, (float32)0, (float32)1)
let unitZ = Vector3(0.0f, 0.0f, 1.0f)
Assert.Equal(Vector3.UnitZ, unitZ)
[<Property>]
let ``Unit zero is correct`` =
let unitZero = Vector3((float32)0, (float32)0, (float32)0)
let unitZero = Vector3(0.0f, 0.0f, 0.0f)
Assert.Equal(Vector3.Zero, unitZero)
@ -707,7 +707,7 @@ module Vector3 =
let inverse = Quaternion.Invert(q)
let transformedQuat = q * vectorQuat * inverse
let transformedVector = Vector3(transformedQuat.X, transformedQuat.Y, transformedQuat.Z)
let transformedVector = transformedQuat.Xyz
Assert.Equal(transformedVector, Vector3.Transform(v, q))
@ -717,6 +717,6 @@ module Vector3 =
let inverse = Quaternion.Invert(q)
let transformedQuat = q * vectorQuat * inverse
let transformedVector = Vector3(transformedQuat.X, transformedQuat.Y,transformedQuat.Z)
let transformedVector = transformedQuat.Xyz
Assert.Equal(transformedVector, Vector3.Transform(ref v, ref q))

View file

@ -39,8 +39,8 @@ module Vector4 =
Assert.Equal(x, v2.X)
Assert.Equal(y, v2.Y)
Assert.Equal((float32)0, v2.Z)
Assert.Equal((float32)0, v2.W)
Assert.Equal(0.0f, v2.Z)
Assert.Equal(0.0f, v2.W)
[<Property>]
let ``Vector3 value constructor sets all components to the correct values`` (x, y, z) =
@ -54,7 +54,7 @@ module Vector4 =
Assert.Equal(x, v2.X)
Assert.Equal(y, v2.Y)
Assert.Equal(z, v2.Z)
Assert.Equal((float32)0, v2.W)
Assert.Equal(0.0f, v2.W)
[<Property>]
let ``Vector3 value and scalar constructor sets all components to the correct values`` (x, y, z, w) =
@ -445,7 +445,7 @@ module Vector4 =
[<Property>]
let ``Vector inequality operator is by component`` (x, y, z, w) =
let v1 = Vector4(x, y, z, w)
let v2 = Vector4(x + (float32)1 , y + (float32)1, z + (float32)1, w + (float32)1)
let v2 = Vector4(x + 1.0f , y + 1.0f, z + 1.0f, w + 1.0f)
let inequality = v1 <> v2
Assert.True(inequality)
@ -764,37 +764,37 @@ module Vector4 =
//
[<Property>]
let ``Unit X is correct`` =
let unitX = Vector4((float32)1, (float32)0, (float32)0, (float32)0)
let unitX = Vector4(1.0f, 0.0f, 0.0f, 0.0f)
Assert.Equal(Vector4.UnitX, unitX)
[<Property>]
let ``Unit Y is correct`` =
let unitY = Vector4((float32)0, (float32)1, (float32)0, (float32)0)
let unitY = Vector4(0.0f, 1.0f, 0.0f, 0.0f)
Assert.Equal(Vector4.UnitY, unitY)
[<Property>]
let ``Unit Z is correct`` =
let unitZ = Vector4((float32)0, (float32)0, (float32)1, (float32)0)
let unitZ = Vector4(0.0f, 0.0f, 1.0f, 0.0f)
Assert.Equal(Vector4.UnitZ, unitZ)
[<Property>]
let ``Unit W is correct`` =
let unitW = Vector4((float32)0, (float32)0, (float32)0, (float32)1)
let unitW = Vector4(0.0f, 0.0f, 0.0f, 1.0f)
Assert.Equal(Vector4.UnitW, unitW)
[<Property>]
let ``Unit zero is correct`` =
let unitZero = Vector4((float32)0, (float32)0, (float32)0, (float32)0)
let unitZero = Vector4(0.0f, 0.0f, 0.0f, 0.0f)
Assert.Equal(Vector4.Zero, unitZero)
[<Property>]
let ``Unit one is correct`` =
let unitOne = Vector4((float32)1, (float32)1, (float32)1, (float32)1)
let unitOne = Vector4(1.0f, 1.0f, 1.0f, 1.0f)
Assert.Equal(Vector4.One, unitOne)