aeronautic

Core

WingVapor, the plain three.js class, its options and methods.

WingVapor

import { WingVapor } from "@aeronautic/wing-vapor";

const vapor = new WingVapor(options);
scene.add(vapor.mesh);

It needs three's WebGPURenderer (either backend) and reads the scene's depth, so the vapor stops at the wing it sits on.

Options

Every group is over its defaults.

optiontypewhat it is
airframePartial<VaporAirframe>The wing and body.
flightPartial<VaporFlight>What it is doing.
airPartial<VaporAir>The day.
lookPartial<VaporLook>How it is lit and photographed.
effectsPartial<VaporEffects>Which phenomena to draw. Compiled in.
objectObject3D | nullWhat it follows. None: the world's origin, or wherever frame puts it.
frameWingVaporFrameposition, forward and up of the airframe on what it follows.
shapeWingShape | nullThe wing as a table, from capture_airframe, in place of the trapezoid.
qualityVaporQualityName | Partial<VaporQuality>The most iterations a pixel's march may take. "high", 160, by default; setQuality changes it live.

Fields

fieldtypewhat it is
meshMeshThe mesh to put in the scene.
uniformsVaporUniformsThe uniforms the material is driven by.
objectObject3D | nullWhat it follows. Writable.
timeScalenumberHow fast the moisture's clock runs, 1 being real time.
stateReadonly<VaporState>Everything it is drawn from: the air, the lift, the field.
airframe, flight, air, look, effectsReadonly<…>The dials as they are now.
shapeReadonly<WingShape>The wing being drawn, as a table.
frameOptionsReadonly<WingVaporFrame>The frame, as last set.

Methods

methodwhat it does
updateFlight(flight)Change some of the flight and keep the rest. Cheap enough for every frame.
updateAir(air)Change some of the day. Rewrites the condensation table: fine every frame, but not free.
updateAirframe(airframe)Change some of the airframe. Rebuilds the wing's table.
updateLook(look)Change some of the look.
setEffects(effects)Change which phenomena are drawn, over every one on. Rebuilds the material.
setFrame(frame)Move the airframe's frame on what it follows.
setQuality(quality?)Change the quality, a name or { maxSteps }. Live: no rebuild.
setShape(shape)Draw the wing from a table, or go back to the trapezoid with null.
capture(object, options?)Measure a model from six depth views and fly it, all at once. Returns the MeasuredAirframe.
captureAsync(object, options?)The same, a few milliseconds a frame. Takes budgetMs and an abort signal besides the capture's options.
applyCapture(measured)Fly a measured airframe, from a capture or deserialize_capture.
dispose()Free the GPU resources. It cannot be used afterwards.

Capture options

optiontypedefaultwhat it is
resolutionnumber128Pixels along the longest side of the box.
filter(mesh: Mesh) => booleanvisible meshesWhich meshes to keep.
position, forward, up[x, y, z]the vapor's ownThe airframe's frame on the model.

On this page