From bd7c8d76bd54c874bbfad9da900d6d2a98fd5e61 Mon Sep 17 00:00:00 2001 From: Marc Sunet Date: Wed, 29 Aug 2012 18:32:01 +0200 Subject: Fixed forward vector in rpgTransform --- Spear/Math/MatrixUtils.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spear/Math/MatrixUtils.hs b/Spear/Math/MatrixUtils.hs index 434e36a..52d4014 100644 --- a/Spear/Math/MatrixUtils.hs +++ b/Spear/Math/MatrixUtils.hs @@ -31,7 +31,7 @@ rpgTransform :: Float -- ^ The height above the ground. rpgTransform h mat = let r = let r' = M3.right mat in vec3 (V2.x r') (V2.y r') 0 u = V3.unity - f = let f' = M3.forward mat in vec3 (V2.x f') 0 (-V2.y f') + f = let f' = M3.forward mat in vec3 (V2.x f') 0 (V2.y f') t = (vec3 0 h 0) + let t' = M3.position mat in -(vec3 (V2.x t') 0 (-V2.y t')) in mat4 (V3.x r) (V3.x u) (V3.x f) (V3.x t) -- cgit v1.2.3