diff --git a/src/Audio/AudioEmitter.cs b/src/Audio/AudioEmitter.cs
index c23becd..9dd3898 100644
--- a/src/Audio/AudioEmitter.cs
+++ b/src/Audio/AudioEmitter.cs
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Audio
{
diff --git a/src/Audio/AudioListener.cs b/src/Audio/AudioListener.cs
index 0f9e515..1309c16 100644
--- a/src/Audio/AudioListener.cs
+++ b/src/Audio/AudioListener.cs
@@ -1,5 +1,5 @@
using System;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Audio
{
diff --git a/src/Audio/SoundInstance.cs b/src/Audio/SoundInstance.cs
index 7a77fdf..03a09ec 100644
--- a/src/Audio/SoundInstance.cs
+++ b/src/Audio/SoundInstance.cs
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Audio
{
@@ -53,7 +53,7 @@ namespace MoonWorks.Audio
get => _pitch;
set
{
- _pitch = MathHelper.Clamp(value, -1f, 1f);
+ _pitch = Math.MathHelper.Clamp(value, -1f, 1f);
UpdatePitch();
}
}
diff --git a/src/Collision/Float/AABB2D.cs b/src/Collision/Float/AABB2D.cs
index 0bde1df..f7684bd 100644
--- a/src/Collision/Float/AABB2D.cs
+++ b/src/Collision/Float/AABB2D.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Collision.Float
{
diff --git a/src/Collision/Float/ICollidable.cs b/src/Collision/Float/ICollidable.cs
index 7356a71..52355aa 100644
--- a/src/Collision/Float/ICollidable.cs
+++ b/src/Collision/Float/ICollidable.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Collision.Float
{
diff --git a/src/Collision/Float/IShape2D.cs b/src/Collision/Float/IShape2D.cs
index 0db2c18..cb8ee80 100644
--- a/src/Collision/Float/IShape2D.cs
+++ b/src/Collision/Float/IShape2D.cs
@@ -1,4 +1,4 @@
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Collision.Float
{
diff --git a/src/Collision/Float/MinkowskiDifference.cs b/src/Collision/Float/MinkowskiDifference.cs
index bec8916..81c494d 100644
--- a/src/Collision/Float/MinkowskiDifference.cs
+++ b/src/Collision/Float/MinkowskiDifference.cs
@@ -1,4 +1,4 @@
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Collision.Float
{
diff --git a/src/Collision/Float/NarrowPhase.cs b/src/Collision/Float/NarrowPhase.cs
index 2f76b9a..690a7d2 100644
--- a/src/Collision/Float/NarrowPhase.cs
+++ b/src/Collision/Float/NarrowPhase.cs
@@ -1,4 +1,4 @@
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Collision.Float
{
diff --git a/src/Collision/Float/Shapes/Circle.cs b/src/Collision/Float/Shapes/Circle.cs
index 9a4ab02..d5cdff7 100644
--- a/src/Collision/Float/Shapes/Circle.cs
+++ b/src/Collision/Float/Shapes/Circle.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Collision.Float
{
diff --git a/src/Collision/Float/Shapes/Line.cs b/src/Collision/Float/Shapes/Line.cs
index 01007f4..00355b4 100644
--- a/src/Collision/Float/Shapes/Line.cs
+++ b/src/Collision/Float/Shapes/Line.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Collision.Float
{
diff --git a/src/Collision/Float/Shapes/Point.cs b/src/Collision/Float/Shapes/Point.cs
index b074acd..5b9ec61 100644
--- a/src/Collision/Float/Shapes/Point.cs
+++ b/src/Collision/Float/Shapes/Point.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Collision.Float
{
diff --git a/src/Collision/Float/Shapes/Rectangle.cs b/src/Collision/Float/Shapes/Rectangle.cs
index b0958f2..073fff9 100644
--- a/src/Collision/Float/Shapes/Rectangle.cs
+++ b/src/Collision/Float/Shapes/Rectangle.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Collision.Float
{
diff --git a/src/Collision/Float/Simplex2D.cs b/src/Collision/Float/Simplex2D.cs
index ba2f27f..4aadf4b 100644
--- a/src/Collision/Float/Simplex2D.cs
+++ b/src/Collision/Float/Simplex2D.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Collision.Float
{
diff --git a/src/Collision/Float/SpatialHash2D.cs b/src/Collision/Float/SpatialHash2D.cs
index 0f08eb8..b015231 100644
--- a/src/Collision/Float/SpatialHash2D.cs
+++ b/src/Collision/Float/SpatialHash2D.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Collision.Float
{
diff --git a/src/Graphics/Color.cs b/src/Graphics/Color.cs
index 413c8b2..b01ff26 100644
--- a/src/Graphics/Color.cs
+++ b/src/Graphics/Color.cs
@@ -19,6 +19,7 @@ using System;
using System.Diagnostics;
using System.Text;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/Font/Structs.cs b/src/Graphics/Font/Structs.cs
index 83e7fc7..8231039 100644
--- a/src/Graphics/Font/Structs.cs
+++ b/src/Graphics/Font/Structs.cs
@@ -1,5 +1,5 @@
using System.Runtime.InteropServices;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Graphics.Font
{
diff --git a/src/Graphics/PackedVector/Alpha8.cs b/src/Graphics/PackedVector/Alpha8.cs
index a6eb8c4..6697b04 100644
--- a/src/Graphics/PackedVector/Alpha8.cs
+++ b/src/Graphics/PackedVector/Alpha8.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/Bgr565.cs b/src/Graphics/PackedVector/Bgr565.cs
index cc932c8..7ec0088 100644
--- a/src/Graphics/PackedVector/Bgr565.cs
+++ b/src/Graphics/PackedVector/Bgr565.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/Bgra4444.cs b/src/Graphics/PackedVector/Bgra4444.cs
index 5726e72..53e3cd2 100644
--- a/src/Graphics/PackedVector/Bgra4444.cs
+++ b/src/Graphics/PackedVector/Bgra4444.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/Bgra5551.cs b/src/Graphics/PackedVector/Bgra5551.cs
index 6ac652a..4e32596 100644
--- a/src/Graphics/PackedVector/Bgra5551.cs
+++ b/src/Graphics/PackedVector/Bgra5551.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/Byte4.cs b/src/Graphics/PackedVector/Byte4.cs
index f98e496..c64ae26 100644
--- a/src/Graphics/PackedVector/Byte4.cs
+++ b/src/Graphics/PackedVector/Byte4.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/HalfSingle.cs b/src/Graphics/PackedVector/HalfSingle.cs
index 7bf4d57..de17ea1 100644
--- a/src/Graphics/PackedVector/HalfSingle.cs
+++ b/src/Graphics/PackedVector/HalfSingle.cs
@@ -16,7 +16,7 @@
#region Using Statements
using System;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/HalfVector2.cs b/src/Graphics/PackedVector/HalfVector2.cs
index e8ed521..bd0d9cf 100644
--- a/src/Graphics/PackedVector/HalfVector2.cs
+++ b/src/Graphics/PackedVector/HalfVector2.cs
@@ -16,7 +16,7 @@
#region Using Statements
using System;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/HalfVector4.cs b/src/Graphics/PackedVector/HalfVector4.cs
index d93f29e..cffa1f4 100644
--- a/src/Graphics/PackedVector/HalfVector4.cs
+++ b/src/Graphics/PackedVector/HalfVector4.cs
@@ -16,7 +16,7 @@
#region Using Statements
using System;
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/IPackedVector.cs b/src/Graphics/PackedVector/IPackedVector.cs
index 6c0df0e..f5b5c79 100644
--- a/src/Graphics/PackedVector/IPackedVector.cs
+++ b/src/Graphics/PackedVector/IPackedVector.cs
@@ -14,7 +14,7 @@
#endregion
-using MoonWorks.Math;
+using MoonWorks.Math.Float;
namespace MoonWorks.Graphics
{
diff --git a/src/Graphics/PackedVector/NormalizedByte2.cs b/src/Graphics/PackedVector/NormalizedByte2.cs
index 26c25bd..33c1a0a 100644
--- a/src/Graphics/PackedVector/NormalizedByte2.cs
+++ b/src/Graphics/PackedVector/NormalizedByte2.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/NormalizedByte4.cs b/src/Graphics/PackedVector/NormalizedByte4.cs
index b3bf6c2..4623bdd 100644
--- a/src/Graphics/PackedVector/NormalizedByte4.cs
+++ b/src/Graphics/PackedVector/NormalizedByte4.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/NormalizedShort2.cs b/src/Graphics/PackedVector/NormalizedShort2.cs
index 0b09439..9f920bd 100644
--- a/src/Graphics/PackedVector/NormalizedShort2.cs
+++ b/src/Graphics/PackedVector/NormalizedShort2.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/NormalizedShort4.cs b/src/Graphics/PackedVector/NormalizedShort4.cs
index 4d3c6c5..f70c0f2 100644
--- a/src/Graphics/PackedVector/NormalizedShort4.cs
+++ b/src/Graphics/PackedVector/NormalizedShort4.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/Rg32.cs b/src/Graphics/PackedVector/Rg32.cs
index fd95b03..78cea4e 100644
--- a/src/Graphics/PackedVector/Rg32.cs
+++ b/src/Graphics/PackedVector/Rg32.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/Rgba1010102.cs b/src/Graphics/PackedVector/Rgba1010102.cs
index 78909d2..c1581a4 100644
--- a/src/Graphics/PackedVector/Rgba1010102.cs
+++ b/src/Graphics/PackedVector/Rgba1010102.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/Rgba64.cs b/src/Graphics/PackedVector/Rgba64.cs
index a3701ad..a8f2e8b 100644
--- a/src/Graphics/PackedVector/Rgba64.cs
+++ b/src/Graphics/PackedVector/Rgba64.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/Short2.cs b/src/Graphics/PackedVector/Short2.cs
index 02a9069..de357b0 100644
--- a/src/Graphics/PackedVector/Short2.cs
+++ b/src/Graphics/PackedVector/Short2.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/PackedVector/Short4.cs b/src/Graphics/PackedVector/Short4.cs
index c04c081..4757d46 100644
--- a/src/Graphics/PackedVector/Short4.cs
+++ b/src/Graphics/PackedVector/Short4.cs
@@ -17,6 +17,7 @@
#region Using Statements
using System;
using MoonWorks.Math;
+using MoonWorks.Math.Float;
#endregion
namespace MoonWorks.Graphics
diff --git a/src/Graphics/Utility/Conversions.cs b/src/Graphics/Utility/Conversions.cs
index 141d1c9..6dd0dd9 100644
--- a/src/Graphics/Utility/Conversions.cs
+++ b/src/Graphics/Utility/Conversions.cs
@@ -22,15 +22,15 @@
{
return Graphics.VertexElementFormat.Float;
}
- else if (type == typeof(Math.Vector2))
+ else if (type == typeof(Math.Float.Vector2))
{
return Graphics.VertexElementFormat.Vector2;
}
- else if (type == typeof(Math.Vector3))
+ else if (type == typeof(Math.Float.Vector3))
{
return Graphics.VertexElementFormat.Vector3;
}
- else if (type == typeof(Math.Vector4))
+ else if (type == typeof(Math.Float.Vector4))
{
return Graphics.VertexElementFormat.Vector4;
}
diff --git a/src/Math/Fixed/Matrix3x2.cs b/src/Math/Fixed/Matrix3x2.cs
index 0187ec5..4e17756 100644
--- a/src/Math/Fixed/Matrix3x2.cs
+++ b/src/Math/Fixed/Matrix3x2.cs
@@ -782,9 +782,9 @@ namespace MoonWorks.Math.Fixed
///
/// Casts to floating point Matrix3x2.
///
- public static explicit operator Math.Matrix3x2(Matrix3x2 matrix)
+ public static explicit operator Math.Float.Matrix3x2(Matrix3x2 matrix)
{
- return new Math.Matrix3x2(
+ return new Math.Float.Matrix3x2(
(float) matrix.M11, (float) matrix.M12,
(float) matrix.M21, (float) matrix.M22,
(float) matrix.M31, (float) matrix.M32
diff --git a/src/Math/BoundingBox.cs b/src/Math/Float/BoundingBox.cs
similarity index 99%
rename from src/Math/BoundingBox.cs
rename to src/Math/Float/BoundingBox.cs
index 13e7c17..7e45b86 100644
--- a/src/Math/BoundingBox.cs
+++ b/src/Math/Float/BoundingBox.cs
@@ -21,7 +21,7 @@ using System.Diagnostics;
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
[Serializable]
[DebuggerDisplay("{DebugDisplayString,nq}")]
diff --git a/src/Math/BoundingFrustum.cs b/src/Math/Float/BoundingFrustum.cs
similarity index 99%
rename from src/Math/BoundingFrustum.cs
rename to src/Math/Float/BoundingFrustum.cs
index 133a3eb..801e36c 100644
--- a/src/Math/BoundingFrustum.cs
+++ b/src/Math/Float/BoundingFrustum.cs
@@ -20,7 +20,7 @@ using System.Diagnostics;
using System.Text;
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
///
/// Defines a viewing frustum for intersection operations.
diff --git a/src/Math/BoundingSphere.cs b/src/Math/Float/BoundingSphere.cs
similarity index 99%
rename from src/Math/BoundingSphere.cs
rename to src/Math/Float/BoundingSphere.cs
index 1b646d3..7e7b055 100644
--- a/src/Math/BoundingSphere.cs
+++ b/src/Math/Float/BoundingSphere.cs
@@ -21,7 +21,7 @@ using System.Diagnostics;
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
///
/// Describes a sphere in 3D-space for bounding operations.
diff --git a/src/Math/ContainmentType.cs b/src/Math/Float/ContainmentType.cs
similarity index 96%
rename from src/Math/ContainmentType.cs
rename to src/Math/Float/ContainmentType.cs
index 6a9b889..b08609b 100644
--- a/src/Math/ContainmentType.cs
+++ b/src/Math/Float/ContainmentType.cs
@@ -14,7 +14,7 @@
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
///
/// Defines how the bounding volumes intersects or contain one another.
diff --git a/src/Math/Matrix3x2.cs b/src/Math/Float/Matrix3x2.cs
similarity index 99%
rename from src/Math/Matrix3x2.cs
rename to src/Math/Float/Matrix3x2.cs
index a634427..a218a56 100644
--- a/src/Math/Matrix3x2.cs
+++ b/src/Math/Float/Matrix3x2.cs
@@ -10,7 +10,7 @@
using System;
using System.Globalization;
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
///
/// A structure encapsulating a 3x2 matrix.
diff --git a/src/Math/Matrix4x4.cs b/src/Math/Float/Matrix4x4.cs
similarity index 99%
rename from src/Math/Matrix4x4.cs
rename to src/Math/Float/Matrix4x4.cs
index b236520..4ec27ec 100644
--- a/src/Math/Matrix4x4.cs
+++ b/src/Math/Float/Matrix4x4.cs
@@ -21,7 +21,7 @@ using System.Runtime.InteropServices;
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
///
/// Represents the right-handed 4x4 floating point matrix, which can store translation, scale and rotation information.
diff --git a/src/Math/Plane.cs b/src/Math/Float/Plane.cs
similarity index 99%
rename from src/Math/Plane.cs
rename to src/Math/Float/Plane.cs
index 5d2a40e..8fc24f3 100644
--- a/src/Math/Plane.cs
+++ b/src/Math/Float/Plane.cs
@@ -20,7 +20,7 @@ using System.Diagnostics;
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
[Serializable]
[DebuggerDisplay("{DebugDisplayString,nq}")]
diff --git a/src/Math/PlaneIntersectionType.cs b/src/Math/Float/PlaneIntersectionType.cs
similarity index 96%
rename from src/Math/PlaneIntersectionType.cs
rename to src/Math/Float/PlaneIntersectionType.cs
index 9cd68ea..ddfcdbc 100644
--- a/src/Math/PlaneIntersectionType.cs
+++ b/src/Math/Float/PlaneIntersectionType.cs
@@ -14,7 +14,7 @@
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
///
/// Defines the intersection between a and a bounding volume.
diff --git a/src/Math/Point.cs b/src/Math/Float/Point.cs
similarity index 99%
rename from src/Math/Point.cs
rename to src/Math/Float/Point.cs
index e9f8aa2..a69e21b 100644
--- a/src/Math/Point.cs
+++ b/src/Math/Float/Point.cs
@@ -20,7 +20,7 @@ using System.Diagnostics;
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
///
/// Describes a 2D-point.
diff --git a/src/Math/Quaternion.cs b/src/Math/Float/Quaternion.cs
similarity index 99%
rename from src/Math/Quaternion.cs
rename to src/Math/Float/Quaternion.cs
index db7597c..c5dc58b 100644
--- a/src/Math/Quaternion.cs
+++ b/src/Math/Float/Quaternion.cs
@@ -20,7 +20,7 @@ using System.Diagnostics;
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
///
/// An efficient mathematical representation for three dimensional rotations.
diff --git a/src/Math/Ray.cs b/src/Math/Float/Ray.cs
similarity index 99%
rename from src/Math/Ray.cs
rename to src/Math/Float/Ray.cs
index 98f46a0..f367d12 100644
--- a/src/Math/Ray.cs
+++ b/src/Math/Float/Ray.cs
@@ -20,7 +20,7 @@ using System.Diagnostics;
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
[Serializable]
[DebuggerDisplay("{DebugDisplayString,nq}")]
diff --git a/src/Math/Rectangle.cs b/src/Math/Float/Rectangle.cs
similarity index 99%
rename from src/Math/Rectangle.cs
rename to src/Math/Float/Rectangle.cs
index 6bf9c39..955c52c 100644
--- a/src/Math/Rectangle.cs
+++ b/src/Math/Float/Rectangle.cs
@@ -20,7 +20,7 @@ using System.Diagnostics;
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
///
/// Describes a 2D-rectangle.
diff --git a/src/Math/Transform2D.cs b/src/Math/Float/Transform2D.cs
similarity index 82%
rename from src/Math/Transform2D.cs
rename to src/Math/Float/Transform2D.cs
index c9fcb58..cdd73b4 100644
--- a/src/Math/Transform2D.cs
+++ b/src/Math/Float/Transform2D.cs
@@ -1,4 +1,4 @@
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
public struct Transform2D : System.IEquatable
{
@@ -6,7 +6,21 @@ namespace MoonWorks.Math
public float Rotation { get; }
public Vector2 Scale { get; }
- public Matrix3x2 TransformMatrix { get; }
+ private bool transformMatrixCalculated = false;
+ private Matrix3x2 transformMatrix = Matrix3x2.Identity;
+ public Matrix3x2 TransformMatrix
+ {
+ get
+ {
+ if (!transformMatrixCalculated)
+ {
+ transformMatrix = CreateTransformMatrix(Position, Rotation, Scale);
+ transformMatrixCalculated = true;
+ }
+
+ return transformMatrix;
+ }
+ }
public bool IsAxisAligned => Rotation % MathHelper.PiOver2 == 0;
public bool IsUniformScale => Scale.X == Scale.Y;
@@ -16,7 +30,6 @@ namespace MoonWorks.Math
Position = Vector2.Zero;
Rotation = 0;
Scale = Vector2.One;
- TransformMatrix = CreateTransformMatrix(Position, Rotation, Scale);
}
public Transform2D(Vector2 position)
@@ -24,7 +37,6 @@ namespace MoonWorks.Math
Position = position;
Rotation = 0;
Scale = Vector2.One;
- TransformMatrix = CreateTransformMatrix(Position, Rotation, Scale);
}
public Transform2D(Vector2 position, float rotation)
@@ -32,7 +44,6 @@ namespace MoonWorks.Math
Position = position;
Rotation = rotation;
Scale = Vector2.One;
- TransformMatrix = CreateTransformMatrix(Position, Rotation, Scale);
}
public Transform2D(Vector2 position, float rotation, Vector2 scale)
@@ -40,7 +51,6 @@ namespace MoonWorks.Math
Position = position;
Rotation = rotation;
Scale = scale;
- TransformMatrix = CreateTransformMatrix(Position, Rotation, Scale);
}
public Transform2D Compose(Transform2D other)
diff --git a/src/Math/Vector2.cs b/src/Math/Float/Vector2.cs
similarity index 99%
rename from src/Math/Vector2.cs
rename to src/Math/Float/Vector2.cs
index b247ae0..e9cffb7 100644
--- a/src/Math/Vector2.cs
+++ b/src/Math/Float/Vector2.cs
@@ -21,7 +21,7 @@ using System.Runtime.InteropServices;
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
///
/// Describes a 2D-vector.
diff --git a/src/Math/Vector3.cs b/src/Math/Float/Vector3.cs
similarity index 99%
rename from src/Math/Vector3.cs
rename to src/Math/Float/Vector3.cs
index 7657da6..b2055ca 100644
--- a/src/Math/Vector3.cs
+++ b/src/Math/Float/Vector3.cs
@@ -22,7 +22,7 @@ using System.Text;
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
///
/// Describes a 3D-vector.
diff --git a/src/Math/Vector4.cs b/src/Math/Float/Vector4.cs
similarity index 99%
rename from src/Math/Vector4.cs
rename to src/Math/Float/Vector4.cs
index 7a7c34d..263ecac 100644
--- a/src/Math/Vector4.cs
+++ b/src/Math/Float/Vector4.cs
@@ -21,7 +21,7 @@ using System.Runtime.InteropServices;
#endregion
-namespace MoonWorks.Math
+namespace MoonWorks.Math.Float
{
///
/// Describes a 4D-vector.