|
@@ -67,10 +67,13 @@ func _apply_wing_resistance() -> void:
|
|
|
|
|
|
|
|
|
func _apply_foil_resistance() -> void:
|
|
|
- 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)
|
|
|
+ var horizontal_speed = linear_velocity.dot(transform.basis.x)
|
|
|
+ var local_foil_force = transform.basis.x * -foil_resistance * horizontal_speed
|
|
|
+
|
|
|
+ var foil_local_position: Vector3 = VerticalFoil.get_position()
|
|
|
+ var foil_global_offset: Vector3 = transform.basis * foil_local_position
|
|
|
+
|
|
|
+ apply_force(local_foil_force, foil_global_offset)
|
|
|
|
|
|
|
|
|
func _apply_lift() -> void:
|