diff options
Diffstat (limited to 'Spear/Math/MatrixUtils.hs')
-rw-r--r-- | Spear/Math/MatrixUtils.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Spear/Math/MatrixUtils.hs b/Spear/Math/MatrixUtils.hs index 7502234..44af2c0 100644 --- a/Spear/Math/MatrixUtils.hs +++ b/Spear/Math/MatrixUtils.hs | |||
@@ -32,9 +32,9 @@ rpgTransform | |||
32 | :: Float -- ^ The height above the ground | 32 | :: Float -- ^ The height above the ground |
33 | -> Float -- ^ Angle of rotation | 33 | -> Float -- ^ Angle of rotation |
34 | -> Vector3 -- ^ Axis of rotation | 34 | -> Vector3 -- ^ Axis of rotation |
35 | -> Matrix3 | 35 | -> Vector2 -- ^ Object's position. |
36 | -> Matrix4 | 36 | -> Matrix4 |
37 | rpgTransform h a axis mat = | 37 | rpgTransform h a axis pos = |
38 | {-let r = let r' = M3.right mat in vec3 (V2.x r') (V2.y r') 0 | 38 | {-let r = let r' = M3.right mat in vec3 (V2.x r') (V2.y r') 0 |
39 | u = V3.unity | 39 | u = V3.unity |
40 | f = let f' = M3.forward mat in vec3 (V2.x f') 0 (V2.y f') | 40 | f = let f' = M3.forward mat in vec3 (V2.x f') 0 (V2.y f') |
@@ -43,7 +43,7 @@ rpgTransform h a axis mat = | |||
43 | r = M4.right mat' | 43 | r = M4.right mat' |
44 | u = M4.up mat' | 44 | u = M4.up mat' |
45 | f = M4.forward mat' | 45 | f = M4.forward mat' |
46 | t = vec3 0 h 0 + let t' = M3.position mat in vec3 (V2.x t') 0 (V2.y t') | 46 | t = vec3 0 h 0 + vec3 (V2.x pos) 0 (-V2.y pos) |
47 | in mat4 | 47 | in mat4 |
48 | (V3.x r) (V3.x u) (V3.x f) (V3.x t) | 48 | (V3.x r) (V3.x u) (V3.x f) (V3.x t) |
49 | (V3.y r) (V3.y u) (V3.y f) (V3.y t) | 49 | (V3.y r) (V3.y u) (V3.y f) (V3.y t) |
@@ -76,9 +76,9 @@ rpgInverse | |||
76 | :: Float -- ^ The height above the ground | 76 | :: Float -- ^ The height above the ground |
77 | -> Float -- ^ Angle of rotation | 77 | -> Float -- ^ Angle of rotation |
78 | -> Vector3 -- ^ Axis of rotation | 78 | -> Vector3 -- ^ Axis of rotation |
79 | -> Matrix3 | 79 | -> Vector2 |
80 | -> Matrix4 | 80 | -> Matrix4 |
81 | rpgInverse h a rot = M4.inverseTransform . rpgTransform h a rot | 81 | rpgInverse h a rot pos = M4.inverseTransform $ rpgTransform h a rot pos |
82 | 82 | ||
83 | 83 | ||
84 | -- | Compute the inverse transform of the given transformation matrix. | 84 | -- | Compute the inverse transform of the given transformation matrix. |