Toggle edit mode
This commit is contained in:
@@ -2,6 +2,10 @@
|
|||||||
name = "quit"
|
name = "quit"
|
||||||
scan_code = 1
|
scan_code = 1
|
||||||
|
|
||||||
|
[[button]]
|
||||||
|
name = "toggle_edit"
|
||||||
|
scan_code = 59
|
||||||
|
|
||||||
[[button]]
|
[[button]]
|
||||||
name = "reload_shaders"
|
name = "reload_shaders"
|
||||||
scan_code = 19
|
scan_code = 19
|
||||||
|
|||||||
@@ -83,6 +83,14 @@ impl Updatable for Player {
|
|||||||
self.camera.rotation = self.camera.rotation * Quaternion::from_angle_y(Deg(input.get_axis("look_horizontal") * delta_time * self.look_sensitivity));
|
self.camera.rotation = self.camera.rotation * Quaternion::from_angle_y(Deg(input.get_axis("look_horizontal") * delta_time * self.look_sensitivity));
|
||||||
self.camera.rotation = Quaternion::from_angle_x(Deg(input.get_axis("look_vertical") * delta_time * self.look_sensitivity)) * self.camera.rotation;
|
self.camera.rotation = Quaternion::from_angle_x(Deg(input.get_axis("look_vertical") * delta_time * self.look_sensitivity)) * self.camera.rotation;
|
||||||
|
|
||||||
|
if input.button_just_pressed("toggle_edit") {
|
||||||
|
if self.movement_mode == FirstPerson {
|
||||||
|
self.movement_mode = Flying;
|
||||||
|
} else {
|
||||||
|
self.movement_mode = FirstPerson;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Movement
|
// Movement
|
||||||
if self.movement_mode == FirstPerson {
|
if self.movement_mode == FirstPerson {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user