diff options
-rw-r--r-- | Spear/Math/Matrix3.hs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/Spear/Math/Matrix3.hs b/Spear/Math/Matrix3.hs index e24a3e5..06c06a2 100644 --- a/Spear/Math/Matrix3.hs +++ b/Spear/Math/Matrix3.hs | |||
@@ -131,17 +131,11 @@ forward (Matrix3 _ a10 _ _ a11 _ _ _ _) = vec2 a10 a11 | |||
131 | position (Matrix3 _ _ a20 _ _ a21 _ _ _) = vec2 a20 a21 | 131 | position (Matrix3 _ _ a20 _ _ a21 _ _ _) = vec2 a20 a21 |
132 | 132 | ||
133 | 133 | ||
134 | -- | Build a 'Matrix3' from the specified values. | 134 | -- | Build a matrix from the specified values. |
135 | mat3 :: Float -> Float -> Float -> | 135 | mat3 = Matrix3 |
136 | Float -> Float -> Float -> | ||
137 | Float -> Float -> Float -> Matrix3 | ||
138 | mat3 m00 m01 m02 m10 m11 m12 m20 m21 m22 = Matrix3 | ||
139 | m00 m10 m20 | ||
140 | m01 m11 m21 | ||
141 | m02 m12 m22 | ||
142 | 136 | ||
143 | 137 | ||
144 | -- | Build a 'Matrix3' from three vectors in 3D. | 138 | -- | Build a matrix from three vectors in 3D. |
145 | mat3fromVec :: Vector3 -> Vector3 -> Vector3 -> Matrix3 | 139 | mat3fromVec :: Vector3 -> Vector3 -> Vector3 -> Matrix3 |
146 | mat3fromVec v0 v1 v2 = Matrix3 | 140 | mat3fromVec v0 v1 v2 = Matrix3 |
147 | (V3.x v0) (V3.x v1) (V3.x v2) | 141 | (V3.x v0) (V3.x v1) (V3.x v2) |
@@ -158,7 +152,7 @@ transform :: Vector2 -- ^ Right vector | |||
158 | transform r f p = mat3 | 152 | transform r f p = mat3 |
159 | (V2.x r) (V2.x f) (V2.x p) | 153 | (V2.x r) (V2.x f) (V2.x p) |
160 | (V2.y r) (V2.y f) (V2.y p) | 154 | (V2.y r) (V2.y f) (V2.y p) |
161 | 0 0 1 | 155 | 0 0 1 |
162 | 156 | ||
163 | 157 | ||
164 | -- | Return the identity matrix. | 158 | -- | Return the identity matrix. |