Aircraft

by wmigor

2

Aircraft plugin for Godot

This plugin adds wing physics to VehicleBody3D via the VehicleWing3D node.

Installation

Documentation

Detailed documentation can be found in the plugin scripts or Godot Editor: go to the script editor, click Search Help in the top bar and search for VehicleWing3D.

How to setup an airplane:

  • Add VehicleWing3D to VehicleBody3D: Add wing
  • Adjust the wing shape: Shape parameters1 Wing shape1 Shape parameters2 Wing shape2
  • Adjust control surfaces: Control surfaces Control surfaces
  • Similarly, add tail empennage: Control surfaces Turn off the mirror property of the rudder and rotate 90 degrees around the z-axis Control surfaces
  • Controls for each VehicleWing3D:
    • Ailerons deflect in different directions on different sides of the wing
    • Flaps deflect in same directions on different sides of the wing. They should be used for tail empennage. Controls
  • Aerodynamic settings:
    • By default, it's configured for a standard wing, except for zero_lift_angle - this should be set to about -2.5 degrees on the main wing and 0.0 on tail empennage Aerodynamics

Position the center of mass near the wing location, setup the mass corresponding to the wing size, disable damping, apply aircraft thrust, and enjoy the flight Takeoff

Demo

This demo simulates 2 aircraft using VehicleWing3D nodes.

Wings are displayed as multiple debug sections in different colors:

  • Green - normal state
  • Orange - stall warning
  • Red - stall
  • Blue - control surface

Controls:

  • Ailerons: A/D, Gamepad Horizontal Axis Of Left Stick
  • Elevator: W/S, Gamepad Vertical Axis Of Left Stick
  • Rudder: Q/E, Gamepad Left/Right Trigger
  • Flaps: Down/Up, Gamepad D-Pad Down/Up
  • Throttle: +/-, Gamepad A/B
  • Brake: Space, Gamepad X
  • Spawn next aircraft: F1, Gamepad Right Bumper

The player_aircraft_controller.gd script implements aircraft controls.

Basic parameters of aircraft:

  • Cessna-172:
    • Mass: 750 kg
    • Wing distance to mass of center: 0.05 m
    • Wing span: 11.0 m
    • Wing chord: 1.5 m
    • Wing dihedral: 1.7 degree
    • Wing twist: -3.0 degree
    • Wing zero lift angle: -2.5 degree
  • Yak-52:
    • Mass: 1000 kg
    • Wing distance to mass of center: 0.1 m
    • Wing span: 9.3 m
    • Wing chord: 2.1 m
    • Wing taper: 0.5
    • Wing sweep: -1.0 degree
    • Wing dihedral: 2.0 degree
    • Wing twist: -2.5 degree
    • Wing zero lift angle: -2.0 degree

Language: GDScript

Renderer: Forward+

Version

1.0

Engine

4.4

Category

Scripts

Download

Version1.0
Download

Support

If you need help or have questions about this plugin, please contact the author.

Contact Author