diff options
author | sanine-a <sanine.not@pm.me> | 2020-11-07 13:14:30 -0600 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2020-11-07 13:14:30 -0600 |
commit | 94572182ea873d5dadbc8428330d4c00eead2c80 (patch) | |
tree | b9152a7d474c236c29d42e133300b8513690bfef /demo/FPSCamera.lua | |
parent | 8bb877ad57e7e41d928408e81f4e8cca63e171f7 (diff) |
add basic Node transform functions and implement transform cascading
Diffstat (limited to 'demo/FPSCamera.lua')
-rw-r--r-- | demo/FPSCamera.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/demo/FPSCamera.lua b/demo/FPSCamera.lua index 033f19b..5a9fabf 100644 --- a/demo/FPSCamera.lua +++ b/demo/FPSCamera.lua @@ -40,7 +40,7 @@ function camera:update(dt) movement:sub(Vector.Vec3.Y_UNIT, movement) end movement:muls(self.movement_speed*dt, movement) - self.position:add(movement, self.position) + self:translate(movement) self:updateTransform() self:updateView() @@ -60,8 +60,8 @@ honey.input.mouse.bind_movement( camera.pitch = camera.pitch + camera.sensitivity * dy camera.yaw = camera.yaw - camera.sensitivity * dx - if camera.pitch > 89 then camera.pitch = 89 end - if camera.pitch < -89 then camera.pitch = -89 end + if camera.pitch > 89.9 then camera.pitch = 89.9 end + if camera.pitch < -89.9 then camera.pitch = -89.9 end camera.rotation:setAt(0, math.rad(camera.pitch)) camera.rotation:setAt(1, math.rad(camera.yaw)) |