|
|
@@ -83,8 +83,8 @@ function FPSCamera:update(dt, dx, dy, keyboard)
|
|
|
if dx ~= 0 or dy ~= 0 then
|
|
|
if not self:is_orthographic() then
|
|
|
local rotation_speed = self._rotation_speed * dt
|
|
|
- local rotation_around_world_up = Quaternion(Vector3(0, 1, 0), -dx * rotation_speed)
|
|
|
- local rotation_around_camera_right = Quaternion(camera_right_vector, -dy * rotation_speed)
|
|
|
+ local rotation_around_world_up = Quaternion(Vector3(0, 1, 0), dx * rotation_speed)
|
|
|
+ local rotation_around_camera_right = Quaternion(camera_right_vector, dy * rotation_speed)
|
|
|
local rotation = Quaternion.multiply(rotation_around_world_up, rotation_around_camera_right)
|
|
|
|
|
|
local old_rotation = Matrix4x4.from_quaternion(camera_rotation)
|
|
|
@@ -107,8 +107,8 @@ function FPSCamera:update(dt, dx, dy, keyboard)
|
|
|
if keyboard.dkey then camera_position = camera_position + camera_right_vector * translation_speed end
|
|
|
else
|
|
|
if keyboard.wkey then camera_position = camera_position + camera_view_vector * translation_speed end
|
|
|
- if keyboard.skey then camera_position = camera_position + camera_view_vector * -translation_speed end
|
|
|
- if keyboard.akey then camera_position = camera_position + camera_right_vector * -translation_speed end
|
|
|
+ if keyboard.skey then camera_position = camera_position - camera_view_vector * translation_speed end
|
|
|
+ if keyboard.akey then camera_position = camera_position - camera_right_vector * translation_speed end
|
|
|
if keyboard.dkey then camera_position = camera_position + camera_right_vector * translation_speed end
|
|
|
end
|
|
|
SceneGraph.set_local_position(sg, self._unit, camera_position)
|