Fix orientation_to_direction, mult look_at on self

This commit is contained in:
Colby Klein 2014-10-27 09:53:57 -07:00
parent 9b8322fab6
commit e9935b18a5
2 changed files with 4 additions and 3 deletions

View File

@ -364,7 +364,8 @@ function mat4:look_at(eye, center, up)
-- Fix 1u offset
local new_eye = eye + forward
return mat4():identity():translate(-new_eye.x, -new_eye.y, -new_eye.z) * view
local out = mat4():translate(-new_eye.x, -new_eye.y, -new_eye.z) * view
return out * self
end

View File

@ -223,9 +223,9 @@ end
function vector:orientation_to_direction()
return new(0, 1, 0)
:rotated(self.x, new(1, 0, 0))
:rotated(self.y, new(0, 1, 0))
:rotated(self.z, new(0, 0, 1))
:rotated(self.y, new(0, 1, 0))
:rotated(self.x, new(1, 0, 0))
end
-- the module