Appearance
@bendyline/molen-kernel/aircraft
Molen headless deterministic simulation kernel (no DOM, no three.js).
ts
import { /* … */ } from '@bendyline/molen-kernel/aircraft';Interfaces
AircraftCollisionProbe
World-space sphere, or a finite rotor disc when disc is present.
Properties
center
ts
center: [number, number, number];disc?
ts
optional disc?: object;Radius is radial, not a bounding sphere. Normal is unit length in world space.
angularSpeed
ts
angularSpeed: number;halfThickness
ts
halfThickness: number;normal
ts
normal: [number, number, number];part
ts
part: string;radius
ts
radius: number;AircraftContact
Normal points out of the obstacle. Point and depth are in world meters.
Properties
depth
ts
depth: number;normal
ts
normal: [number, number, number];part
ts
part: string;point
ts
point: [number, number, number];AircraftEnvironment
Extends
AircraftContactEnvironment
Properties
boostMode?
ts
optional boostMode?: boolean;Override the world's 4× travel assist. Aerodynamics retain normal handling speeds.
time?
ts
optional time?: number;Simulation time in seconds at the start of the step; moves gusts and turbulence. Default 0.
weather?
ts
optional weather?: WeatherData;Optional shared atmospheric conditions. Otherwise retain the stock altitude-density model.
wind?
ts
optional wind?: [number, number, number];Uniform wind override in m/s; replaces the weather's wind field, turbulence included.
Methods
canOccupy()?
ts
optional canOccupy(
transform,
spec,
entity
): boolean;Legacy boolean obstruction test. Prefer contacts for impact normals and breakable parts.
Parameters
transform
spec
AircraftSpec
entity
string
Returns
boolean
contacts()?
ts
optional contacts(probes, entity): readonly AircraftContact[];Static obstacle contacts, in the same absolute coordinate frame as the simulation.
Parameters
probes
readonly AircraftCollisionProbe[]
entity
string
Returns
readonly AircraftContact[]
Inherited from
ts
AircraftContactEnvironment.contactsgroundHeight()
ts
groundHeight(
x,
z,
y?
): number | undefined;Parameters
x
number
z
number
y?
number
Returns
number | undefined
Overrides
ts
AircraftContactEnvironment.groundHeightVariables
Aircraft
ts
const Aircraft: ComponentType<AircraftData>;AircraftInput
ts
const AircraftInput: ComponentType<AircraftInputData>;AircraftState
ts
const AircraftState: ComponentType<AircraftStateData>;IDLE_AIRCRAFT_INPUT
ts
const IDLE_AIRCRAFT_INPUT: AircraftInputData;Functions
aircraftCollisionParts()
ts
function aircraftCollisionParts(spec): readonly AircraftCollisionPart[];Parameters
spec
AircraftSpec
Returns
readonly AircraftCollisionPart[]
aircraftCollisionProbes()
ts
function aircraftCollisionProbes(
t,
spec,
state?
): AircraftCollisionProbe[];Parameters
t
spec
AircraftSpec
state?
AircraftStateData
Returns
aircraftDeparture()
ts
function aircraftDeparture(
wing,
alpha,
grounded
): number;High-alpha loss/reversal of stability. Symmetric unperturbed flight has no invented yaw.
Parameters
wing
AirplanePhysicsSpec
alpha
number
grounded
boolean
Returns
number
aircraftDragCoefficient()
ts
function aircraftDragCoefficient(
wing,
cl,
mach,
gear,
flaps,
separation?,
alpha?,
heightOverSpan?
): number;Shared polar for both the flight solver and steady-performance experiments.
Parameters
wing
AirplanePhysicsSpec
cl
number
mach
number
gear
number
flaps
number
separation?
number
alpha?
number
heightOverSpan?
number
Returns
number
aircraftEngineRpm()
ts
function aircraftEngineRpm(
engine,
throttle,
combustion?,
propeller?
): number;Low power reaches the fine-pitch stop; otherwise the governor holds the selected RPM.
Parameters
engine
AircraftEngineSpec
throttle
number
combustion?
number
propeller?
number
Returns
number
aircraftEngines()
ts
function aircraftEngines(spec): readonly AircraftNamedEngineSpec[];Resolve the single-engine form as "main", or return an airplane's named engine bank.
Parameters
spec
AircraftSpec
Returns
readonly AircraftNamedEngineSpec[]
aircraftEngineShaftPower()
ts
function aircraftEngineShaftPower(
engine,
atmosphere,
throttle?,
mixture?,
propeller?
): number;Torque-limited shaft model; lower governed RPM reduces available shaft power.
Parameters
engine
AircraftEngineSpec
atmosphere
throttle?
number
mixture?
number
propeller?
number
Returns
number
aircraftEngineThrust()
ts
function aircraftEngineThrust(
engine,
wing,
atmosphere,
speed,
throttle?,
afterburner?,
mixture?,
propeller?
): number;Installed propulsion approximation; full spool. No velocity cap or aircraft-name switches.
Parameters
engine
AircraftEngineSpec
wing
AirplanePhysicsSpec
atmosphere
speed
number
throttle?
number
afterburner?
number
mixture?
number
propeller?
number
Returns
number
aircraftFuelFlow()
ts
function aircraftFuelFlow(
engine,
state,
load?
): number;Fuel burned by a running engine in kg/s. A jet burns by its thrust, several times more with the afterburner lit; a propeller or rotor engine by the shaft power it delivers (load scales that for a governed rotor at part collective). Neither goes below an idle flow.
Parameters
engine
AircraftEngineSpec
state
AircraftEngineStateData
load?
number
Returns
number
aircraftMixtureEfficiency()
ts
function aircraftMixtureEfficiency(
engine,
atmosphere,
mixture?
): number;Reduced fuel/air model: lean cutoff, best-power mixture, then excess-fuel power loss. The density knee also approximates boosted intake air. This is not a carburetor/EGT model.
Parameters
engine
AircraftEngineSpec
atmosphere
mixture?
number
Returns
number
aircraftMounts()
ts
function aircraftMounts(spec): MountableData;Parameters
spec
AircraftSpec
Returns
engineThrottle()
ts
function engineThrottle(engine, throttle): object;Reheat is the last part of the throttle lever; legacy/ordinary engines have no detent.
Parameters
engine
AircraftEngineSpec
throttle
number
Returns
object
afterburner
ts
afterburner: number;dry
ts
dry: number;flyAircraft()
ts
function flyAircraft(
world,
actor,
input
): boolean;Parameters
world
actor
string
input
AircraftInputData
Returns
boolean
initialAircraftState()
ts
function initialAircraftState(yaw?): AircraftStateData;Parameters
yaw?
number
Returns
AircraftStateData
installAircraft()
ts
function installAircraft(world, environment?): void;Parameters
world
environment?
Returns
void
levelFlightAngleOfAttack()
ts
function levelFlightAngleOfAttack(
spec,
airspeed,
density?,
flaps?
): number;The angle of attack in radians at which an airplane's wing carries its weight at airspeed (m/s) in air of density (kg/m³), kept short of the stall. Launch an airplane already flying with this as its pitch and pitchTrim and it holds level flight hands-off. flaps is down or up, or a flap position 0..1.
Parameters
spec
AircraftSpec
airspeed
number
density?
number
flaps?
number | boolean
Returns
number
refuelAircraft()
ts
function refuelAircraft(world, aircraft): boolean;Fill the tanks of an aircraft standing on the ground with every engine stopped, as a ground crew would before the next flight. Returns false, changing nothing, in flight, with an engine turning, or for an aircraft that declares no fuel.
Parameters
world
aircraft
string
Returns
boolean
setAircraftEngineFailed()
ts
function setAircraftEngineFailed(
world,
aircraft,
engine,
failed?
): boolean;Latch or explicitly repair an engine failure. Pilot input cannot clear a failure.
Parameters
world
aircraft
string
engine
string
failed?
boolean
Returns
boolean
stepAircraft()
ts
function stepAircraft(
transform,
state,
input,
spec,
dt,
env,
id?
): object;Deterministic flight, substepped independently of rendering. No second physics body.
Airplanes are a six-degree-of-freedom rigid body: the transform's quaternion is the attitude, with no pitch or bank limits, so loops, rolls and inverted flight follow from the forces. Wing lift and drag, side force and propeller thrust act at the center of mass; weathercock and angle-of-attack stability, rate damping, dihedral effect, inertia coupling, propeller torque, P-factor and gyroscopic precession and asymmetric thrust produce the moments. The pilot's stick moves the elevator, which sets the angle of attack the airframe flies toward around a slowly self-adjusting trim; ailerons command roll rate and the rudder a yaw moment. On the wheels, a steerable tailwheel and tire side grip that fades as the wing takes the weight resist weathervaning and propeller swing. Wind comes from the weather's wind field, sampled at the center of mass and both wingtips so turbulence also rolls the airplane.
Helicopters keep the assisted model: cyclic commands a bounded disc tilt.
Parameters
transform
state
AircraftStateData
input
AircraftInputData
spec
AircraftSpec
dt
number
env
id?
string
Returns
object
state
ts
state: AircraftStateData;transform
ts
transform: TransformData;waveDragCoefficient()
ts
function waveDragCoefficient(wing, mach): number;Continuous transonic drag rise. It persists supersonically instead of vanishing past Mach 1.
Parameters
wing
AirplanePhysicsSpec
mach
number
Returns
number
References
sampleAtmosphere
Re-exports sampleAtmosphere