Жуть какая-то на объектах. Вот версия без объектов, с параметрами крена и поля обзора.
local smParams, smTime, smTimePassed
local function updateMoveCamera ( timeSlice )
smTimePassed = smTimePassed + timeSlice
if ( smTimePassed >= smTime ) then
smTimePassed = smTime
removeEventHandler ( "onClientPreRender", root, updateMoveCamera )
end
local a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p = unpack ( smParams )
local cx, cy, cz = interpolateBetween ( a, b, c, i, j, k, smTimePassed/smTime, "InOutQuad" )
local lx, ly, lz = interpolateBetween ( d, e, f, l, m, n, smTimePassed/smTime, "InOutQuad" )
local roll, fov = interpolateBetween ( g, h, 0, o, p, 1, smTimePassed/smTime, "InOutQuad" )
setCameraMatrix ( cx, cy, cz, lx, ly, lz, roll, fov )
--outputConsole ( string.format ( "timePassed: %d, cam: %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f", smTimePassed, getCameraMatrix ( ) ) )
end
function moveCamera ( a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, time )
smParams, smTime, smTimePassed = { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p }, time, 0
setCameraMatrix ( a, b, c, d, e, f, g, h )
addEventHandler ( "onClientPreRender", root, updateMoveCamera, false )
end
function stopCamera ( )
removeEventHandler ( "onClientPreRender", root, updateMoveCamera )
end