remove unused a parameter from mat4.look_at

This commit is contained in:
Colby Klein 2022-04-21 11:22:55 -07:00
parent 13cd41770f
commit 9f57a1a939
2 changed files with 2 additions and 4 deletions

View File

@ -524,12 +524,11 @@ end
--- Transform matrix to look at a point.
-- @tparam mat4 out Matrix to store result
-- @tparam mat4 a Matrix to transform
-- @tparam vec3 eye Location of viewer's view plane
-- @tparam vec3 center Location of object to view
-- @tparam vec3 up Up direction
-- @treturn mat4 out
function mat4.look_at(out, a, eye, look_at, up)
function mat4.look_at(out, eye, look_at, up)
local z_axis = (eye - look_at):normalize()
local x_axis = up:cross(z_axis):normalize()
local y_axis = z_axis:cross(x_axis)
@ -549,7 +548,6 @@ function mat4.look_at(out, a, eye, look_at, up)
out[14] = -out[ 2]*eye.x - out[4+2]*eye.y - out[8+2]*eye.z
out[15] = -out[ 3]*eye.x - out[4+3]*eye.y - out[8+3]*eye.z
out[16] = -out[ 4]*eye.x - out[4+4]*eye.y - out[8+4]*eye.z + 1
return out
end

View File

@ -326,7 +326,7 @@ describe("mat4:", function()
local e = vec3(0, 0, 1.55)
local c = vec3(4, 7, 1)
local u = vec3(0, 0, 1)
local a = mat4():look_at(mat4(), e, c, u)
local a = mat4():look_at(e, c, u)
assert.is_true(utils.tolerance( 0.868-a[1], 0.001))
assert.is_true(utils.tolerance( 0.034-a[2], 0.001))