bugged-racing/player/cameras/static_camera.gd

21 lines
566 B
GDScript
Raw Normal View History

2022-01-24 19:04:29 +00:00
extends Camera
func reset() -> void:
rotation = Vector3.ZERO
rotate(Vector3.UP, deg2rad(180))
2022-01-24 19:55:21 +00:00
fov = GlobalSettings.camera_fov
translation = Vector3.ZERO
translate(
Vector3(
GlobalSettings.camera_move_right - GlobalSettings.camera_move_left,
GlobalSettings.camera_move_up - GlobalSettings.camera_move_down,
GlobalSettings.camera_move_backward - GlobalSettings.camera_move_forward
)
)
2022-01-24 19:04:29 +00:00
func update_rotation(horizontal: float, vertical: float) -> void:
rotate(Vector3.DOWN, horizontal * deg2rad(90))
rotate(Vector3.LEFT, vertical * deg2rad(90))