nerevelon5/lib/camera.lua
Ivan Yuriev 7aefcd4331 - added world coordinates
- added camera following some target world position
2025-04-18 22:28:21 +03:00

14 lines
340 B
Lua

Camera = {
target = Vec3 {},
position = Vec3 {},
lerp_speed = 5.0
}
function Camera:update(dt)
if not self.target then return end
-- Плавное движение камеры к цели
local to_target = self.target - self.position
self.position = self.position + to_target:scale(dt * self.lerp_speed)
end