aeronautic

Choosing the parts

Drive every part with ControlSurfaces, or pick them one by one inside an Airframe.

<ControlSurfaces> is two components in one: an <Airframe>, which finds the model's parts and moves them, and <FighterControls>, which drives every kind of part the way a fighter's are driven. Take them apart to choose.

One by one

An <Airframe> alone moves nothing. Put inside it the parts that should move:

import {
  Airframe,
  Cockpit,
  Elevons,
  Engine,
  Gear,
  Rudders,
} from "@aeronautic/controls/react";

<Airframe object={gltf.scene} animations={gltf.animations}>
  <Elevons />
  <Rudders />
  <Gear />
  <Cockpit />
  <Engine side="left" />
  <Engine side="right" />
</Airframe>;

A part left out rests where the model put it. A part that mounts or unmounts takes its drive with it, so {armed && <Airbrakes />} works.

The parts

componentkindsfrom the flight
<Ailerons>aileronroll
<Elevators>elevatorpitch
<Elevons>elevonpitch and roll, 60 % pitch by default
<Stabilators>stabilatorpitch and roll, 60 % pitch by default
<Canards>canardpitch
<Rudders>rudderyaw
<Flaps>flapflaps
<LeadingEdgeFlaps>le_flapangleOfAttackRad, and flaps
<Airbrakes>airbrakeairbrake
<Spoilers>spoilerairbrake
<DragRudders>drag_rudderairbrake, and yaw on one side
<Gear>gear, gear_door, gear_lever, the clipgear
<Cockpit>stick_pitch, stick_roll, pedal, throttle_leverpitch, roll, yaw, throttle
<Engine>nozzle_pitch, nozzle_yaw, nozzle_petal, the nozzle clippitch, yaw, throttle

Narrowing a part

Every part takes the same selection, to drive fewer parts than its whole kind:

propmeaning
sideonly the parts on left, right or centre
partsonly these, by node name: ["CTRL_Elevon_Outer_L"]
grouponly the parts of this rig group
filteronly the parts this function keeps

Given parts or group, a part component takes them whatever their kind: <Ailerons parts={["CTRL_Elevon_Outer_L", "CTRL_Elevon_Outer_R"]} /> drives the outer elevons as ailerons.

When two claim one part

When several drives claim a part, the most specific wins: one naming the part, over one naming its group, over one naming its kind. A side makes any of them a little more specific, and of two as specific, the later one wins. So you can drive everything with <FighterControls>, then take one part over:

<ControlSurfaces object={gltf.scene}>
  {/* The outer elevons roll only */}
  <Elevons
    parts={["CTRL_Elevon_Outer_L", "CTRL_Elevon_Outer_R"]}
    pitchShare={0}
  />
</ControlSurfaces>

When a drive goes away, its parts go to the next drive that claims them, or rest.

Each engine

<FighterControls> puts an <Engine> on each side the model has a nozzle or an exhaust anchor on. Its engine prop is given to each, and exhaust is put inside each. See Engines.

Next, shape how they move.

On this page