From 7aa99a70a7b8dd834196d08d06316be079e131b7 Mon Sep 17 00:00:00 2001 From: Cyberarm Date: Fri, 22 Feb 2019 15:04:42 -0600 Subject: [PATCH] Fixed Camera free_move, reduced camera speed. --- lib/managers/input_mapper.rb | 2 +- lib/objects/camera.rb | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/managers/input_mapper.rb b/lib/managers/input_mapper.rb index 80a8edb..10420bc 100644 --- a/lib/managers/input_mapper.rb +++ b/lib/managers/input_mapper.rb @@ -110,7 +110,7 @@ IMICFPS::InputMapper.set(:sprint, [Gosu::KbLeftControl]) IMICFPS::InputMapper.set(:turn_180, Gosu::KbX) IMICFPS::InputMapper.set(:ascend, Gosu::KbSpace) -IMICFPS::InputMapper.set(:descend, [Gosu::KbLeftControl, Gosu::KbRightControl]) +IMICFPS::InputMapper.set(:descend, Gosu::KbC) IMICFPS::InputMapper.set(:toggle_first_person_view, Gosu::KbF) IMICFPS::InputMapper.set(:release_mouse, [Gosu::KbLeftAlt, Gosu::KbRightAlt]) diff --git a/lib/objects/camera.rb b/lib/objects/camera.rb index 523fce9..c377076 100644 --- a/lib/objects/camera.rb +++ b/lib/objects/camera.rb @@ -110,33 +110,33 @@ class IMICFPS def free_move relative_y_rotation = (@yaw + 180) - relative_speed = 0.5 + relative_speed = 0.25 if InputMapper.down?( :forward) - @z+=Math.cos(relative_y_rotation * Math::PI / 180)*relative_speed - @x-=Math.sin(relative_y_rotation * Math::PI / 180)*relative_speed + @position.z+=Math.cos(relative_y_rotation * Math::PI / 180)*relative_speed + @position.x-=Math.sin(relative_y_rotation * Math::PI / 180)*relative_speed end - if InputMapper.down?(backward) - @z-=Math.cos(relative_y_rotation * Math::PI / 180)*relative_speed - @x+=Math.sin(relative_y_rotation * Math::PI / 180)*relative_speed + if InputMapper.down?(:backward) + @position.z-=Math.cos(relative_y_rotation * Math::PI / 180)*relative_speed + @position.x+=Math.sin(relative_y_rotation * Math::PI / 180)*relative_speed end if InputMapper.down?(:strife_left) - @z+=Math.sin(relative_y_rotation * Math::PI / 180)*relative_speed - @x+=Math.cos(relative_y_rotation * Math::PI / 180)*relative_speed + @position.z+=Math.sin(relative_y_rotation * Math::PI / 180)*relative_speed + @position.x+=Math.cos(relative_y_rotation * Math::PI / 180)*relative_speed end if InputMapper.down?(:strife_right) - @z-=Math.sin(relative_y_rotation * Math::PI / 180)*relative_speed - @x-=Math.cos(relative_y_rotation * Math::PI / 180)*relative_speed + @position.z-=Math.sin(relative_y_rotation * Math::PI / 180)*relative_speed + @position.x-=Math.cos(relative_y_rotation * Math::PI / 180)*relative_speed end if InputMapper.down?(:ascend) - @y+=relative_speed + @position.y+=relative_speed end if InputMapper.down?(:descend) - @y-=relative_speed + @position.y-=relative_speed end end