aeronautic

What a model says

Read a part's limits and extras, find the anchors a model marks, and put things on them.

Everything the rig found is there to read: each part's limits, its rest pose, which way is positive and any extras the model gave it, and each point the model marks for an effect.

A part

usePart(name) inside an <Airframe> gives one part, once the rig is there:

const rudder = usePart("CTRL_Rudder_L");

rudder?.min; // -30
rudder?.max; // 30
rudder?.unit; // "deg"
rudder?.positive; // "trailing_edge_right"
rudder?.extras; // anything else the model said

The fields of a ControlSurface:

fieldmeaning
namethe node's name
kindwhat it is: elevon, gear_door, throttle_lever…
nodethe node that moves: the model's own, or a pivot put in above a panel found by name
motionrotation or translation, about or along the node's local X
unitdeg, rad, m or normalized
min, maxits limits, in its unit
restwhere it was posed when found
sideleft, right or centre
groupthe rig's group, as elevons, or the kind for a part found by name
positivewhat a positive value does, as trailing_edge_down or open
foundByrig, name or virtual
extraseverything else the model's extras gave it, as ab_detent or limit_shape

useAirframe() gives the rig itself, and rig.surfaces every part.

Anchors

A model marks points for effects with nodes that carry an fx_kind extra, or are named FX_. useAnchor(name) gives one:

const muzzle = useAnchor("FX_Gun_Muzzle_R");

muzzle?.kind; // "gun_muzzle"
muzzle?.extras.rate_rpm_hint; // 2500

An anchor's kind is its fx_kind, or else its name after FX_ in lower case, its side dropped: FX_Gun_Muzzle_R would be a gun_muzzle without one. The docs' fighter marks:

anchorkindextras
FX_Exhaust_L/Rexhaust
FX_Gun_Muzzle_Rgun_muzzlerate_rpm_hint: 2500
FX_Wingtip_L/Rwingtip_vortex

An engine finds its exhaust by an anchor of kind exhaust, or one named for an exhaust, on its side.

Putting things on them

<Attach> puts its children in a part's or an anchor's frame, so they move with it:

<Attach anchor="FX_Gun_Muzzle_R">
  <MuzzleFlash />
</Attach>

<Attach part="CTRL_Canopy_C">
  <Pilot />
</Attach>

Clips

rig.clips holds every clip given as animations, by name, each scrubbed rather than played. The docs' fighter has ANIM_Gear_Retract, ANIM_Nozzle_L_Open, ANIM_Nozzle_R_Open, ANIM_Canopy_Open, ANIM_Bay_Open and ANIM_Gun_Deploy. The gear and the engines find theirs by name; drive the rest with <Clip> or by hand.

Next, by hand.

On this page