Fix orientation_to_direction, mult look_at on self
This commit is contained in:
parent
9b8322fab6
commit
e9935b18a5
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user