flutter3d_elements 1.0.0-rc.2
flutter3d_elements: ^1.0.0-rc.2 copied to clipboard
Water, fire and bodies on the physics core's world, stepped with no renderer: flames held to bodies, waters poured and fed, plugin elements over its fields, and their events.
1.0.0-rc.2 #
-
Breaking:
Ballistics.aim(step:)isaim(dt:). The length of the step a throw is flown at isdt, as every loop names it; a number calledstepis a count of steps.dart fixrenames the argument. -
Breaking: one concept has one spelling. A field of view is
fieldOfView(where it wasfovY,yfovorfov), a ray is cast withrayCastand half a size ishalfExtents, as the rest of the engine names them:Solid.box. The same values under the one name; serialized keys are unchanged, anddart fixrenames the calls, the arguments and the overrides. -
Breaking: a heat release is in watts.
SmokePlume.virtualOrigin,centerlineSpeed,halfWidthanddepthtake a fire's power in W, asNativeFire.poweris, and convert to the kilowatts Heskestad's and McCaffrey's correlations are written in inside; a number in kW is multiplied by 1000. A parameter named for its unit says what it is:ElementFieldsandNativeElementFieldstakeaddHeat(body, heat),addWater(body, mass)andsetTemperature(body, temperature), withFires.douse(body, mass)andSolid.at(temperature). -
Breaking: the elements are heard through a subscription, and their callbacks are spelled
on….ElementsSimulation.listen(listener)answers aRegistration, where the fieldElementsSimulation.listenerheld one;listenersreads them.ElementsListener'scaught,out,burntOut,wetted,burnerOut,exploded,budget,seenandlostareonCaught,onOut,onBurntOut,onWetted,onBurnerOut,onExploded,onOverBudget,onFireSeenandonFireLost;dart fixrenames them. -
Breaking:
ElementsSimulation.addBodytakesorientation:andangularVelocity:, where it tookturn:andspin:, as every core names a simulated body's rotation and spin.dart fixrenames the arguments. -
Breaking:
ElementsSimulation.openis the unnamed constructor,ElementsSimulation(). It makes a world of its own at once;openis for what waits.flutter3d_lints:migraterewrites the calls. -
Breaking: no public
late finalsetter.ElementsSimulation.firesis a getter over a private field: the setter they had worked once and threw the second time, and every read compiles as it did. -
Breaking: results that were records are final classes.
ElementsSimulationanswered or held a record, which can never gain a field. Each answers a final class now, with the record's field names (a positional$1has a name of its own),==andhashCode. A field read compiles as before; a destructuring pattern names the class, andflutter3d_build:migraterewrites the$1reads. -
Breaking: what a body collides with is a
CollisionFilter.ElementsSimulation.addBodyandfollowtakecollides:as aCollisionFilter(new) with the samelayerandmask, where it was a record, which can never gain a field: writeCollisionFilter(layer: …, mask: …)where(layer: …, mask: …)was. -
radiantFluxOnstands a flame byFireExposure.standingMiddleOf, the core package's one rule for a flame under a ceiling, which the platformer's runner now burns by too. -
Breaking: each
ElementsListenercallback takes its event.caught,out,burntOut,wettedandburnerOuttake theElementCaught(and so on) the bus carries, with itsbodyandmade;explodedanElementExploded,budgetanElementsOverBudget,seenanElementFireSeenandlostanElementFireLost. One object per callback can gain a field in a minor, where a list of parameters cannot. -
Breaking:
ElementsSimulationPluginis the engine's by name, and anElementPluginis its author's.ElementsSimulationPluginisflutter3d_elementsby default, where it waselements:elementsis an area of the engine's events, which no plugin id may take.ElementPlugin(hook, id:, world:)takes the id of the package that ships the element, and refuses one in an engine namespace, so an element from outside gets no engine rights. A bare hook id is filed in that namespace (ElementPlugin.element):frostinacme_frostruns in the phaseacme_frost.frostand answers to the switch of that name. A hook whose id has a namespace runs in a phase of that name, notelements.<id>.ElementEventKindsandElementSwitchesrefuse a plugin's kind or switch outside its namespace. -
An element's followed pose is
flutter3d_foundation'sRigidPose, where it was a record of its own. -
The heat on a body, from the field.
ElementFields.radiantFluxOnandFieldQuantity.radiantFlux(W/m²): each fire's radiant heat, Modak's point source at the middle of its flame, on the point of the body a ray from there meets first, and nothing from a fire something else stands in front of. A flame longer than the room is high is measured from the middle of the column under the ceiling, not from above the roof. What a game's character is burnt by, read rather than worked out beside the world. -
A burner fed what was spilt.
Fires.setBurner(body, burner, fuel:)feeds a burner that many kilograms and no more: it goes out by itself when they are burnt, told asburnerOut, andFires.fuelLeftand the snapshot keep what is left. -
A body weighed from the catalogue.
Solid.of(shape, material)makes a solid of a catalogue material, as heat sees it and as dense as the catalogue says, at its reference state or aMatterState;wall:makes it hollow, displacing all of its shape and weighing its shell.Solid.at(kelvin)puts a solid in the world at a temperature of its own — a bomb from its melt — whichaddBodysets. -
A throw aimed by the core's own flight.
Ballistics.aim(world, solid, from:, to:, elevation:)finds the velocity whose flight through the world's gravity, air and wind, flown by the core at the game's step, comes down on the mark: no vacuum formula and no number to make up for the drag. -
Brands a fire lofts.
Firebrandslofts a share of the fuel each fire burns as brands of a game's solid, deterministically, from the top of the flame up its plume at McCaffrey's centreline speed and with the wind, as hot as the flame; the core burns them and lets them light what they come down on. A budget (most) and what it held back (skipped), and a save. -
ElementFieldshas a body for every member: what a backend does not override is refused with anUnsupportedCapabilityExceptionnaming the member, so a member added in a minor breaks no backend. -
Fields by quantity.
ElementFields.quantityOf(body, FieldQuantity)reads a field as a foundationQuantityin its unit, andaddQuantityadds one in any unit of the same dimension (aUnitMismatchExceptionotherwise).FieldQuantityis an open set —temperature,surfaceTemperature,heatandwaterto begin with — so humidity, pressure or a concentration arrive as a backend's own quantity, not as a new member. -
ElementExplodedmixesPlacedEventin (with), which foundation made abase mixin class. -
The first release: the elements' simulation, out of
flutter3d_effects.ElementsSimulation,Fires,Igniter,WaterBody,Follower,TrackedBody,Solid,Bed,ElementHeightfield,ElementPose,ElementsListener,ElementsSimulationPlugin, the plugin element's hook (ElementHook,ElementStep,ElementFrame,ElementFields,NativeElementFields,ElementBody,installElement,ElementPlugin), the registries (ElementSwitches,ElementEventKinds), the switches (ElementsSteps,FireSteps,LiquidSteps) and the events (ElementEventand the listener's eight,declareElementEvents) were declared there in 0.9 and are declared here now.flutter3d_effectsdoes not re-export them: import this package. New in 1.0, so no 0.8 code names them. -
A body and a water hold nothing that draws them.
TrackedBody.lookandWaterBody.viewandWaterBody.lookare gone;ElementsSimulation.tracktakes no look. The view keeps them:Elements.lookOf,Elements.viewOfandElements.waterLookOfinflutter3d_effects. -
ElementsSimulation.addWaterpours a water with no view, andwaters,waterAtandremovehold it, so a server steps the waters a game draws.Elements.addWaterpours through it. -
SmokePlume: the plume's virtual origin, width, centreline speed and optical depth, whichseenThroughSmokereads andFireView.plumeDepthdraws with. The numbers are the onesFireViewhad.