Fixed Camera free_move, reduced camera speed.

This commit is contained in:
2019-02-22 15:04:42 -06:00
parent 6191699d8b
commit 7aa99a70a7
2 changed files with 13 additions and 13 deletions

View File

@@ -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])

View File

@@ -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