aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Sunet <jeannekamikaze@gmail.com>2012-08-29 20:12:21 +0200
committerMarc Sunet <jeannekamikaze@gmail.com>2012-08-29 20:12:21 +0200
commit1cf92f71205a58b1c695410eae061055e128fe1e (patch)
treed876a1279bae4b18a250d1b47fbc4ece45a062ac
parentec66c8cfbc5cf3dd7b521694d0b8c617088161aa (diff)
Fixed mat3 constructor
-rw-r--r--Spear/Math/Matrix3.hs14
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
131position (Matrix3 _ _ a20 _ _ a21 _ _ _) = vec2 a20 a21 131position (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.
135mat3 :: Float -> Float -> Float -> 135mat3 = Matrix3
136 Float -> Float -> Float ->
137 Float -> Float -> Float -> Matrix3
138mat3 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.
145mat3fromVec :: Vector3 -> Vector3 -> Vector3 -> Matrix3 139mat3fromVec :: Vector3 -> Vector3 -> Vector3 -> Matrix3
146mat3fromVec v0 v1 v2 = Matrix3 140mat3fromVec 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
158transform r f p = mat3 152transform 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.