Add fallback camera with mouse controls
This commit is contained in:
parent
2824f77450
commit
ad4bb45951
6 changed files with 79 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
|||
extends Node3D
|
||||
|
||||
signal use_fallback(active: bool)
|
||||
|
||||
## Rotation of cyclic stick model for full control deflection, in degrees
|
||||
@export var range_cyclic: float = 30
|
||||
## Main rotor speed, in revolutions per minute
|
||||
|
|
@ -16,6 +18,7 @@ var _rotor_azimuth: float = 0
|
|||
@onready var tracker_mount_platform: Node3D = $AttitudeRoot/PilotEyes/PilotFloor/TrackerMountPlatform
|
||||
@onready var xr_origin: XROrigin3D = $AttitudeRoot/PilotEyes/PilotFloor/XROrigin3D
|
||||
@onready var tracker: XRController3D = $AttitudeRoot/PilotEyes/PilotFloor/XROrigin3D/ViveTracker
|
||||
@onready var xr_camera: XRCamera3D = $AttitudeRoot/PilotEyes/PilotFloor/XROrigin3D/XRCamera3D
|
||||
|
||||
@onready var bone_cg: int = skeleton.find_bone("BodyCG")
|
||||
@onready var bone_cyclic: int = skeleton.find_bone("Cyclic")
|
||||
|
|
@ -53,3 +56,7 @@ func _process(delta: float) -> void:
|
|||
xr_origin.transform = tracker_mount.transform * tracker.transform.affine_inverse()
|
||||
else:
|
||||
xr_origin.transform = Transform3D.IDENTITY
|
||||
|
||||
func _on_vr_setup_failed() -> void:
|
||||
xr_camera.current = false
|
||||
use_fallback.emit(true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue