Procházet zdrojové kódy

Refactored to use D suffix for Double implementations.

woollybah před 6 roky
rodič
revize
3b55af599b

+ 118 - 118
matrix.mod/matrix.bmx

@@ -41,14 +41,14 @@ Import BRL.StringBuilder
 Rem
 Rem
 bbdoc: A 2x2 Matrix
 bbdoc: A 2x2 Matrix
 End Rem
 End Rem
-Struct SMat2
+Struct SMat2D
 	Field ReadOnly a:Double
 	Field ReadOnly a:Double
 	Field ReadOnly b:Double
 	Field ReadOnly b:Double
 	Field ReadOnly c:Double
 	Field ReadOnly c:Double
 	Field ReadOnly d:Double
 	Field ReadOnly d:Double
 	
 	
 	Rem
 	Rem
-	bbdoc: Creates a new #SMat2 from the supplied arguments.
+	bbdoc: Creates a new #SMat2D from the supplied arguments.
 	End Rem
 	End Rem
 	Method New(a:Double, b:Double, c:Double, d:Double)
 	Method New(a:Double, b:Double, c:Double, d:Double)
 		Self.a = a
 		Self.a = a
@@ -60,50 +60,50 @@ Struct SMat2
 	Rem
 	Rem
 	bbdoc: Applies the matrix to the vector @v, returning a new vector.
 	bbdoc: Applies the matrix to the vector @v, returning a new vector.
 	End Rem
 	End Rem
-	Method Apply:SVec2(v:SVec2)
-		Return New SVec2(a * v.x + c * v.y, b * v.x + d * v.y)
+	Method Apply:SVec2D(v:SVec2D)
+		Return New SVec2D(a * v.x + c * v.y, b * v.x + d * v.y)
 	End Method
 	End Method
 
 
 	Rem
 	Rem
 	bbdoc: Returns the identity matrix.
 	bbdoc: Returns the identity matrix.
 	End Rem
 	End Rem
-	Function Identity:SMat2()
-		Return New SMat2(1, 0, 0, 1)
+	Function Identity:SMat2D()
+		Return New SMat2D(1, 0, 0, 1)
 	End Function
 	End Function
 	
 	
 	Rem
 	Rem
 	bbdoc: Adds @z to the matrix, returning a new matrix.
 	bbdoc: Adds @z to the matrix, returning a new matrix.
 	End Rem
 	End Rem
-	Method Operator+:SMat2(z:SMat2)
-		Return New SMat2(a + z.a, b + z.b, c + z.c, d + z.d)
+	Method Operator+:SMat2D(z:SMat2D)
+		Return New SMat2D(a + z.a, b + z.b, c + z.c, d + z.d)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Subtracts @z from the matrix, returning a new matrix.
 	bbdoc: Subtracts @z from the matrix, returning a new matrix.
 	End Rem
 	End Rem
-	Method Operator-:SMat2(z:SMat2)
-		Return New SMat2(a - z.a, b - z.b, c - z.c, d - z.d)
+	Method Operator-:SMat2D(z:SMat2D)
+		Return New SMat2D(a - z.a, b - z.b, c - z.c, d - z.d)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Multiplies the matrix by @z, returning a new matrix.
 	bbdoc: Multiplies the matrix by @z, returning a new matrix.
 	End Rem
 	End Rem
-	Method Operator*:SMat2(z:SMat2)
-		Return New SMat2(a * z.a + c * z.b, b * z.a + d * z.b, a * z.c + c * z.d, b * z.c + d * z.d)
+	Method Operator*:SMat2D(z:SMat2D)
+		Return New SMat2D(a * z.a + c * z.b, b * z.a + d * z.b, a * z.c + c * z.d, b * z.c + d * z.d)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns the transposition of the cofactor matrix.
 	bbdoc: Returns the transposition of the cofactor matrix.
 	End Rem
 	End Rem
-	Method Adjoint:SMat2()
-		Return New SMat2(d, -b, -c, a)
+	Method Adjoint:SMat2D()
+		Return New SMat2D(d, -b, -c, a)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Multiplies the matrix by @z by its components, return a new matrix.
 	bbdoc: Multiplies the matrix by @z by its components, return a new matrix.
 	End Rem
 	End Rem
-	Method CompMul:SMat2(z:SMat2)
-		Return New SMat2(a * z.a, b * z.b, c * z.c, d * z.d)
+	Method CompMul:SMat2D(z:SMat2D)
+		Return New SMat2D(a * z.a, b * z.b, c * z.c, d * z.d)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
@@ -116,52 +116,52 @@ Struct SMat2
 	Rem
 	Rem
 	bbdoc: Returns the inverse of the matrix.
 	bbdoc: Returns the inverse of the matrix.
 	End Rem
 	End Rem
-	Method Invert:SMat2()
+	Method Invert:SMat2D()
 		Local det:Double = a * d - c * b
 		Local det:Double = a * d - c * b
 		If det = 0 Then
 		If det = 0 Then
-			Return New SMat2(0, 0, 0, 0)
+			Return New SMat2D(0, 0, 0, 0)
 		End If
 		End If
 		det = 1 / det
 		det = 1 / det
-		Return New SMat2(d * det, -b * det, -c * det, a * det)
+		Return New SMat2D(d * det, -b * det, -c * det, a * det)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Rotates the matrix by @angle degrees, returning the rotated matrix.
 	bbdoc: Rotates the matrix by @angle degrees, returning the rotated matrix.
 	End Rem
 	End Rem
-	Method Rotate:SMat2(angle:Double)
+	Method Rotate:SMat2D(angle:Double)
 		Local sa:Double = Sin(angle)
 		Local sa:Double = Sin(angle)
 		Local ca:Double = Cos(angle)
 		Local ca:Double = Cos(angle)
-		Return New SMat2(a * ca + c * sa, b * ca + d * sa, a * -sa + c * ca, b * -sa + d * ca)
+		Return New SMat2D(a * ca + c * sa, b * ca + d * sa, a * -sa + c * ca, b * -sa + d * ca)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Creates a rotated matrix of @angle degrees.
 	bbdoc: Creates a rotated matrix of @angle degrees.
 	End Rem
 	End Rem
-	Function Rotation:SMat2(angle:Double)
+	Function Rotation:SMat2D(angle:Double)
 		Local sa:Double = Sin(angle)
 		Local sa:Double = Sin(angle)
 		Local ca:Double = Cos(angle)
 		Local ca:Double = Cos(angle)
-		Return New SMat2(ca, sa, -sa, ca)
+		Return New SMat2D(ca, sa, -sa, ca)
 	End Function
 	End Function
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns the scale of this matrix.
 	bbdoc: Returns the scale of this matrix.
 	End Rem
 	End Rem
-	Method Scale:SMat2(s:SVec2)
-		Return New SMat2(a * s.x, b * s.x, c * s.y, d * s.y)
+	Method Scale:SMat2D(s:SVec2D)
+		Return New SMat2D(a * s.x, b * s.x, c * s.y, d * s.y)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Creates a scaled matrix of the scale @s.
 	bbdoc: Creates a scaled matrix of the scale @s.
 	End Rem
 	End Rem
-	Function Scaling:SMat2(s:SVec2)
-		Return New SMat2(s.x, 0, 0, s.y)
+	Function Scaling:SMat2D(s:SVec2D)
+		Return New SMat2D(s.x, 0, 0, s.y)
 	End Function
 	End Function
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns the transpose of this matrix.
 	bbdoc: Returns the transpose of this matrix.
 	End Rem
 	End Rem
-	Method Transpose:SMat2()
-		Return New SMat2(a, c, b, d)
+	Method Transpose:SMat2D()
+		Return New SMat2D(a, c, b, d)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
@@ -181,7 +181,7 @@ End Struct
 Rem
 Rem
 bbdoc: A 3x3 matrix.
 bbdoc: A 3x3 matrix.
 End Rem
 End Rem
-Struct SMat3
+Struct SMat3D
 	Field ReadOnly a:Double
 	Field ReadOnly a:Double
 	Field ReadOnly b:Double
 	Field ReadOnly b:Double
 	Field ReadOnly c:Double
 	Field ReadOnly c:Double
@@ -193,7 +193,7 @@ Struct SMat3
 	Field ReadOnly i:Double
 	Field ReadOnly i:Double
 
 
 	Rem
 	Rem
-	bbdoc: Creates a new #SMat3 from the supplied arguments.
+	bbdoc: Creates a new #SMat3D from the supplied arguments.
 	End Rem
 	End Rem
 	Method New(a:Double, b:Double, c:Double, d:Double, e:Double, f:Double, g:Double, h:Double, i:Double)
 	Method New(a:Double, b:Double, c:Double, d:Double, e:Double, f:Double, g:Double, h:Double, i:Double)
 		Self.a = a
 		Self.a = a
@@ -210,42 +210,42 @@ Struct SMat3
 	Rem
 	Rem
 	bbdoc: Applies the matrix to the vector @v, returning a new vector.
 	bbdoc: Applies the matrix to the vector @v, returning a new vector.
 	End Rem
 	End Rem
-	Method Apply:SVec2(v:SVec2)
-		Return New SVec2(a * v.x + d * v.y + g, b * v.x + e * v.y + h)
+	Method Apply:SVec2D(v:SVec2D)
+		Return New SVec2D(a * v.x + d * v.y + g, b * v.x + e * v.y + h)
 	End Method
 	End Method
 
 
 	Rem
 	Rem
 	bbdoc: Applies the matrix to the vector @v, returning a new vector.
 	bbdoc: Applies the matrix to the vector @v, returning a new vector.
 	End Rem
 	End Rem
-	Method Apply:SVec3(v:SVec3)
-		Return New SVec3(v.x * a + v.y * d + v.z * g, v.x * b + v.y * e + v.z * h, v.x * c + v.y * f + v.z * i)
+	Method Apply:SVec3D(v:SVec3D)
+		Return New SVec3D(v.x * a + v.y * d + v.z * g, v.x * b + v.y * e + v.z * h, v.x * c + v.y * f + v.z * i)
 	End Method
 	End Method
 
 
 	Rem
 	Rem
 	bbdoc: Return the 3x3 identity matrix.
 	bbdoc: Return the 3x3 identity matrix.
 	End Rem
 	End Rem
-	Function Identity:SMat3()
-		Return New SMat3(1, 0, 0, 0, 1, 0, 0, 0, 1)
+	Function Identity:SMat3D()
+		Return New SMat3D(1, 0, 0, 0, 1, 0, 0, 0, 1)
 	End Function
 	End Function
 	
 	
 	Rem
 	Rem
 	bbdoc: Adds @z to the matrix, returning a new matrix.
 	bbdoc: Adds @z to the matrix, returning a new matrix.
 	End Rem
 	End Rem
-	Method Operator+:SMat3(z:SMat3 Var)
-		Return New SMat3(a + z.a, b + z.b, c + z.c, d + z.d, e + z.e, f + z.f, g + z.g, h + z.h, i + z.i)
+	Method Operator+:SMat3D(z:SMat3D Var)
+		Return New SMat3D(a + z.a, b + z.b, c + z.c, d + z.d, e + z.e, f + z.f, g + z.g, h + z.h, i + z.i)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Subtracts @z from the matrix, returning a new matrix.
 	bbdoc: Subtracts @z from the matrix, returning a new matrix.
 	End Rem
 	End Rem
-	Method Operator-:SMat3(z:SMat3 Var)
-		Return New SMat3(a - z.a, b - z.b, c - z.c, d - z.d, e - z.e, f - z.f, g - z.g, h - z.h, i - z.i)
+	Method Operator-:SMat3D(z:SMat3D Var)
+		Return New SMat3D(a - z.a, b - z.b, c - z.c, d - z.d, e - z.e, f - z.f, g - z.g, h - z.h, i - z.i)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Multiplies the matrix by @z, returning a new matrix.
 	bbdoc: Multiplies the matrix by @z, returning a new matrix.
 	End Rem
 	End Rem
-	Method Operator*:SMat3(z:SMat3 Var)
+	Method Operator*:SMat3D(z:SMat3D Var)
 		Local a00:Double = a
 		Local a00:Double = a
 		Local a01:Double = b
 		Local a01:Double = b
 		Local a02:Double = c
 		Local a02:Double = c
@@ -264,7 +264,7 @@ Struct SMat3
 		Local b20:Double = z.g
 		Local b20:Double = z.g
 		Local b21:Double = z.h
 		Local b21:Double = z.h
 		Local b22:Double = z.i
 		Local b22:Double = z.i
-		Return New SMat3(b00 * a00 + b01 * a10 + b02 * a20, ..
+		Return New SMat3D(b00 * a00 + b01 * a10 + b02 * a20, ..
 			b00 * a01 + b01 * a11 + b02 * a21, ..
 			b00 * a01 + b01 * a11 + b02 * a21, ..
 			b00 * a02 + b01 * a12 + b02 * a22, ..
 			b00 * a02 + b01 * a12 + b02 * a22, ..
 			b10 * a00 + b11 * a10 + b12 * a20, ..
 			b10 * a00 + b11 * a10 + b12 * a20, ..
@@ -278,8 +278,8 @@ Struct SMat3
 	Rem
 	Rem
 	bbdoc: Returns the transposition of the cofactor matrix.
 	bbdoc: Returns the transposition of the cofactor matrix.
 	End Rem
 	End Rem
-	Method Adjoint:SMat3()
-		Return New SMat3(e * i - f * h, ..
+	Method Adjoint:SMat3D()
+		Return New SMat3D(e * i - f * h, ..
 			c * h - b * i, ..
 			c * h - b * i, ..
 			b * f - c * e, ..
 			b * f - c * e, ..
 			f * g - d * i, ..
 			f * g - d * i, ..
@@ -293,8 +293,8 @@ Struct SMat3
 	Rem
 	Rem
 	bbdoc: Multiplies the matrix by @z by its components, return a new matrix.
 	bbdoc: Multiplies the matrix by @z by its components, return a new matrix.
 	End Rem
 	End Rem
-	Method CompMul:SMat3(z:SMat3 Var)
-		Return New SMat3(a * z.a, b * z.b, c * z.c, d * z.d, e * z.e, f * z.f, g * z.g, h * z.h, i * z.i)
+	Method CompMul:SMat3D(z:SMat3D Var)
+		Return New SMat3D(a * z.a, b * z.b, c * z.c, d * z.d, e * z.e, f * z.f, g * z.g, h * z.h, i * z.i)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
@@ -316,7 +316,7 @@ Struct SMat3
 	Rem
 	Rem
 	bbdoc: Returns the inverse of the matrix.
 	bbdoc: Returns the inverse of the matrix.
 	End Rem
 	End Rem
-	Method Invert:SMat3()
+	Method Invert:SMat3D()
 		Local a00:Double = a
 		Local a00:Double = a
 		Local a01:Double = b
 		Local a01:Double = b
 		Local a02:Double = c
 		Local a02:Double = c
@@ -331,10 +331,10 @@ Struct SMat3
 		Local b21:Double =  a21 * a10 - a11 * a20
 		Local b21:Double =  a21 * a10 - a11 * a20
 		Local det:Double = a00 * b01 + a01 * b11 + a02 * b21
 		Local det:Double = a00 * b01 + a01 * b11 + a02 * b21
 		If det = 0 Then
 		If det = 0 Then
-			Return New SMat3(0, 0, 0, 0, 0, 0, 0, 0, 0)
+			Return New SMat3D(0, 0, 0, 0, 0, 0, 0, 0, 0)
 		End If
 		End If
 		det = 1 / det
 		det = 1 / det
-		Return New SMat3(b01 * det, ..
+		Return New SMat3D(b01 * det, ..
 			(-a22 * a01 + a02 * a21) * det, ..
 			(-a22 * a01 + a02 * a21) * det, ..
 			( a12 * a01 - a02 * a11) * det,
 			( a12 * a01 - a02 * a11) * det,
 			b11 * det, ..
 			b11 * det, ..
@@ -348,10 +348,10 @@ Struct SMat3
 	Rem
 	Rem
 	bbdoc: Rotates the matrix by @angle degrees, returning a new matrix.
 	bbdoc: Rotates the matrix by @angle degrees, returning a new matrix.
 	End Rem
 	End Rem
-	Method Rotate:SMat3(angle:Double)
+	Method Rotate:SMat3D(angle:Double)
 		Local sa:Double = Sin(angle)
 		Local sa:Double = Sin(angle)
 		Local ca:Double = Cos(angle)
 		Local ca:Double = Cos(angle)
-		Return New SMat3(ca * a + sa * d, ..
+		Return New SMat3D(ca * a + sa * d, ..
 			ca * b + sa * e, ..
 			ca * b + sa * e, ..
 			ca * c + sa * f, ..
 			ca * c + sa * f, ..
 			ca * d - sa * a, ..
 			ca * d - sa * a, ..
@@ -363,33 +363,33 @@ Struct SMat3
 	Rem
 	Rem
 	bbdoc: Retrns a rotation matrix of @angle degrees.
 	bbdoc: Retrns a rotation matrix of @angle degrees.
 	End Rem
 	End Rem
-	Function Rotation:SMat3(angle:Double)
+	Function Rotation:SMat3D(angle:Double)
 		Local sa:Double = Sin(angle)
 		Local sa:Double = Sin(angle)
 		Local ca:Double = Cos(angle)
 		Local ca:Double = Cos(angle)
-		Return New SMat3(ca, sa, 0, -sa, ca, 0, 0, 0, 1)
+		Return New SMat3D(ca, sa, 0, -sa, ca, 0, 0, 0, 1)
 	End Function
 	End Function
 	
 	
 	Rem
 	Rem
 	bbdoc: Scales the matrix by @s, returning a new matrix.
 	bbdoc: Scales the matrix by @s, returning a new matrix.
 	End Rem
 	End Rem
-	Method Scale:SMat3(s:SVec2)
+	Method Scale:SMat3D(s:SVec2D)
 		Local bx:Double = s.x
 		Local bx:Double = s.x
 		Local by:Double = s.y
 		Local by:Double = s.y
-		Return New SMat3(a * bx, b * bx, c * bx, d * by, e * by, f * by, g, h, i)
+		Return New SMat3D(a * bx, b * bx, c * bx, d * by, e * by, f * by, g, h, i)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a scaling matrix of @s.
 	bbdoc: Returns a scaling matrix of @s.
 	End Rem
 	End Rem
-	Function Scaling:SMat3(s:SVec2)
-		Return New SMat3(s.x, 0, 0, 0, s.y, 0, 0, 0, 1)
+	Function Scaling:SMat3D(s:SVec2D)
+		Return New SMat3D(s.x, 0, 0, 0, s.y, 0, 0, 0, 1)
 	End Function
 	End Function
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a transposition of the matrix.
 	bbdoc: Returns a transposition of the matrix.
 	End Rem
 	End Rem
-	Method Transpose:SMat3()
-		Return New SMat3(a, d, g, b, e, h, c, f, i)
+	Method Transpose:SMat3D()
+		Return New SMat3D(a, d, g, b, e, h, c, f, i)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
@@ -410,7 +410,7 @@ End Struct
 Rem
 Rem
 bbdoc: A standard 4x4 transformation matrix.
 bbdoc: A standard 4x4 transformation matrix.
 End Rem
 End Rem
-Struct SMat4
+Struct SMat4D
 	Field ReadOnly a:Double
 	Field ReadOnly a:Double
 	Field ReadOnly b:Double
 	Field ReadOnly b:Double
 	Field ReadOnly c:Double
 	Field ReadOnly c:Double
@@ -429,7 +429,7 @@ Struct SMat4
 	Field ReadOnly p:Double
 	Field ReadOnly p:Double
 
 
 	Rem
 	Rem
-	bbdoc: Creates a new #SMat4 from the supplied arguments.
+	bbdoc: Creates a new #SMat4D from the supplied arguments.
 	End Rem
 	End Rem
 	Method New(a:Double, b:Double, c:Double, d:Double, e:Double, f:Double, g:Double, h:Double, i:Double, j:Double, k:Double, l:Double, m:Double, n:Double, o:Double, p:Double)
 	Method New(a:Double, b:Double, c:Double, d:Double, e:Double, f:Double, g:Double, h:Double, i:Double, j:Double, k:Double, l:Double, m:Double, n:Double, o:Double, p:Double)
 		Self.a = a
 		Self.a = a
@@ -453,21 +453,21 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Applies the matrix to the vector @v, returning a new vector.
 	bbdoc: Applies the matrix to the vector @v, returning a new vector.
 	End Rem
 	End Rem
-	Method Apply:SVec2(v:SVec2)
-		Return New SVec2(a * v.x + e * v.y + m, b * v.x + f * v.y + n)
+	Method Apply:SVec2D(v:SVec2D)
+		Return New SVec2D(a * v.x + e * v.y + m, b * v.x + f * v.y + n)
 	End Method
 	End Method
 
 
 	Rem
 	Rem
 	bbdoc: Applies the 4x4 matrix @b to the vector, returning a new vector.
 	bbdoc: Applies the 4x4 matrix @b to the vector, returning a new vector.
 	End Rem
 	End Rem
-	Method Apply:SVec3(v:SVec3)
+	Method Apply:SVec3D(v:SVec3D)
 		Local w:Double = d * v.x + h * v.y + l * v.z + p
 		Local w:Double = d * v.x + h * v.y + l * v.z + p
 		If w = 0 Then
 		If w = 0 Then
 			w = 1
 			w = 1
 		Else
 		Else
 			w = 1 / w
 			w = 1 / w
 		End If
 		End If
-		Return New SVec3((a * v.x + e * v.y + i * v.z + m) * w, ..
+		Return New SVec3D((a * v.x + e * v.y + i * v.z + m) * w, ..
 			(b * v.x + f * v.y + j * v.z + n) * w, ..
 			(b * v.x + f * v.y + j * v.z + n) * w, ..
 			(c * v.x + g * v.y + k * v.z + o) * w)
 			(c * v.x + g * v.y + k * v.z + o) * w)
 	End Method
 	End Method
@@ -475,8 +475,8 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Returns the identity matrix.
 	bbdoc: Returns the identity matrix.
 	End Rem
 	End Rem
-	Function Identity:SMat4()
-		Return New SMat4(1, 0, 0, 0, ..
+	Function Identity:SMat4D()
+		Return New SMat4D(1, 0, 0, 0, ..
 				0, 1, 0, 0, ..
 				0, 1, 0, 0, ..
 				0, 0, 1, 0, ..
 				0, 0, 1, 0, ..
 				0, 0, 0, 1)
 				0, 0, 0, 1)
@@ -485,8 +485,8 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Adds @z to the matrix, returning a new matrix.
 	bbdoc: Adds @z to the matrix, returning a new matrix.
 	End Rem
 	End Rem
-	Method Operator+:SMat4(z:SMat4 Var)
-		Return New SMat4(a + z.a, b + z.b, c + z.c, d + z.d, ..
+	Method Operator+:SMat4D(z:SMat4D Var)
+		Return New SMat4D(a + z.a, b + z.b, c + z.c, d + z.d, ..
 			e + z.e, f + z.f, g + z.g, h + z.h, ..
 			e + z.e, f + z.f, g + z.g, h + z.h, ..
 			i + z.i, j + z.j, k + z.k, l + z.l, ..
 			i + z.i, j + z.j, k + z.k, l + z.l, ..
 			m + z.m, n + z.n, o + z.o, p + z.p)
 			m + z.m, n + z.n, o + z.o, p + z.p)
@@ -495,8 +495,8 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Subtracts @z from the matrix, returning a new matrix.
 	bbdoc: Subtracts @z from the matrix, returning a new matrix.
 	End Rem
 	End Rem
-	Method Operator-:SMat4(z:SMat4 Var)
-		Return New SMat4(a - z.a, b - z.b, c - z.c, d - z.d, ..
+	Method Operator-:SMat4D(z:SMat4D Var)
+		Return New SMat4D(a - z.a, b - z.b, c - z.c, d - z.d, ..
 			e - z.e, f - z.f, g - z.g, h - z.h, ..
 			e - z.e, f - z.f, g - z.g, h - z.h, ..
 			i - z.i, j - z.j, k - z.k, l - z.l, ..
 			i - z.i, j - z.j, k - z.k, l - z.l, ..
 			m - z.m, n - z.n, o - z.o, p - z.p)
 			m - z.m, n - z.n, o - z.o, p - z.p)
@@ -505,7 +505,7 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Multiplies the matrix by @z, returning a new matrix. 
 	bbdoc: Multiplies the matrix by @z, returning a new matrix. 
 	End Rem
 	End Rem
-	Method Operator*:SMat4(z:SMat4 Var)
+	Method Operator*:SMat4D(z:SMat4D Var)
 		Local a00:Double = a
 		Local a00:Double = a
 		Local a01:Double = b
 		Local a01:Double = b
 		Local a02:Double = c
 		Local a02:Double = c
@@ -538,7 +538,7 @@ Struct SMat4
 		Local b31:Double = z.n
 		Local b31:Double = z.n
 		Local b32:Double = z.o
 		Local b32:Double = z.o
 		Local b33:Double = z.p
 		Local b33:Double = z.p
-		Return New SMat4(b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, ..
+		Return New SMat4D(b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, ..
 			b00 * a01 + b01 * a11 + b02 * a21 + b03 * a31, ..
 			b00 * a01 + b01 * a11 + b02 * a21 + b03 * a31, ..
 			b00 * a02 + b01 * a12 + b02 * a22 + b03 * a32, ..
 			b00 * a02 + b01 * a12 + b02 * a22 + b03 * a32, ..
 			b00 * a03 + b01 * a13 + b02 * a23 + b03 * a33, ..
 			b00 * a03 + b01 * a13 + b02 * a23 + b03 * a33, ..
@@ -559,7 +559,7 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Returns the transposition of the cofactor matrix.
 	bbdoc: Returns the transposition of the cofactor matrix.
 	End Rem
 	End Rem
-	Method Adjoint:SMat4()
+	Method Adjoint:SMat4D()
 		Local a00:Double = a
 		Local a00:Double = a
 		Local a01:Double = b
 		Local a01:Double = b
 		Local a02:Double = c
 		Local a02:Double = c
@@ -576,7 +576,7 @@ Struct SMat4
 		Local a31:Double = n
 		Local a31:Double = n
 		Local a32:Double = o
 		Local a32:Double = o
 		Local a33:Double = p
 		Local a33:Double = p
-		Return New SMat4(a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22), ..
+		Return New SMat4D(a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22), ..
 			-(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), ..
 			-(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), ..
 			a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12), ..
 			a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12), ..
 			-(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), ..
 			-(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), ..
@@ -597,8 +597,8 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Multiplies the matrix by @z by its components, returning a new matrix.
 	bbdoc: Multiplies the matrix by @z by its components, returning a new matrix.
 	End Rem
 	End Rem
-	Method CompMul:SMat4(z:SMat4 Var)
-		Return New SMat4(a * z.a, b * z.b, c * z.c, d * z.d, ..
+	Method CompMul:SMat4D(z:SMat4D Var)
+		Return New SMat4D(a * z.a, b * z.b, c * z.c, d * z.d, ..
 			e * z.e, f * z.f, g * z.g, h * z.h, ..
 			e * z.e, f * z.f, g * z.g, h * z.h, ..
 			i * z.i, j * z.j, k * z.k, l * z.l, ..
 			i * z.i, j * z.j, k * z.k, l * z.l, ..
 			m * z.m, n * z.n, o * z.o, p * z.p)
 			m * z.m, n * z.n, o * z.o, p * z.p)
@@ -642,11 +642,11 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Returns a projection matrix with a viewing frustum defined by the plane coordinates passed in.
 	bbdoc: Returns a projection matrix with a viewing frustum defined by the plane coordinates passed in.
 	End Rem
 	End Rem
-	Function Frustum:SMat4(l:Double, r:Double, b:Double, t:Double, n:Double, f:Double)
+	Function Frustum:SMat4D(l:Double, r:Double, b:Double, t:Double, n:Double, f:Double)
 		Local rl:Double = 1.0 / (r - l)
 		Local rl:Double = 1.0 / (r - l)
 		Local tb:Double = 1.0 / (t - b)
 		Local tb:Double = 1.0 / (t - b)
 		Local nf:Double = 1.0 / (n - f)
 		Local nf:Double = 1.0 / (n - f)
-		Return New SMat4((2.0 * n) * rl, 0, 0, 0, ..
+		Return New SMat4D((2.0 * n) * rl, 0, 0, 0, ..
 			0, (2.0 * n) * tb, 0, 0, ..
 			0, (2.0 * n) * tb, 0, 0, ..
 			(r + l) * rl, (t + b) * tb, (f + n) * nf, -1, ..
 			(r + l) * rl, (t + b) * tb, (f + n) * nf, -1, ..
 			0, 0, (2.0 * n * f) * nf, 0)
 			0, 0, (2.0 * n * f) * nf, 0)
@@ -657,7 +657,7 @@ Struct SMat4
 	about: An inverted matrix is such that if multiplied by the original would result in identity matrix.
 	about: An inverted matrix is such that if multiplied by the original would result in identity matrix.
 	If some matrix transforms vectors in a particular way, then the inverse matrix can transform them back.
 	If some matrix transforms vectors in a particular way, then the inverse matrix can transform them back.
 	End Rem
 	End Rem
-	Method Invert:SMat4()
+	Method Invert:SMat4D()
 		Local a00:Double = a
 		Local a00:Double = a
 		Local a01:Double = b
 		Local a01:Double = b
 		Local a02:Double = c
 		Local a02:Double = c
@@ -688,10 +688,10 @@ Struct SMat4
 		Local b11:Double = a22 * a33 - a23 * a32
 		Local b11:Double = a22 * a33 - a23 * a32
 		Local det:Double = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06
 		Local det:Double = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06
 		If det = 0 Then
 		If det = 0 Then
-			Return New SMat4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
+			Return New SMat4D(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
 		End If
 		End If
 		det = 1 / det
 		det = 1 / det
-		Return New SMat4((a11 * b11 - a12 * b10 + a13 * b09) * det, ..
+		Return New SMat4D((a11 * b11 - a12 * b10 + a13 * b09) * det, ..
 			(a02 * b10 - a01 * b11 - a03 * b09) * det, ..
 			(a02 * b10 - a01 * b11 - a03 * b09) * det, ..
 			(a31 * b05 - a32 * b04 + a33 * b03) * det, ..
 			(a31 * b05 - a32 * b04 + a33 * b03) * det, ..
 			(a22 * b04 - a21 * b05 - a23 * b03) * det, ..
 			(a22 * b04 - a21 * b05 - a23 * b03) * det, ..
@@ -713,7 +713,7 @@ Struct SMat4
 	bbdoc: Computes a transformation matrix that corresponds to a camera viewing the @eye from the @pos.
 	bbdoc: Computes a transformation matrix that corresponds to a camera viewing the @eye from the @pos.
 	about: The right-hand vector is perpendicular to the up vector.
 	about: The right-hand vector is perpendicular to the up vector.
 	End Rem
 	End Rem
-	Function LookAt:SMat4(eye:SVec3, pos:SVec3, up:SVec3)
+	Function LookAt:SMat4D(eye:SVec3D, pos:SVec3D, up:SVec3D)
 		Local ex:Double = eye.x
 		Local ex:Double = eye.x
 		Local ey:Double = eye.y
 		Local ey:Double = eye.y
 		Local ez:Double = eye.z
 		Local ez:Double = eye.z
@@ -769,7 +769,7 @@ Struct SMat4
 			y2 :* length
 			y2 :* length
 		End If
 		End If
 		
 		
-		Return New SMat4(x0, y0, z0, 0, x1, y1, z1, 0, x2, y2, z2, 0, ..
+		Return New SMat4D(x0, y0, z0, 0, x1, y1, z1, 0, x2, y2, z2, 0, ..
 			-(x0 * ex + x1 * ey + x2 * ez), -(y0 * ex + y1 * ey + y2 * ez), -(z0 * ex + z1 * ey + z2 * ez), 1)
 			-(x0 * ex + x1 * ey + x2 * ez), -(y0 * ex + y1 * ey + y2 * ez), -(z0 * ex + z1 * ey + z2 * ez), 1)
 	End Function
 	End Function
 	
 	
@@ -777,9 +777,9 @@ Struct SMat4
 	bbdoc: Creates an orthogonal projection matrix.
 	bbdoc: Creates an orthogonal projection matrix.
 	about: The returned matrix, when used as a Camera's projection matrix, creates a view showing the area between @width and @height, with @zNear and @zFar as the near and far depth clipping planes.
 	about: The returned matrix, when used as a Camera's projection matrix, creates a view showing the area between @width and @height, with @zNear and @zFar as the near and far depth clipping planes.
 	End Rem
 	End Rem
-	Function Orthogonal:SMat4(width:Double, height:Double, zNear:Double, zFar:Double)
+	Function Orthogonal:SMat4D(width:Double, height:Double, zNear:Double, zFar:Double)
 		Local nf:Double = 1.0 / (zNear - zFar)
 		Local nf:Double = 1.0 / (zNear - zFar)
-		Return New SMat4(2.0 / width, 0, 0, 0, ..
+		Return New SMat4D(2.0 / width, 0, 0, 0, ..
 			0, 2.0 / height, 0, 0, ..
 			0, 2.0 / height, 0, 0, ..
 			0, 0, 2.0 * nf, 0, ..
 			0, 0, 2.0 * nf, 0, ..
 			0, 0, (zNear + zFar) * nf, 1)
 			0, 0, (zNear + zFar) * nf, 1)
@@ -788,10 +788,10 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Creates a perspective projection matrix.
 	bbdoc: Creates a perspective projection matrix.
 	End Rem
 	End Rem
-	Function Perspective:SMat4(fov:Double, w:Double, h:Double, n:Double, f:Double)
+	Function Perspective:SMat4D(fov:Double, w:Double, h:Double, n:Double, f:Double)
 		Local ft:Double = 1.0 / Tan(fov * 0.5)
 		Local ft:Double = 1.0 / Tan(fov * 0.5)
 		Local nf:Double = 1.0 / (n - f)
 		Local nf:Double = 1.0 / (n - f)
-		Return New SMat4(ft, 0, 0, 0, ..
+		Return New SMat4D(ft, 0, 0, 0, ..
 			0, ft * w / h, 0, 0, ..
 			0, ft * w / h, 0, 0, ..
 			0, 0, (f + n) * nf, -1, ..
 			0, 0, (f + n) * nf, -1, ..
 			0, 0, (2.0 * f * n) * nf, 0) 
 			0, 0, (2.0 * f * n) * nf, 0) 
@@ -800,7 +800,7 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Creates a rotation matrix, rotated @angle degrees around the point @axis.
 	bbdoc: Creates a rotation matrix, rotated @angle degrees around the point @axis.
 	End Rem
 	End Rem
-	Method Rotate:SMat4(axis:SVec3, angle:Double)
+	Method Rotate:SMat4D(axis:SVec3D, angle:Double)
 		Local x:Double = axis.x
 		Local x:Double = axis.x
 		Local y:Double = axis.y
 		Local y:Double = axis.y
 		Local z:Double = axis.z
 		Local z:Double = axis.z
@@ -828,7 +828,7 @@ Struct SMat4
 		Local b20:Double = x * z * t + y * sa
 		Local b20:Double = x * z * t + y * sa
 		Local b21:Double = y * z * t - x * sa
 		Local b21:Double = y * z * t - x * sa
 		Local b22:Double = z * z * t + ca
 		Local b22:Double = z * z * t + ca
-		Return New SMat4(a00 * b00 + a10 * b01 + a20 * b02, ..
+		Return New SMat4D(a00 * b00 + a10 * b01 + a20 * b02, ..
 			a01 * b00 + a11 * b01 + a21 * b02, ..
 			a01 * b00 + a11 * b01 + a21 * b02, ..
 			a02 * b00 + a12 * b01 + a22 * b02, ..
 			a02 * b00 + a12 * b01 + a22 * b02, ..
 			a03 * b00 + a13 * b01 + a23 * b02, ..
 			a03 * b00 + a13 * b01 + a23 * b02, ..
@@ -846,14 +846,14 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Returns a rotation matrix on the given @axis and @angle degrees.
 	bbdoc: Returns a rotation matrix on the given @axis and @angle degrees.
 	End Rem
 	End Rem
-	Function Rotation:SMat4(axis:SVec3, angle:Double)
+	Function Rotation:SMat4D(axis:SVec3D, angle:Double)
 		Local x:Double = axis.x
 		Local x:Double = axis.x
 		Local y:Double = axis.y
 		Local y:Double = axis.y
 		Local z:Double = axis.z
 		Local z:Double = axis.z
 		Local sa:Double = Sin(angle)
 		Local sa:Double = Sin(angle)
 		Local ca:Double = Cos(angle)
 		Local ca:Double = Cos(angle)
 		Local t:Double = 1 - ca
 		Local t:Double = 1 - ca
-		Return New SMat4(x * x * t + ca, ..
+		Return New SMat4D(x * x * t + ca, ..
 			y * x * t + z * sa, ..
 			y * x * t + z * sa, ..
 			z * x * t - y * sa, ..
 			z * x * t - y * sa, ..
 			0, ..
 			0, ..
@@ -870,11 +870,11 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Scales the matrix, return the new scaled matrix.
 	bbdoc: Scales the matrix, return the new scaled matrix.
 	End Rem
 	End Rem
-	Method Scale:SMat4(s:SVec3)
+	Method Scale:SMat4D(s:SVec3D)
 		Local bx:Double = s.x
 		Local bx:Double = s.x
 		Local by:Double = s.y
 		Local by:Double = s.y
 		Local bz:Double = s.z
 		Local bz:Double = s.z
-		Return New SMat4(a * bx, b * bx, c * bx, d * bx, ..
+		Return New SMat4D(a * bx, b * bx, c * bx, d * bx, ..
 			e * by, f * by, g * by, h * by, ..
 			e * by, f * by, g * by, h * by, ..
 			i * bz, j * bz, k * bz, l * bz, ..
 			i * bz, j * bz, k * bz, l * bz, ..
 			m, n, o, p)
 			m, n, o, p)
@@ -883,26 +883,26 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Creates a scaling matrix.
 	bbdoc: Creates a scaling matrix.
 	End Rem
 	End Rem
-	Function Scaling:SMat4(s:SVec3)
-		Return New SMat4(s.x, 0, 0, 0, 0, s.y, 0, 0, 0, 0, s.z, 0, 0, 0, 0, 1)
+	Function Scaling:SMat4D(s:SVec3D)
+		Return New SMat4D(s.x, 0, 0, 0, 0, s.y, 0, 0, 0, 0, s.z, 0, 0, 0, 0, 1)
 	End Function
 	End Function
 
 
 	Rem
 	Rem
 	bbdoc: Returns the transpose of this matrix.
 	bbdoc: Returns the transpose of this matrix.
 	about: The transposed matrix is the one that has the columns exchanged with its rows.
 	about: The transposed matrix is the one that has the columns exchanged with its rows.
 	End Rem
 	End Rem
-	Method Transpose:SMat4()
-		Return New SMat4(a, e, i, m, b, f, j, n, c, g, k, o, d, h, l, p)
+	Method Transpose:SMat4D()
+		Return New SMat4D(a, e, i, m, b, f, j, n, c, g, k, o, d, h, l, p)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Translates the matrix to @s.
 	bbdoc: Translates the matrix to @s.
 	End Rem
 	End Rem
-	Method Translate:SMat4(s:SVec3)
+	Method Translate:SMat4D(s:SVec3D)
 		Local bx:Double = s.x
 		Local bx:Double = s.x
 		Local by:Double = s.y
 		Local by:Double = s.y
 		Local bz:Double = s.z
 		Local bz:Double = s.z
-		Return New SMat4(a, b, c, d, e, f, g, h, i, j, k, l, ..
+		Return New SMat4D(a, b, c, d, e, f, g, h, i, j, k, l, ..
 			a * bx + e * by + i * bz + m, ..
 			a * bx + e * by + i * bz + m, ..
 			b * bx + f * by + j * bz + n, ..
 			b * bx + f * by + j * bz + n, ..
 			c * bx + g * by + k * bz + o, ..
 			c * bx + g * by + k * bz + o, ..
@@ -912,8 +912,8 @@ Struct SMat4
 	Rem
 	Rem
 	bbdoc: Creates a translation matrix.
 	bbdoc: Creates a translation matrix.
 	End Rem
 	End Rem
-	Function Translation:SMat4(s:SVec3)
-		Return New SMat4(1, 0, 0, 0, ..
+	Function Translation:SMat4D(s:SVec3D)
+		Return New SMat4D(1, 0, 0, 0, ..
 			0, 1, 0, 0, ..
 			0, 1, 0, 0, ..
 			0, 0, 1, 0, ..
 			0, 0, 1, 0, ..
 			s.x, s.y, s.z, 1)
 			s.x, s.y, s.z, 1)
@@ -1050,7 +1050,7 @@ Struct SMat2F
 	Rem
 	Rem
 	bbdoc: Returns the scale of this matrix.
 	bbdoc: Returns the scale of this matrix.
 	End Rem
 	End Rem
-	Method Scale:SMat2F(s:SVec2)
+	Method Scale:SMat2F(s:SVec2D)
 		Return New SMat2F(Float(a * s.x), Float(b * s.x), Float(c * s.y), Float(d * s.y))
 		Return New SMat2F(Float(a * s.x), Float(b * s.x), Float(c * s.y), Float(d * s.y))
 	End Method
 	End Method
 	
 	
@@ -1064,7 +1064,7 @@ Struct SMat2F
 	Rem
 	Rem
 	bbdoc: Creates a scaled matrix of the scale @s.
 	bbdoc: Creates a scaled matrix of the scale @s.
 	End Rem
 	End Rem
-	Function Scaling:SMat2F(s:SVec2)
+	Function Scaling:SMat2F(s:SVec2D)
 		Return New SMat2F(Float(s.x), 0, 0, Float(s.y))
 		Return New SMat2F(Float(s.x), 0, 0, Float(s.y))
 	End Function
 	End Function
 	
 	
@@ -1292,7 +1292,7 @@ Struct SMat3F
 	Rem
 	Rem
 	bbdoc: Scales the matrix by @s, returning a new matrix.
 	bbdoc: Scales the matrix by @s, returning a new matrix.
 	End Rem
 	End Rem
-	Method Scale:SMat3F(s:SVec2)
+	Method Scale:SMat3F(s:SVec2D)
 		Local bx:Float = s.x
 		Local bx:Float = s.x
 		Local by:Float = s.y
 		Local by:Float = s.y
 		Return New SMat3F(Float(a * bx), Float(b * bx), Float(c * bx), Float(d * by), Float(e * by), Float(f * by), g, h, i)
 		Return New SMat3F(Float(a * bx), Float(b * bx), Float(c * bx), Float(d * by), Float(e * by), Float(f * by), g, h, i)
@@ -1308,7 +1308,7 @@ Struct SMat3F
 	Rem
 	Rem
 	bbdoc: Returns a scaling matrix of @s.
 	bbdoc: Returns a scaling matrix of @s.
 	End Rem
 	End Rem
-	Function Scaling:SMat3F(s:SVec2)
+	Function Scaling:SMat3F(s:SVec2D)
 		Return New SMat3F(Float(s.x), 0, 0, 0, Float(s.y), 0, 0, 0, 1)
 		Return New SMat3F(Float(s.x), 0, 0, 0, Float(s.y), 0, 0, 0, 1)
 	End Function
 	End Function
 	
 	
@@ -1810,7 +1810,7 @@ Struct SMat4F
 	Rem
 	Rem
 	bbdoc: Scales the matrix, return the new scaled matrix.
 	bbdoc: Scales the matrix, return the new scaled matrix.
 	End Rem
 	End Rem
-	Method Scale:SMat4F(s:SVec3)
+	Method Scale:SMat4F(s:SVec3D)
 		Local bx:Double = s.x
 		Local bx:Double = s.x
 		Local by:Double = s.y
 		Local by:Double = s.y
 		Local bz:Double = s.z
 		Local bz:Double = s.z
@@ -1830,7 +1830,7 @@ Struct SMat4F
 	Rem
 	Rem
 	bbdoc: Creates a Scaling matrix.
 	bbdoc: Creates a Scaling matrix.
 	End Rem
 	End Rem
-	Function Scaling:SMat4F(s:SVec3)
+	Function Scaling:SMat4F(s:SVec3D)
 		Return New SMat4F(Float(s.x), 0, 0, 0, 0, Float(s.y), 0, 0, 0, 0, Float(s.z), 0, 0, 0, 0, 1)
 		Return New SMat4F(Float(s.x), 0, 0, 0, 0, Float(s.y), 0, 0, 0, 0, Float(s.z), 0, 0, 0, 0, 1)
 	End Function
 	End Function
 
 
@@ -1859,7 +1859,7 @@ Struct SMat4F
 	Rem
 	Rem
 	bbdoc: Translates the matrix To @s.
 	bbdoc: Translates the matrix To @s.
 	End Rem
 	End Rem
-	Method Translate:SMat4F(s:SVec3)
+	Method Translate:SMat4F(s:SVec3D)
 		Local bx:Float = s.x
 		Local bx:Float = s.x
 		Local by:Float = s.y
 		Local by:Float = s.y
 		Local bz:Float = s.z
 		Local bz:Float = s.z
@@ -1883,7 +1883,7 @@ Struct SMat4F
 	Rem
 	Rem
 	bbdoc: Creates a translation matrix.
 	bbdoc: Creates a translation matrix.
 	End Rem
 	End Rem
-	Function Translation:SMat4F(s:SVec3)
+	Function Translation:SMat4F(s:SVec3D)
 		Return New SMat4F(1, 0, 0, 0, ..
 		Return New SMat4F(1, 0, 0, 0, ..
 			0, 1, 0, 0, ..
 			0, 1, 0, 0, ..
 			0, 0, 1, 0, ..
 			0, 0, 1, 0, ..
@@ -2021,7 +2021,7 @@ Struct SMat2I
 	Rem
 	Rem
 	bbdoc: Returns the scale of this matrix.
 	bbdoc: Returns the scale of this matrix.
 	End Rem
 	End Rem
-	Method Scale:SMat2I(s:SVec2)
+	Method Scale:SMat2I(s:SVec2D)
 		Return New SMat2I(Int(a * s.x), Int(b * s.x), Int(c * s.y), Int(d * s.y))
 		Return New SMat2I(Int(a * s.x), Int(b * s.x), Int(c * s.y), Int(d * s.y))
 	End Method
 	End Method
 
 
@@ -2263,7 +2263,7 @@ Struct SMat3I
 	Rem
 	Rem
 	bbdoc: Scales the matrix by @s, returning a new matrix.
 	bbdoc: Scales the matrix by @s, returning a new matrix.
 	End Rem
 	End Rem
-	Method Scale:SMat3I(s:SVec2)
+	Method Scale:SMat3I(s:SVec2D)
 		Local bx:Int = s.x
 		Local bx:Int = s.x
 		Local by:Int = s.y
 		Local by:Int = s.y
 		Return New SMat3I(Int(a * bx), Int(b * bx), Int(c * bx), Int(d * by), Int(e * by), Int(f * by), g, h, i)
 		Return New SMat3I(Int(a * bx), Int(b * bx), Int(c * bx), Int(d * by), Int(e * by), Int(f * by), g, h, i)
@@ -2288,7 +2288,7 @@ Struct SMat3I
 	Rem
 	Rem
 	bbdoc: Returns a scaling matrix of @s.
 	bbdoc: Returns a scaling matrix of @s.
 	End Rem
 	End Rem
-	Function Scaling:SMat3I(s:SVec2)
+	Function Scaling:SMat3I(s:SVec2D)
 		Return New SMat3I(Int(s.x), 0, 0, 0, Int(s.y), 0, 0, 0, 1)
 		Return New SMat3I(Int(s.x), 0, 0, 0, Int(s.y), 0, 0, 0, 1)
 	End Function
 	End Function
 
 
@@ -2797,7 +2797,7 @@ Struct SMat4I
 	Rem
 	Rem
 	bbdoc: Scales the matrix, return the new scaled matrix.
 	bbdoc: Scales the matrix, return the new scaled matrix.
 	End Rem
 	End Rem
-	Method Scale:SMat4I(s:SVec3)
+	Method Scale:SMat4I(s:SVec3D)
 		Local bx:Double = s.x
 		Local bx:Double = s.x
 		Local by:Double = s.y
 		Local by:Double = s.y
 		Local bz:Double = s.z
 		Local bz:Double = s.z
@@ -2830,7 +2830,7 @@ Struct SMat4I
 	Rem
 	Rem
 	bbdoc: Creates a scaling matrix.
 	bbdoc: Creates a scaling matrix.
 	End Rem
 	End Rem
-	Function Scaling:SMat4I(s:SVec3)
+	Function Scaling:SMat4I(s:SVec3D)
 		Return New SMat4I(Int(s.x), 0, 0, 0, 0, Int(s.y), 0, 0, 0, 0, Int(s.z), 0, 0, 0, 0, 1)
 		Return New SMat4I(Int(s.x), 0, 0, 0, 0, Int(s.y), 0, 0, 0, 0, Int(s.z), 0, 0, 0, 0, 1)
 	End Function
 	End Function
 
 
@@ -2866,7 +2866,7 @@ Struct SMat4I
 	Rem
 	Rem
 	bbdoc: Translates the matrix to @s.
 	bbdoc: Translates the matrix to @s.
 	End Rem
 	End Rem
-	Method Translate:SMat4I(s:SVec3)
+	Method Translate:SMat4I(s:SVec3D)
 		Local bx:Double = s.x
 		Local bx:Double = s.x
 		Local by:Double = s.y
 		Local by:Double = s.y
 		Local bz:Double = s.z
 		Local bz:Double = s.z
@@ -2904,7 +2904,7 @@ Struct SMat4I
 	Rem
 	Rem
 	bbdoc: Creates a translation matrix.
 	bbdoc: Creates a translation matrix.
 	End Rem
 	End Rem
-	Function Translation:SMat4I(s:SVec3)
+	Function Translation:SMat4I(s:SVec3D)
 		Return New SMat4I(1, 0, 0, 0, ..
 		Return New SMat4I(1, 0, 0, 0, ..
 			0, 1, 0, 0, ..
 			0, 1, 0, 0, ..
 			0, 0, 1, 0, ..
 			0, 0, 1, 0, ..

+ 39 - 39
quaternion.mod/quaternion.bmx

@@ -43,14 +43,14 @@ bbdoc: A Quaternion.
 about: Quaternions are used to represent rotations.
 about: Quaternions are used to represent rotations.
 They are compact, don't suffer from gimbal lock and can easily be interpolated.
 They are compact, don't suffer from gimbal lock and can easily be interpolated.
 End Rem
 End Rem
-Struct SQuat
+Struct SQuatD
 	Field x:Double
 	Field x:Double
 	Field y:Double
 	Field y:Double
 	Field z:Double
 	Field z:Double
 	Field w:Double
 	Field w:Double
 	
 	
 	Rem
 	Rem
-	bbdoc: Creates a new #SQuat from the supplied arguments.
+	bbdoc: Creates a new #SQuatD from the supplied arguments.
 	End Rem
 	End Rem
 	Method New(x:Double, y:Double, z:Double, w:Double)
 	Method New(x:Double, y:Double, z:Double, w:Double)
 		Self.x = x
 		Self.x = x
@@ -62,7 +62,7 @@ Struct SQuat
 	Rem
 	Rem
 	bbdoc: Applies the quaternion @a to the matrix, returning a new matrix.
 	bbdoc: Applies the quaternion @a to the matrix, returning a new matrix.
 	End Rem
 	End Rem
-	Function ToMat3:SMat3(a:SQuat)
+	Function ToMat3:SMat3D(a:SQuatD)
 		Local ax:Double = a.x
 		Local ax:Double = a.x
 		Local ay:Double = a.y
 		Local ay:Double = a.y
 		Local az:Double = a.z
 		Local az:Double = a.z
@@ -79,13 +79,13 @@ Struct SQuat
 		Local awx:Double = aw * ax2
 		Local awx:Double = aw * ax2
 		Local awy:Double = aw * ay2
 		Local awy:Double = aw * ay2
 		Local awz:Double = aw * az2
 		Local awz:Double = aw * az2
-		Return New SMat3(1 - ayy - azz, ayx + awz, azx - awy, ayx - awz, 1.0 - axx - azz, azy + awx, azx + awy, azy - awx, 1.0 - axx - ayy)
+		Return New SMat3D(1 - ayy - azz, ayx + awz, azx - awy, ayx - awz, 1.0 - axx - azz, azy + awx, azx + awy, azy - awx, 1.0 - axx - ayy)
 	End Function
 	End Function
 
 
 	Rem
 	Rem
 	bbdoc: Applies the quaternian to the matrix, return the new matrix.
 	bbdoc: Applies the quaternian to the matrix, return the new matrix.
 	End Rem
 	End Rem
-	Function ToMat4:SMat4(a:SQuat)
+	Function ToMat4:SMat4D(a:SQuatD)
 		Local ax:Double = a.x
 		Local ax:Double = a.x
 		Local ay:Double = a.y
 		Local ay:Double = a.y
 		Local az:Double = a.z
 		Local az:Double = a.z
@@ -102,7 +102,7 @@ Struct SQuat
 		Local awx:Double = aw * ax2
 		Local awx:Double = aw * ax2
 		Local awy:Double = aw * ay2
 		Local awy:Double = aw * ay2
 		Local awz:Double = aw * az2
 		Local awz:Double = aw * az2
-		Return New SMat4(1.0 - ayy - azz, ayx + awz, azx - awy, 0, ..
+		Return New SMat4D(1.0 - ayy - azz, ayx + awz, azx - awy, 0, ..
 			ayx - awz, 1.0 - axx - azz, azy + awx, 0, ..
 			ayx - awz, 1.0 - axx - azz, azy + awx, 0, ..
 			azx + awy, azy - awx, 1.0 - axx - ayy, 0, ..
 			azx + awy, azy - awx, 1.0 - axx - ayy, 0, ..
 			0, 0, 0, 1)
 			0, 0, 0, 1)
@@ -112,7 +112,7 @@ Struct SQuat
 	bbdoc: Creates a translation and rotation matrix.
 	bbdoc: Creates a translation and rotation matrix.
 	about: The returned matrix is such that it places objects at position @s, oriented in rotation @a.
 	about: The returned matrix is such that it places objects at position @s, oriented in rotation @a.
 	End Rem
 	End Rem
-	Function RotTrans:SMat4(a:SQuat, s:SVec3)
+	Function RotTrans:SMat4D(a:SQuatD, s:SVec3D)
 		Local ax:Double = a.x
 		Local ax:Double = a.x
 		Local ay:Double = a.y
 		Local ay:Double = a.y
 		Local az:Double = a.x
 		Local az:Double = a.x
@@ -129,7 +129,7 @@ Struct SQuat
 		Local awx:Double = aw * ax2
 		Local awx:Double = aw * ax2
 		Local awy:Double = aw * ay2
 		Local awy:Double = aw * ay2
 		Local awz:Double = aw * az2
 		Local awz:Double = aw * az2
-		Return New SMat4(1.0 - ayy - azz, axy + awz, axz - awy, 0, ..
+		Return New SMat4D(1.0 - ayy - azz, axy + awz, axz - awy, 0, ..
 			axy - awz, 1.0 - axx - azz, ayz + awx, 0, ..
 			axy - awz, 1.0 - axx - azz, ayz + awx, 0, ..
 			axz + awy, ayz - awx, 1.0 - axx - ayy, 0, ..
 			axz + awy, ayz - awx, 1.0 - axx - ayy, 0, ..
 			s.x, s.y, s.z, 1)
 			s.x, s.y, s.z, 1)
@@ -139,7 +139,7 @@ Struct SQuat
 	bbdoc: Creates a translation, rotation and scaling matrix.
 	bbdoc: Creates a translation, rotation and scaling matrix.
 	about: The returned matrix is such that it places objects at position @origin, oriented in rotation @a and scaled by @s.
 	about: The returned matrix is such that it places objects at position @origin, oriented in rotation @a and scaled by @s.
 	End Rem
 	End Rem
-	Function RotTransOrigin:SMat4(a:SQuat, s:SVec3, origin:SVec3)
+	Function RotTransOrigin:SMat4D(a:SQuatD, s:SVec3D, origin:SVec3D)
 		Local ax:Double = a.x
 		Local ax:Double = a.x
 		Local ay:Double = a.y
 		Local ay:Double = a.y
 		Local az:Double = a.x
 		Local az:Double = a.x
@@ -168,7 +168,7 @@ Struct SQuat
 		Local o20:Double = axz + awy
 		Local o20:Double = axz + awy
 		Local o21:Double = ayz - awx
 		Local o21:Double = ayz - awx
 		Local o22:Double = 1.0 - axx - ayy
 		Local o22:Double = 1.0 - axx - ayy
-		Return New SMat4(o00, o01, o02, 0, ..
+		Return New SMat4D(o00, o01, o02, 0, ..
 			o10, o11, o12, 0, ..
 			o10, o11, o12, 0, ..
 			o20, o21, o22, 0, ..
 			o20, o21, o22, 0, ..
 			s.x + ox - (o00 * ox + o10 * oy + o20 * oz), ..
 			s.x + ox - (o00 * ox + o10 * oy + o20 * oz), ..
@@ -179,34 +179,34 @@ Struct SQuat
 	Rem
 	Rem
 	bbdoc: The dot product between two rotations.
 	bbdoc: The dot product between two rotations.
 	End Rem
 	End Rem
-	Method Dot:Double(b:SQuat)
+	Method Dot:Double(b:SQuatD)
 		Return x * b.x + y * b.y + z * b.z + w * b.w
 		Return x * b.x + y * b.y + z * b.z + w * b.w
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns the Inverse of rotation.
 	bbdoc: Returns the Inverse of rotation.
 	End Rem
 	End Rem
-	Method Invert:SQuat()
+	Method Invert:SQuatD()
 		Local dot:Double = x * x + y * y + z * z + w * w
 		Local dot:Double = x * x + y * y + z * z + w * w
 		Local invdot:Double
 		Local invdot:Double
 		If dot <> 0 Then
 		If dot <> 0 Then
 			invdot = 1 / dot
 			invdot = 1 / dot
 		End If
 		End If
-		Return New SQuat(-x * invdot, -y * invdot, -z * invdot, w * invdot)
+		Return New SQuatD(-x * invdot, -y * invdot, -z * invdot, w * invdot)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
-	bbdoc: Interpolates between the SQuat and @b by @t and normalizes the result afterwards.
+	bbdoc: Interpolates between the SQuatD and @b by @t and normalizes the result afterwards.
 	End Rem
 	End Rem
-	Method Interpolate:SQuat(b:SQuat, t:Double)
-		Return New SQuat(Lerp(x, b.x, t), Lerp(y, b.y, t), Lerp(z, b.z, t), Lerp(w, b.w, t))
+	Method Interpolate:SQuatD(b:SQuatD, t:Double)
+		Return New SQuatD(Lerp(x, b.x, t), Lerp(y, b.y, t), Lerp(z, b.z, t), Lerp(w, b.w, t))
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Multiplies the quaternion by @b, returning a new quaternion.
 	bbdoc: Multiplies the quaternion by @b, returning a new quaternion.
 	End Rem
 	End Rem
-	Method Operator*:SQuat(b:SQuat)
-		Return New SQuat(x * b.w + w * b.x + y * b.z - z * b.y, ..
+	Method Operator*:SQuatD(b:SQuatD)
+		Return New SQuatD(x * b.w + w * b.x + y * b.z - z * b.y, ..
 			y * b.w + w * b.y + z * b.x - x * b.z, ..
 			y * b.w + w * b.y + z * b.x - x * b.z, ..
 			z * b.w + w * b.z + x * b.y - y * b.x, ..
 			z * b.w + w * b.z + x * b.y - y * b.x, ..
 			w * b.w - x * b.x - y * b.y - z * b.z)
 			w * b.w - x * b.x - y * b.y - z * b.z)
@@ -215,33 +215,33 @@ Struct SQuat
 	Rem
 	Rem
 	bbdoc: Returns a new quaternion, negated.
 	bbdoc: Returns a new quaternion, negated.
 	End Rem
 	End Rem
-	Method Operator-:SQuat()
-		Return New SQuat(-x, -y, -z, -w)
+	Method Operator-:SQuatD()
+		Return New SQuatD(-x, -y, -z, -w)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: The identity rotation.
 	bbdoc: The identity rotation.
 	End Rem
 	End Rem
-	Function Identity:SQuat()
-		Return New SQuat(0, 0, 0, 1)
+	Function Identity:SQuatD()
+		Return New SQuatD(0, 0, 0, 1)
 	End Function
 	End Function
 	
 	
 	Rem
 	Rem
 	bbdoc: Converts this quaternion to one with the same orientation but with a magnitude of 1.
 	bbdoc: Converts this quaternion to one with the same orientation but with a magnitude of 1.
 	End Rem
 	End Rem
-	Method Normal:SQuat()
+	Method Normal:SQuatD()
 		Local length:Double = x * x + y * y + z * z + w * w
 		Local length:Double = x * x + y * y + z * z + w * w
 		If length > 0 Then
 		If length > 0 Then
 			length = Sqr(length)
 			length = Sqr(length)
-			Return New SQuat(x * length, y * length, z * length, w * length)
+			Return New SQuatD(x * length, y * length, z * length, w * length)
 		End If
 		End If
 		Return Self
 		Return Self
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
-	bbdoc: Spherically interpolates between this SQuat and @b by @t.
+	bbdoc: Spherically interpolates between this SQuatD and @b by @t.
 	End Rem
 	End Rem
-	Method SphericalInterpolate:SQuat(b:SQuat, t:Double)
+	Method SphericalInterpolate:SQuatD(b:SQuatD, t:Double)
 		Local bx:Double = b.x
 		Local bx:Double = b.x
 		Local by:Double = b.y
 		Local by:Double = b.y
 		Local bz:Double = b.z
 		Local bz:Double = b.z
@@ -269,20 +269,20 @@ Struct SQuat
 			scale1 = t
 			scale1 = t
 		End If
 		End If
 		
 		
-		Return New SQuat(scale0 * x + scale1 * bx, scale0 * y + scale1 * by, scale0 * z + scale1 * bz, scale0 * w + scale1 * bw)
+		Return New SQuatD(scale0 * x + scale1 * bx, scale0 * y + scale1 * by, scale0 * z + scale1 * bz, scale0 * w + scale1 * bw)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a rotation that rotates around @rot.
 	bbdoc: Returns a rotation that rotates around @rot.
 	End Rem
 	End Rem
-	Method EulerXYZ:SQuat(rot:SVec3)
+	Method EulerXYZ:SQuatD(rot:SVec3D)
 		Local cx:Double = Cos(rot.x)
 		Local cx:Double = Cos(rot.x)
 		Local cy:Double = Cos(rot.y)
 		Local cy:Double = Cos(rot.y)
 		Local cz:Double = Cos(rot.z)
 		Local cz:Double = Cos(rot.z)
 		Local sx:Double = Sin(rot.x)
 		Local sx:Double = Sin(rot.x)
 		Local sy:Double = Sin(rot.y)
 		Local sy:Double = Sin(rot.y)
 		Local sz:Double = Sin(rot.z)
 		Local sz:Double = Sin(rot.z)
-		Return New SQuat(sx * cy * cz + cx * sy * sz, ..
+		Return New SQuatD(sx * cy * cz + cx * sy * sz, ..
 			cx * sy * cz - sx * cy * sz, ..
 			cx * sy * cz - sx * cy * sz, ..
 			cx * cy * sz + sx * sy * cz, ..
 			cx * cy * sz + sx * sy * cz, ..
 			cx * cy * cz - sx * sy * sz)
 			cx * cy * cz - sx * sy * sz)
@@ -291,14 +291,14 @@ Struct SQuat
 	Rem
 	Rem
 	bbdoc: Returns a rotation that rotates around @rot.
 	bbdoc: Returns a rotation that rotates around @rot.
 	End Rem
 	End Rem
-	Method EulerXZY:SQuat(rot:SVec3)
+	Method EulerXZY:SQuatD(rot:SVec3D)
 		Local cx:Double = Cos(rot.x)
 		Local cx:Double = Cos(rot.x)
 		Local cy:Double = Cos(rot.y)
 		Local cy:Double = Cos(rot.y)
 		Local cz:Double = Cos(rot.z)
 		Local cz:Double = Cos(rot.z)
 		Local sx:Double = Sin(rot.x)
 		Local sx:Double = Sin(rot.x)
 		Local sy:Double = Sin(rot.y)
 		Local sy:Double = Sin(rot.y)
 		Local sz:Double = Sin(rot.z)
 		Local sz:Double = Sin(rot.z)
-		Return New SQuat(sx * cy * cz - cx * sy * sz, ..
+		Return New SQuatD(sx * cy * cz - cx * sy * sz, ..
 			cx * sy * cz - sx * cy * sz, ..
 			cx * sy * cz - sx * cy * sz, ..
 			cx * cy * sz + sx * sy * cz, ..
 			cx * cy * sz + sx * sy * cz, ..
 			cx * cy * cz + sx * sy * sz)
 			cx * cy * cz + sx * sy * sz)
@@ -307,14 +307,14 @@ Struct SQuat
 	Rem
 	Rem
 	bbdoc: Returns a rotation that rotates around @rot.
 	bbdoc: Returns a rotation that rotates around @rot.
 	End Rem
 	End Rem
-	Method EulerYXZ:SQuat(rot:SVec3)
+	Method EulerYXZ:SQuatD(rot:SVec3D)
 		Local cx:Double = Cos(rot.x)
 		Local cx:Double = Cos(rot.x)
 		Local cy:Double = Cos(rot.y)
 		Local cy:Double = Cos(rot.y)
 		Local cz:Double = Cos(rot.z)
 		Local cz:Double = Cos(rot.z)
 		Local sx:Double = Sin(rot.x)
 		Local sx:Double = Sin(rot.x)
 		Local sy:Double = Sin(rot.y)
 		Local sy:Double = Sin(rot.y)
 		Local sz:Double = Sin(rot.z)
 		Local sz:Double = Sin(rot.z)
-		Return New SQuat(sx * cy * cz + cx * sy * sz, ..
+		Return New SQuatD(sx * cy * cz + cx * sy * sz, ..
 			cx * sy * cz - sx * cy * sz, ..
 			cx * sy * cz - sx * cy * sz, ..
 			cx * cy * sz - sx * sy * cz, ..
 			cx * cy * sz - sx * sy * cz, ..
 			cx * cy * cz + sx * sy * sz)
 			cx * cy * cz + sx * sy * sz)
@@ -323,14 +323,14 @@ Struct SQuat
 	Rem
 	Rem
 	bbdoc: Returns a rotation that rotates around @rot.
 	bbdoc: Returns a rotation that rotates around @rot.
 	End Rem
 	End Rem
-	Method EulerYZX:SQuat(rot:SVec3)
+	Method EulerYZX:SQuatD(rot:SVec3D)
 		Local cx:Double = Cos(rot.x)
 		Local cx:Double = Cos(rot.x)
 		Local cy:Double = Cos(rot.y)
 		Local cy:Double = Cos(rot.y)
 		Local cz:Double = Cos(rot.z)
 		Local cz:Double = Cos(rot.z)
 		Local sx:Double = Sin(rot.x)
 		Local sx:Double = Sin(rot.x)
 		Local sy:Double = Sin(rot.y)
 		Local sy:Double = Sin(rot.y)
 		Local sz:Double = Sin(rot.z)
 		Local sz:Double = Sin(rot.z)
-		Return New SQuat(sx * cy * cz + cx * sy * sz, ..
+		Return New SQuatD(sx * cy * cz + cx * sy * sz, ..
 			cx * sy * cz + sx * cy * sz, ..
 			cx * sy * cz + sx * cy * sz, ..
 			cx * cy * sz - sx * sy * cz, ..
 			cx * cy * sz - sx * sy * cz, ..
 			cx * cy * cz - sx * sy * sz)
 			cx * cy * cz - sx * sy * sz)
@@ -339,14 +339,14 @@ Struct SQuat
 	Rem
 	Rem
 	bbdoc: Returns a rotation that rotates around @rot.
 	bbdoc: Returns a rotation that rotates around @rot.
 	End Rem
 	End Rem
-	Method EulerZXY:SQuat(rot:SVec3)
+	Method EulerZXY:SQuatD(rot:SVec3D)
 		Local cx:Double = Cos(rot.x)
 		Local cx:Double = Cos(rot.x)
 		Local cy:Double = Cos(rot.y)
 		Local cy:Double = Cos(rot.y)
 		Local cz:Double = Cos(rot.z)
 		Local cz:Double = Cos(rot.z)
 		Local sx:Double = Sin(rot.x)
 		Local sx:Double = Sin(rot.x)
 		Local sy:Double = Sin(rot.y)
 		Local sy:Double = Sin(rot.y)
 		Local sz:Double = Sin(rot.z)
 		Local sz:Double = Sin(rot.z)
-		Return New SQuat(sx * cy * cz - cx * sy * sz, ..
+		Return New SQuatD(sx * cy * cz - cx * sy * sz, ..
 			cx * sy * cz + sx * cy * sz, ..
 			cx * sy * cz + sx * cy * sz, ..
 			cx * cy * sz + sx * sy * cz, ..
 			cx * cy * sz + sx * sy * cz, ..
 			cx * cy * cz - sx * sy * sz)
 			cx * cy * cz - sx * sy * sz)
@@ -355,14 +355,14 @@ Struct SQuat
 	Rem
 	Rem
 	bbdoc: Returns a rotation that rotates around @rot.
 	bbdoc: Returns a rotation that rotates around @rot.
 	End Rem
 	End Rem
-	Method EulerZYX:SQuat(rot:SVec3)
+	Method EulerZYX:SQuatD(rot:SVec3D)
 		Local cx:Double = Cos(rot.x)
 		Local cx:Double = Cos(rot.x)
 		Local cy:Double = Cos(rot.y)
 		Local cy:Double = Cos(rot.y)
 		Local cz:Double = Cos(rot.z)
 		Local cz:Double = Cos(rot.z)
 		Local sx:Double = Sin(rot.x)
 		Local sx:Double = Sin(rot.x)
 		Local sy:Double = Sin(rot.y)
 		Local sy:Double = Sin(rot.y)
 		Local sz:Double = Sin(rot.z)
 		Local sz:Double = Sin(rot.z)
-		Return New SQuat(sx * cy * cz - cx * sy * sz, ..
+		Return New SQuatD(sx * cy * cz - cx * sy * sz, ..
 			cx * sy * cz + sx * cy * sz, ..
 			cx * sy * cz + sx * cy * sz, ..
 			cx * cy * sz - sx * sy * cz, ..
 			cx * cy * sz - sx * sy * cz, ..
 			cx * cy * cz + sx * sy * sz)
 			cx * cy * cz + sx * sy * sz)

+ 0 - 14
vector.mod/doc/svec2_clamp.bmx

@@ -1,14 +0,0 @@
-SuperStrict
-
-Framework brl.standardio
-Import brl.vector
-
-Local a:SVec2 = New SVec2(0, 0)
-Local b:SVec2 = New SVec2(10, 5)
-
-Local v:SVec2 = New SVec2(11, -2)
-
-
-Local c:SVec2 = v.Clamp(a, b)
-
-Print c.ToString() ' 10, 0

+ 0 - 12
vector.mod/doc/svec2_max.bmx

@@ -1,12 +0,0 @@
-SuperStrict
-
-Framework brl.standardio
-Import brl.vector
-
-Local a:SVec2 = New SVec2(12, 8)
-Local b:SVec2 = New SVec2(10, 16)
-
-
-Local c:SVec2 = a.Max(b)
-
-Print c.ToString() ' 12, 16

+ 0 - 12
vector.mod/doc/svec2_min.bmx

@@ -1,12 +0,0 @@
-SuperStrict
-
-Framework brl.standardio
-Import brl.geometry
-
-Local a:SVec2 = New SVec2(12, 8)
-Local b:SVec2 = New SVec2(10, 16)
-
-
-Local c:SVec2 = a.Min(b)
-
-Print c.ToString() ' 10, 8

+ 0 - 11
vector.mod/doc/svec2_operator_add.bmx

@@ -1,11 +0,0 @@
-SuperStrict
-
-Framework brl.standardio
-Import brl.vector
-
-Local a:SVec2 = New SVec2(3, 2)
-Local b:SVec2 = New SVec2(-2, 1)
-
-Local c:SVec2 = a + b
-
-Print c.ToString() ' 1, 3

+ 0 - 11
vector.mod/doc/svec2_operator_div_svec2.bmx

@@ -1,11 +0,0 @@
-SuperStrict
-
-Framework brl.standardio
-Import brl.vector
-
-Local a:SVec2 = New SVec2(10, 18)
-Local b:SVec2 = New SVec2(5, 6)
-
-Local c:SVec2 = a / b
-
-Print c.ToString() ' 2, 3

+ 0 - 11
vector.mod/doc/svec2_operator_mul_svec2.bmx

@@ -1,11 +0,0 @@
-SuperStrict
-
-Framework brl.standardio
-Import brl.vector
-
-Local a:SVec2 = New SVec2(2, 3)
-Local b:SVec2 = New SVec2(5, 6)
-
-Local c:SVec2 = a * b
-
-Print c.ToString() ' 10, 18

+ 0 - 11
vector.mod/doc/svec2_operator_ne.bmx

@@ -1,11 +0,0 @@
-SuperStrict
-
-Framework brl.standardio
-Import brl.vector
-
-Local a:SVec2 = New SVec2(4, 5)
-Local b:SVec2 = New SVec2(3, 6)
-Local c:SVec2 = New SVec2(4, 5)
-
-Print a <> b ' true
-Print a <> c ' false

+ 0 - 11
vector.mod/doc/svec2_operator_sub_svec2.bmx

@@ -1,11 +0,0 @@
-SuperStrict
-
-Framework brl.standardio
-Import brl.vector
-
-Local a:SVec2 = New SVec2(12, 2)
-Local b:SVec2 = New SVec2(4, 5)
-
-Local c:SVec2 = a - b
-
-Print c.ToString() ' 8, -3

+ 0 - 11
vector.mod/doc/svec2_reflect.bmx

@@ -1,11 +0,0 @@
-SuperStrict
-
-Framework brl.standardio
-Import brl.vector
-
-Local a:SVec2 = New SVec2(5, 0)
-Local b:SVec2 = New SVec2(0, 10)
-
-Local c:SVec2 = a.Reflect(b)
-
-Print c.ToString() ' -5, 0

+ 2 - 2
vector.mod/doc/svec2_angleto.bmx → vector.mod/doc/svec2d_angleto.bmx

@@ -3,8 +3,8 @@ SuperStrict
 Framework brl.standardio
 Framework brl.standardio
 Import brl.vector
 Import brl.vector
 
 
-Local a:SVec2 = New SVec2(-5, -5)
-Local b:SVec2 = New SVec2(5, 5)
+Local a:SVec2D = New SVec2D(-5, -5)
+Local b:SVec2D = New SVec2D(5, 5)
 
 
 
 
 Local c:Double = a.AngleTo(b)
 Local c:Double = a.AngleTo(b)

+ 14 - 0
vector.mod/doc/svec2d_clamp.bmx

@@ -0,0 +1,14 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.vector
+
+Local a:SVec2D = New SVec2D(0, 0)
+Local b:SVec2D = New SVec2D(10, 5)
+
+Local v:SVec2D = New SVec2D(11, -2)
+
+
+Local c:SVec2D = v.Clamp(a, b)
+
+Print c.ToString() ' 10, 0

+ 2 - 2
vector.mod/doc/svec2_dot.bmx → vector.mod/doc/svec2d_dot.bmx

@@ -3,8 +3,8 @@ SuperStrict
 Framework brl.standardio
 Framework brl.standardio
 Import brl.vector
 Import brl.vector
 
 
-Local a:SVec2 = New SVec2(-6, 8)
-Local b:SVec2 = New SVec2(5, 12)
+Local a:SVec2D = New SVec2D(-6, 8)
+Local b:SVec2D = New SVec2D(5, 12)
 
 
 Local dot:Float = a.Dot(b)
 Local dot:Float = a.Dot(b)
 
 

+ 2 - 2
vector.mod/doc/svec2_interpolate.bmx → vector.mod/doc/svec2d_interpolate.bmx

@@ -3,8 +3,8 @@ SuperStrict
 Framework brl.standardio
 Framework brl.standardio
 Import brl.vector
 Import brl.vector
 
 
-Local a:SVec2 = New SVec2(-6, 8)
-Local b:SVec2 = New SVec2(5, 12)
+Local a:SVec2D = New SVec2D(-6, 8)
+Local b:SVec2D = New SVec2D(5, 12)
 
 
 Print a.Interpolate(b, 0).ToString() ' -6, 8
 Print a.Interpolate(b, 0).ToString() ' -6, 8
 Print a.Interpolate(b, 1).ToString() ' 5, 12
 Print a.Interpolate(b, 1).ToString() ' 5, 12

+ 1 - 1
vector.mod/doc/svec2_length.bmx → vector.mod/doc/svec2d_length.bmx

@@ -3,7 +3,7 @@ SuperStrict
 Framework brl.standardio
 Framework brl.standardio
 Import brl.vector
 Import brl.vector
 
 
-Local a:SVec2 = New SVec2(3, 4)
+Local a:SVec2D = New SVec2D(3, 4)
 
 
 Local length:Float = a.Length()
 Local length:Float = a.Length()
 
 

+ 2 - 2
vector.mod/doc/svec2_lengthsquared.bmx → vector.mod/doc/svec2d_lengthsquared.bmx

@@ -3,8 +3,8 @@ SuperStrict
 Framework brl.standardio
 Framework brl.standardio
 Import brl.vector
 Import brl.vector
 
 
-Local a:SVec2 = New SVec2(3, 4)
+Local a:SVec2D = New SVec2D(3, 4)
 
 
-Local length:Float = a.LengthSquared()
+Local length:Double = a.LengthSquared()
 
 
 Print length ' 25
 Print length ' 25

+ 12 - 0
vector.mod/doc/svec2d_max.bmx

@@ -0,0 +1,12 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.vector
+
+Local a:SVec2D = New SVec2D(12, 8)
+Local b:SVec2D = New SVec2D(10, 16)
+
+
+Local c:SVec2D = a.Max(b)
+
+Print c.ToString() ' 12, 16

+ 12 - 0
vector.mod/doc/svec2d_min.bmx

@@ -0,0 +1,12 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.vector
+
+Local a:SVec2D = New SVec2D(12, 8)
+Local b:SVec2D = New SVec2D(10, 16)
+
+
+Local c:SVec2D = a.Min(b)
+
+Print c.ToString() ' 10, 8

+ 2 - 2
vector.mod/doc/svec2_normal.bmx → vector.mod/doc/svec2d_normal.bmx

@@ -3,8 +3,8 @@ SuperStrict
 Framework brl.standardio
 Framework brl.standardio
 Import brl.vector
 Import brl.vector
 
 
-Local a:SVec2 = New SVec2(10, 0)
+Local a:SVec2D = New SVec2D(10, 0)
 
 
-Local b:SVec2= a.Normal()
+Local b:SVec2D = a.Normal()
 
 
 Print b.ToString() ' 1, 0
 Print b.ToString() ' 1, 0

+ 11 - 0
vector.mod/doc/svec2d_operator_add.bmx

@@ -0,0 +1,11 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.vector
+
+Local a:SVec2D = New SVec2D(3, 2)
+Local b:SVec2D = New SVec2D(-2, 1)
+
+Local c:SVec2D = a + b
+
+Print c.ToString() ' 1, 3

+ 2 - 2
vector.mod/doc/svec2_operator_div_f.bmx → vector.mod/doc/svec2d_operator_div_d.bmx

@@ -3,8 +3,8 @@ SuperStrict
 Framework brl.standardio
 Framework brl.standardio
 Import brl.vector
 Import brl.vector
 
 
-Local m:SVec2 = New SVec2(21, 9)
+Local m:SVec2D = New SVec2D(21, 9)
 
 
-Local a:SVec2 = m / 3
+Local a:SVec2D = m / 3
 
 
 Print a.ToString() ' 7, 3
 Print a.ToString() ' 7, 3

+ 11 - 0
vector.mod/doc/svec2d_operator_div_svec2d.bmx

@@ -0,0 +1,11 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.vector
+
+Local a:SVec2D = New SVec2D(10, 18)
+Local b:SVec2D = New SVec2D(5, 6)
+
+Local c:SVec2D = a / b
+
+Print c.ToString() ' 2, 3

+ 1 - 1
vector.mod/doc/svec2_operator_iget.bmx → vector.mod/doc/svec2d_operator_iget.bmx

@@ -3,6 +3,6 @@ SuperStrict
 Framework brl.standardio
 Framework brl.standardio
 Import brl.vector
 Import brl.vector
 
 
-Local a:SVec2 = New SVec2(6, 4)
+Local a:SVec2D = New SVec2D(6, 4)
 
 
 Print a[0] + ", " + a[1]
 Print a[0] + ", " + a[1]

+ 2 - 2
vector.mod/doc/svec2_operator_mul_f.bmx → vector.mod/doc/svec2d_operator_mul_d.bmx

@@ -3,8 +3,8 @@ SuperStrict
 Framework brl.standardio
 Framework brl.standardio
 Import brl.vector
 Import brl.vector
 
 
-Local m:SVec2 = New SVec2(7, 3)
+Local m:SVec2D = New SVec2D(7, 3)
 
 
-Local a:SVec2 = m * 3
+Local a:SVec2D = m * 3
 
 
 Print a.ToString() ' 21, 9
 Print a.ToString() ' 21, 9

+ 11 - 0
vector.mod/doc/svec2d_operator_mul_svec2d.bmx

@@ -0,0 +1,11 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.vector
+
+Local a:SVec2D = New SVec2D(2, 3)
+Local b:SVec2D = New SVec2D(5, 6)
+
+Local c:SVec2D = a * b
+
+Print c.ToString() ' 10, 18

+ 11 - 0
vector.mod/doc/svec2d_operator_ne.bmx

@@ -0,0 +1,11 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.vector
+
+Local a:SVec2D = New SVec2D(4, 5)
+Local b:SVec2D = New SVec2D(3, 6)
+Local c:SVec2D = New SVec2D(4, 5)
+
+Print a <> b ' true
+Print a <> c ' false

+ 2 - 2
vector.mod/doc/svec2_operator_sub.bmx → vector.mod/doc/svec2d_operator_sub.bmx

@@ -3,8 +3,8 @@ SuperStrict
 Framework brl.standardio
 Framework brl.standardio
 Import brl.vector
 Import brl.vector
 
 
-Local a:SVec2 = New SVec2(12, 2)
+Local a:SVec2D = New SVec2D(12, 2)
 
 
-Local b:SVec2 = -a
+Local b:SVec2D = -a
 
 
 Print b.ToString() ' -12, -2
 Print b.ToString() ' -12, -2

+ 11 - 0
vector.mod/doc/svec2d_operator_sub_svec2d.bmx

@@ -0,0 +1,11 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.vector
+
+Local a:SVec2D = New SVec2D(12, 2)
+Local b:SVec2D = New SVec2D(4, 5)
+
+Local c:SVec2D = a - b
+
+Print c.ToString() ' 8, -3

+ 11 - 0
vector.mod/doc/svec2d_reflect.bmx

@@ -0,0 +1,11 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.vector
+
+Local a:SVec2D = New SVec2D(5, 0)
+Local b:SVec2D = New SVec2D(0, 10)
+
+Local c:SVec2D = a.Reflect(b)
+
+Print c.ToString() ' -5, 0

+ 66 - 66
vector.mod/vector.bmx

@@ -40,12 +40,12 @@ Import BRL.StringBuilder
 Rem
 Rem
 bbdoc: A 2-element structure that can be used to represent positions and directions in 2D-space.
 bbdoc: A 2-element structure that can be used to represent positions and directions in 2D-space.
 End Rem
 End Rem
-Struct SVec2
+Struct SVec2D
 	Field ReadOnly x:Double
 	Field ReadOnly x:Double
 	Field ReadOnly y:Double
 	Field ReadOnly y:Double
 	
 	
 	Rem
 	Rem
-	bbdoc: Creates a new #SVec2 from the supplied arguments.
+	bbdoc: Creates a new #SVec2D from the supplied arguments.
 	End Rem
 	End Rem
 	Method New(x:Double, y:Double)
 	Method New(x:Double, y:Double)
 		Self.x = x
 		Self.x = x
@@ -55,64 +55,64 @@ Struct SVec2
 	Rem
 	Rem
 	bbdoc: Returns #True if @b is different.
 	bbdoc: Returns #True if @b is different.
 	End Rem
 	End Rem
-	Method Operator<>:Int(b:SVec2)
+	Method Operator<>:Int(b:SVec2D)
 		Return x <> b.x Or y <> b.y
 		Return x <> b.x Or y <> b.y
 	End Method
 	End Method
 
 
 	Rem
 	Rem
 	bbdoc: Returns #True if the vector and @b are aproximately equal.
 	bbdoc: Returns #True if the vector and @b are aproximately equal.
 	End Rem
 	End Rem
-	Method Operator=:Int(b:SVec2)
+	Method Operator=:Int(b:SVec2D)
 		Return (Self - b).LengthSquared() < 0.00000001
 		Return (Self - b).LengthSquared() < 0.00000001
 	End Method
 	End Method
 
 
 	Rem
 	Rem
 	bbdoc: Adds @b to the vector, returning a new vector.
 	bbdoc: Adds @b to the vector, returning a new vector.
 	End Rem
 	End Rem
-	Method Operator+:SVec2(b:SVec2)
-		Return New SVec2(x + b.x, y + b.y)
+	Method Operator+:SVec2D(b:SVec2D)
+		Return New SVec2D(x + b.x, y + b.y)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Subtracts @b from the vector, returning a new vector.
 	bbdoc: Subtracts @b from the vector, returning a new vector.
 	End Rem
 	End Rem
-	Method Operator-:SVec2(b:SVec2)
-		Return New SVec2(x - b.x, y - b.y)
+	Method Operator-:SVec2D(b:SVec2D)
+		Return New SVec2D(x - b.x, y - b.y)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Multiplies the vector by @b, returning a new vector.
 	bbdoc: Multiplies the vector by @b, returning a new vector.
 	End Rem
 	End Rem
-	Method Operator*:SVec2(b:SVec2)
-		Return New SVec2(x * b.x, y * b.y)
+	Method Operator*:SVec2D(b:SVec2D)
+		Return New SVec2D(x * b.x, y * b.y)
 	End Method
 	End Method
 
 
 	Rem
 	Rem
 	bbdoc: Divides the vector by @b, returning a new vector.
 	bbdoc: Divides the vector by @b, returning a new vector.
 	End Rem
 	End Rem
-	Method Operator/:SVec2(b:SVec2)
-		Return New SVec2(x / b.x, y / b.y)
+	Method Operator/:SVec2D(b:SVec2D)
+		Return New SVec2D(x / b.x, y / b.y)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a new vector, negated.
 	bbdoc: Returns a new vector, negated.
 	End Rem
 	End Rem
-	Method Operator-:SVec2()
-		Return New SVec2(-x, -y)
+	Method Operator-:SVec2D()
+		Return New SVec2D(-x, -y)
 	End Method
 	End Method
 
 
 	Rem
 	Rem
 	bbdoc: Scales the vector by @s, returning a new vector.
 	bbdoc: Scales the vector by @s, returning a new vector.
 	End Rem
 	End Rem
-	Method Operator*:SVec2(s:Double)
-		Return New SVec2(x * s, y * s)
+	Method Operator*:SVec2D(s:Double)
+		Return New SVec2D(x * s, y * s)
 	End Method
 	End Method
 
 
 	Rem
 	Rem
 	bbdoc: Divides the vector by @s, returning a new vector.
 	bbdoc: Divides the vector by @s, returning a new vector.
 	End Rem
 	End Rem
-	Method Operator/:SVec2(s:Double)
-		Return New SVec2(x / s, y / s)
+	Method Operator/:SVec2D(s:Double)
+		Return New SVec2D(x / s, y / s)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
@@ -132,7 +132,7 @@ Struct SVec2
 	Rem
 	Rem
 	bbdoc: Returns the unsigned angle between this vector and @b.
 	bbdoc: Returns the unsigned angle between this vector and @b.
 	End Rem
 	End Rem
-	Method AngleTo:Double(b:SVec2)
+	Method AngleTo:Double(b:SVec2D)
 		Local d:Double = Sqr(LengthSquared() * b.LengthSquared())
 		Local d:Double = Sqr(LengthSquared() * b.LengthSquared())
 
 
 		If d < 1e-15 Then
 		If d < 1e-15 Then
@@ -146,22 +146,22 @@ Struct SVec2
 	Rem
 	Rem
 	bbdoc: Returns a vector clamped between the vectors @minv and @maxv.
 	bbdoc: Returns a vector clamped between the vectors @minv and @maxv.
 	End Rem
 	End Rem
-	Method Clamp:SVec2(minv:SVec2, maxv:SVec2)
-		Return New SVec2(Clamp(x, minv.x, maxv.x), Clamp(y, minv.y, maxv.y))
+	Method Clamp:SVec2D(minv:SVec2D, maxv:SVec2D)
+		Return New SVec2D(Clamp(x, minv.x, maxv.x), Clamp(y, minv.y, maxv.y))
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a vector that is made from the smallest components of the two vectors.
 	bbdoc: Returns a vector that is made from the smallest components of the two vectors.
 	End Rem
 	End Rem
-	Method Min:SVec2(b:SVec2)
-		Return New SVec2(Min(x, b.x), Min(y, b.y))
+	Method Min:SVec2D(b:SVec2D)
+		Return New SVec2D(Min(x, b.x), Min(y, b.y))
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a vector that is made from the largest components of the two vectors.
 	bbdoc: Returns a vector that is made from the largest components of the two vectors.
 	End Rem
 	End Rem
-	Method Max:SVec2(b:SVec2)
-		Return New SVec2(Max(x, b.x), Max(y, b.y))
+	Method Max:SVec2D(b:SVec2D)
+		Return New SVec2D(Max(x, b.x), Max(y, b.y))
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
@@ -169,19 +169,19 @@ Struct SVec2
 	about: Interpolates between this vector and @b by the interpolant @t.
 	about: Interpolates between this vector and @b by the interpolant @t.
 	This is commonly used to find a point some fraction of the way along a line between two endpoints (e.g. to move an object gradually between those points).
 	This is commonly used to find a point some fraction of the way along a line between two endpoints (e.g. to move an object gradually between those points).
 	End Rem
 	End Rem
-	Method Interpolate:SVec2(b:SVec2, t:Double)
-		Return New SVec2(Lerp(x, b.x, t), Lerp(y, b.y, t))
+	Method Interpolate:SVec2D(b:SVec2D, t:Double)
+		Return New SVec2D(Lerp(x, b.x, t), Lerp(y, b.y, t))
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a vector with a magnitude of 1.
 	bbdoc: Returns a vector with a magnitude of 1.
 	about: When normalized, a vector keeps the same direction but its length is 1.0.
 	about: When normalized, a vector keeps the same direction but its length is 1.0.
 	End Rem
 	End Rem
-	Method Normal:SVec2()
+	Method Normal:SVec2D()
 		Local length:Double = x * x + y * y
 		Local length:Double = x * x + y * y
 		If length > 0 Then
 		If length > 0 Then
 			length = Sqr(length)
 			length = Sqr(length)
-			Return New SVec2(x / length, y / length)
+			Return New SVec2D(x / length, y / length)
 		End If
 		End If
 		Return Self
 		Return Self
 	End Method
 	End Method
@@ -191,7 +191,7 @@ Struct SVec2
 	about: For normalized vectors #Dot returns 1 if they point in exactly the same direction, -1 if they point in completely opposite directions,
 	about: For normalized vectors #Dot returns 1 if they point in exactly the same direction, -1 if they point in completely opposite directions,
 	and a number in between for other cases (e.g. Dot returns zero if vectors are perpendicular).
 	and a number in between for other cases (e.g. Dot returns zero if vectors are perpendicular).
 	End Rem
 	End Rem
-	Method Dot:Double(b:SVec2)
+	Method Dot:Double(b:SVec2D)
 		Return x * b.x + y * b.y
 		Return x * b.x + y * b.y
 	End Method
 	End Method
 	
 	
@@ -214,28 +214,28 @@ Struct SVec2
 	Rem
 	Rem
 	bbdoc: Returns the distance between the vector And @b.
 	bbdoc: Returns the distance between the vector And @b.
 	End Rem
 	End Rem
-	Method DistanceTo:Double(b:SVec2)
+	Method DistanceTo:Double(b:SVec2D)
 		Return (Self - b).Length()
 		Return (Self - b).Length()
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns the squared distance between the vector and @b.
 	bbdoc: Returns the squared distance between the vector and @b.
 	End Rem
 	End Rem
-	Method DistanceToSquared:Double(b:SVec2)
+	Method DistanceToSquared:Double(b:SVec2D)
 		Return (Self - b).LengthSquared()
 		Return (Self - b).LengthSquared()
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a vector perpendicular to the vector.
 	bbdoc: Returns a vector perpendicular to the vector.
 	End Rem
 	End Rem
-	Method Perpendicular:SVec2()
-		Return New SVec2(-y, x)
+	Method Perpendicular:SVec2D()
+		Return New SVec2D(-y, x)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a vector reflected from the given plane, specified by its normal vector.
 	bbdoc: Returns a vector reflected from the given plane, specified by its normal vector.
 	End Rem
 	End Rem
-	Method Reflect:SVec2(n:SVec2)
+	Method Reflect:SVec2D(n:SVec2D)
 		Return n * Dot(n) * 2.0 - Self
 		Return n * Dot(n) * 2.0 - Self
 	End Method
 	End Method
 
 
@@ -257,13 +257,13 @@ End Struct
 Rem
 Rem
 bbdoc: A 3-element structure that can be used to represent positions and directions in 3D-space.
 bbdoc: A 3-element structure that can be used to represent positions and directions in 3D-space.
 End Rem
 End Rem
-Struct SVec3
+Struct SVec3D
 	Field ReadOnly x:Double
 	Field ReadOnly x:Double
 	Field ReadOnly y:Double
 	Field ReadOnly y:Double
 	Field ReadOnly z:Double
 	Field ReadOnly z:Double
 	
 	
 	Rem
 	Rem
-	bbdoc: Creates a new #SVec3 from the supplied arguments.
+	bbdoc: Creates a new #SVec3D from the supplied arguments.
 	End Rem
 	End Rem
 	Method New(x:Double, y:Double, z:Double)
 	Method New(x:Double, y:Double, z:Double)
 		Self.x = x
 		Self.x = x
@@ -274,43 +274,43 @@ Struct SVec3
 	Rem
 	Rem
 	bbdoc: Adds @b to this vector, returning a new vector.
 	bbdoc: Adds @b to this vector, returning a new vector.
 	End Rem
 	End Rem
-	Method Operator+:SVec3(b:SVec3)
-		Return New SVec3(x + b.x, y + b.y, z + b.z)
+	Method Operator+:SVec3D(b:SVec3D)
+		Return New SVec3D(x + b.x, y + b.y, z + b.z)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Subtracts @b from this vector, returning a new vector.
 	bbdoc: Subtracts @b from this vector, returning a new vector.
 	End Rem
 	End Rem
-	Method Operator-:SVec3(b:SVec3)
-		Return New SVec3(x - b.x, y - b.y, z - b.z)
+	Method Operator-:SVec3D(b:SVec3D)
+		Return New SVec3D(x - b.x, y - b.y, z - b.z)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Multiplies the vector by @b, returning a new vector.
 	bbdoc: Multiplies the vector by @b, returning a new vector.
 	End Rem
 	End Rem
-	Method Operator*:SVec3(b:SVec3)
-		Return New SVec3(x * b.x, y * b.y, z * b.z)
+	Method Operator*:SVec3D(b:SVec3D)
+		Return New SVec3D(x * b.x, y * b.y, z * b.z)
 	End Method
 	End Method
 
 
 	Rem
 	Rem
 	bbdoc: Devides the vector by @b, returning a new vector.
 	bbdoc: Devides the vector by @b, returning a new vector.
 	End Rem
 	End Rem
-	Method Operator/:SVec3(b:SVec3)
-		Return New SVec3(x / b.x, y / b.y, z / b.z)
+	Method Operator/:SVec3D(b:SVec3D)
+		Return New SVec3D(x / b.x, y / b.y, z / b.z)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a negated version of this vector.
 	bbdoc: Returns a negated version of this vector.
 	End Rem
 	End Rem
-	Method Operator-:SVec3()
-		Return New SVec3(-x, -y, -z)
+	Method Operator-:SVec3D()
+		Return New SVec3D(-x, -y, -z)
 	End Method
 	End Method
 
 
 	Rem
 	Rem
 	bbdoc: Multiplies the vector by @s, returning a new vector.
 	bbdoc: Multiplies the vector by @s, returning a new vector.
 	End Rem
 	End Rem
-	Method Operator*:SVec3(s:Double)
-		Return New SVec3(x * s, y * s, z * s)
+	Method Operator*:SVec3D(s:Double)
+		Return New SVec3D(x * s, y * s, z * s)
 	End Method
 	End Method
 
 
 	Rem
 	Rem
@@ -332,29 +332,29 @@ Struct SVec3
 	Rem
 	Rem
 	bbdoc: Returns a vector clamped between the vectors @minv and @maxv.
 	bbdoc: Returns a vector clamped between the vectors @minv and @maxv.
 	End Rem
 	End Rem
-	Method Clamp:SVec3(minv:SVec3, maxv:SVec3)
-		Return New SVec3(Clamp(x, minv.x, maxv.x), Clamp(y, minv.y, maxv.y), Clamp(z, minv.z, maxv.z))
+	Method Clamp:SVec3D(minv:SVec3D, maxv:SVec3D)
+		Return New SVec3D(Clamp(x, minv.x, maxv.x), Clamp(y, minv.y, maxv.y), Clamp(z, minv.z, maxv.z))
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns the Cross Product of the two vectors.
 	bbdoc: Returns the Cross Product of the two vectors.
 	End Rem
 	End Rem
-	Method Cross:SVec3(b:SVec3)
-		Return New SVec3(y * b.z - z * b.y, z * b.x - x * b.z, x * b.y - y * b.x)
+	Method Cross:SVec3D(b:SVec3D)
+		Return New SVec3D(y * b.z - z * b.y, z * b.x - x * b.z, x * b.y - y * b.x)
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a vector that is made from the smallest components of the two vectors.
 	bbdoc: Returns a vector that is made from the smallest components of the two vectors.
 	End Rem
 	End Rem
-	Method Min:SVec3(b:SVec3)
-		Return New SVec3(Min(x, b.x), Min(y, b.y), Min(z, b.z))
+	Method Min:SVec3D(b:SVec3D)
+		Return New SVec3D(Min(x, b.x), Min(y, b.y), Min(z, b.z))
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a vector that is made from the largest components of the two vectors.
 	bbdoc: Returns a vector that is made from the largest components of the two vectors.
 	End Rem
 	End Rem
-	Method Max:SVec3(b:SVec3)
-		Return New SVec3(Max(x, b.x), Max(y, b.y), Max(z, b.z))
+	Method Max:SVec3D(b:SVec3D)
+		Return New SVec3D(Max(x, b.x), Max(y, b.y), Max(z, b.z))
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
@@ -362,19 +362,19 @@ Struct SVec3
 	about: Interpolates between this vector and @b by the interpolant @t.
 	about: Interpolates between this vector and @b by the interpolant @t.
 	This is commonly used to find a point some fraction of the way along a line between two endpoints (e.g. to move an object gradually between those points).
 	This is commonly used to find a point some fraction of the way along a line between two endpoints (e.g. to move an object gradually between those points).
 	End Rem
 	End Rem
-	Method Interpolate:SVec3(b:SVec3, t:Double)
-		Return New SVec3(Lerp(x, b.x, t), Lerp(y, b.y, t), Lerp(z, b.z, t))
+	Method Interpolate:SVec3D(b:SVec3D, t:Double)
+		Return New SVec3D(Lerp(x, b.x, t), Lerp(y, b.y, t), Lerp(z, b.z, t))
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a vector with a magnitude of 1.
 	bbdoc: Returns a vector with a magnitude of 1.
 	about: When normalized, a vector keeps the same direction but its length is 1.0.
 	about: When normalized, a vector keeps the same direction but its length is 1.0.
 	End Rem
 	End Rem
-	Method Normal:SVec3()
+	Method Normal:SVec3D()
 		Local length:Double = x * x + y * y + z * z
 		Local length:Double = x * x + y * y + z * z
 		If length > 0 Then
 		If length > 0 Then
 			length = Sqr(length)
 			length = Sqr(length)
-			Return New SVec3(x / length, y / length, z / length)
+			Return New SVec3D(x / length, y / length, z / length)
 		End If
 		End If
 		Return Self
 		Return Self
 	End Method
 	End Method
@@ -384,7 +384,7 @@ Struct SVec3
 	about: For normalized vectors Dot returns 1 if they point in exactly the same direction, -1 if they point in completely opposite directions,
 	about: For normalized vectors Dot returns 1 if they point in exactly the same direction, -1 if they point in completely opposite directions,
 	and a number in between for other cases (e.g. Dot returns zero if vectors are perpendicular).
 	and a number in between for other cases (e.g. Dot returns zero if vectors are perpendicular).
 	End Rem
 	End Rem
-	Method Dot:Double(b:SVec3)
+	Method Dot:Double(b:SVec3D)
 		Return x * b.x + y * b.y + z * b.z
 		Return x * b.x + y * b.y + z * b.z
 	End Method
 	End Method
 	
 	
@@ -407,28 +407,28 @@ Struct SVec3
 	Rem
 	Rem
 	bbdoc: Returns the distance between the vector and @b.
 	bbdoc: Returns the distance between the vector and @b.
 	End Rem
 	End Rem
-	Method DistanceTo:Double(b:SVec3)
+	Method DistanceTo:Double(b:SVec3D)
 		Return (Self - b).Length()
 		Return (Self - b).Length()
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns the squared distance between the vector and @b.
 	bbdoc: Returns the squared distance between the vector and @b.
 	End Rem
 	End Rem
-	Method DistanceToSquared:Double(b:SVec3)
+	Method DistanceToSquared:Double(b:SVec3D)
 		Return (Self - b).LengthSquared()
 		Return (Self - b).LengthSquared()
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: Returns a vector reflected from the given plane, specified by its normal vector.
 	bbdoc: Returns a vector reflected from the given plane, specified by its normal vector.
 	End Rem
 	End Rem
-	Method Reflect:SVec3(n:SVec3)
+	Method Reflect:SVec3D(n:SVec3D)
 		Return n * Dot(n) * 2.0 - Self
 		Return n * Dot(n) * 2.0 - Self
 	End Method
 	End Method
 	
 	
 	Rem
 	Rem
 	bbdoc: 
 	bbdoc: 
 	End Rem
 	End Rem
-	Method Orthogonal:SVec3(b:SVec3)
+	Method Orthogonal:SVec3D(b:SVec3D)
 		Return Cross(b).Normal()
 		Return Cross(b).Normal()
 	End Method
 	End Method