|
@@ -15,7 +15,7 @@ var target_pitch: float = 0.0
|
|
|
var target_rotation := Vector3.ZERO
|
|
|
var target_thrust := Vector3.ZERO
|
|
|
|
|
|
-@onready var HorizontalFoil : Node3D = $HorizontalFoil
|
|
|
+@onready var VerticalFoil : Node3D = $VerticalFoil
|
|
|
|
|
|
|
|
|
func trigger_thrust(activate: bool) -> void:
|
|
@@ -46,6 +46,7 @@ func _physics_process(_delta) -> void:
|
|
|
_apply_wing_resistance()
|
|
|
_apply_foil_resistance()
|
|
|
_apply_lift()
|
|
|
+ transform = transform.orthonormalized()
|
|
|
|
|
|
|
|
|
func _apply_plane_rotation() -> void:
|
|
@@ -66,7 +67,7 @@ func _apply_wing_resistance() -> void:
|
|
|
|
|
|
|
|
|
func _apply_foil_resistance() -> void:
|
|
|
- var foil_position : Vector3 = HorizontalFoil.get_position()
|
|
|
+ var foil_position : Vector3 = VerticalFoil.get_position()
|
|
|
var horizontal_speed = linear_velocity.dot(transform.basis * Vector3.RIGHT)
|
|
|
var local_foil_force = Vector3.RIGHT * -foil_resistance * horizontal_speed
|
|
|
apply_force(local_foil_force, foil_position)
|