Recreate lidia controls with Node2D
This commit is contained in:
parent
f3d38c7569
commit
821072eae5
23 changed files with 433 additions and 35 deletions
|
|
@ -25,6 +25,8 @@ var _rotor_azimuth: float = 0
|
|||
@onready var bone_cyclic: int = skeleton.find_bone("Cyclic")
|
||||
@onready var bone_rotor: int = skeleton.find_bone("Rotor")
|
||||
|
||||
@onready var instruments: Node = $AttitudeRoot/Instruments
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
var target: Transform3D = connector.get_aircraft()
|
||||
position = target.origin
|
||||
|
|
@ -43,6 +45,10 @@ func _process(delta: float) -> void:
|
|||
var cyc_angles_rad: Vector2 = cyclic * deg_to_rad(range_cyclic)
|
||||
var cyc_att := Quaternion.from_euler(Vector3(cyc_angles_rad.y, cyc_angles_rad.x, 0))
|
||||
skeleton.set_bone_pose_rotation(bone_cyclic, cyc_att * cyc_rest)
|
||||
|
||||
# Update the instruments
|
||||
instruments.call("set_controls", connector.get_controls())
|
||||
instruments.call("set_trim", connector.get_trim())
|
||||
|
||||
# Spin the rotor only when receiving flight data
|
||||
if connector.get_model_connected():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue