flutter3d_game_physics 1.0.0-rc.2
flutter3d_game_physics: ^1.0.0-rc.2 copied to clipboard
Gameplay parts for flutter3d games that need the native physics core: ragdolls, burning wrecks, party sessions and the elements heard.
1.0.0-rc.2 #
-
Breaking:
SkeletonRagdoll(meshWorld:)ismeshToScene:. The matrix is the skinned mesh's node in scene space, not a world position.dart fixrenames the argument. -
Daylight.lightWaterhands the water its sky's luminance in nits, whichElements.skynow takes. -
Breaking:
WadingHearing.hushishushSeconds. A time in adoublesays seconds in its name; the same value.dart fixrenames it. -
Breaking:
PartySession.disposeisclose, asRoomSession.closeis.dispose()is synchronous, as Flutter's is, and an end that has to be waited for isFuture<void> close(): aFuturefromdisposewas left unawaited by every caller that wrote it in a widget's owndispose.dart fixrenames the calls and the overrides. -
The day lights its water in lux.
DaylightOnWater.lightWaterhands the water the sun's colour and its illuminance, where it handed the colour times the lux as the renderer's own scale and lit the water some five thousand times too bright. -
Breaking:
BurningWreck.turnisBurningWreck.orientation, as every core names a simulated body's rotation; the published row still writes it underturn.dart fixrenames it. -
Breaking: no public
late finalsetter.SkeletonRagdoll.ragdollis 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.
RagdollPartanswered 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. -
party.dartexportsPartySeat, the seatPartySession.open'sstageis handed, so the callback can name it with this import alone. -
Breaking:
RagdollCorpses.begintakes oneActorDeathContext, as everyActorCorpsesdoes now. -
BurningWreck.fromJsonthrows aSnapshotFormatExceptionfor a row that is not a wreck; the component's codec still skips the row. -
ElementSoundstakescues:andbus:by name, so it can take another in a minor. -
The wrecks are drawn from what they publish.
BurningWrecksis the simulation's half alone: made over anElementsSimulation, with no device, it places, lights and lets go the wrecks and publishes each as aBurningWreck(its body, whether it is oil, where it lies, how it is turned, whether it burns;toJson,fromJsonand aComponentCodec).WreckLooks(scene, device).show(published)draws the slicks from those rows, so the wrecks draw the same wherever the elements are stepped. -
Which crash breaks a car's tank, by its standard.
FuelCellsays whether a crash that took so much speed out of a car breaks its fuel cell:FuelCell.racingstands the FIA's 15 m/s frontal impact test of a Formula One chassis,FuelCell.roadFMVSS No. 301's 48 km/h barrier. What the tank spills burns on a burner fed that much fuel and goes out when it is burnt (Fires.setBurner'sfuel). -
A body wading is heard.
ElementSounds.wade(scene, waders, dt)plays a splash as eachWadergoes into water fast enough, as loud as it goes and not again for a moment, and holds a wash to each one ploughing through, apart from the falls;ElementCuesgainswash(the falls' unless given) andwading(WadingHearing.standard, a walker;WadingHearing.car), andElementCues.circuitis the racing demo's cues, so its own copy of them can go. -
A body dies with its tone up.
SkeletonRagdollandRagdollCorpsestaketone:(MuscleTone.humanby default, null for a body limp from the start): the body takes the killing blow as one and goes limp over a fifth of a second. Struck low in the back, at the root of its chest bone, the dungeon's runner now ends lying, its head 0.1 m up, where it sat propped on its elbows at 0.6.RagdollCorpses.blowAtsays how far up the chest bone the blow lands, 0.75 unless set. -
The Quaternius profile names each joint's group. Its spine, neck, shoulders, elbows, hips and knees are of
JointGroup.spineand the rest, soJointTissue.humanholds each at the end of its range with the stiffness measured for it, stiffening past the limit, where every joint had one linear 3000 N·m/rad. Struck at the top of the chest with the pelvis held, a relaxed spine now gives about 0.35 rad past its limit, where it gave 0.06; thrown back on a floor, it stays inside its range, as before. -
The Quaternius profile moves as a body does. The spine, the neck, the shoulders and the hips are
RagdollSwings with the American Academy of Orthopaedic Surgeons' ranges of normal motion (the spine bends forward 80 degrees and back 25, where symmetric cones of half a radian held it at its limit in flexion), measured from the anatomical position against the figure's own forward and up, so T-pose arms are limited as arms hanging at the side and cannot hang plumb behind a body on its back. Breaking:SkeletonRagdoll(friction:)is gone fortissue:, aJointTissue. -
The killing blow lands on the upper chest. It landed at the chest bone's root, the small of the back below the centre of mass, where it knocked the hips out and sat a corpse down on its arms; now it turns the body back over its feet. The wrong tails of the right upper arm and thigh had hidden it, by tipping every body over sideways.
-
Breaking:
elements.dartandparty.dartre-export nothing.AudibleandPhysicsHearingareflutter3d_effects',PartySeatisflutter3d_net's andSimulationVersionisflutter3d_plugin_api's. -
The skeleton's ragdoll lives with the corpses.
SkeletonRagdoll,RagdollProfile,RagdollPart,RagdollLyingandRagdollGetUpmoved here fromflutter3d_physics_native, which names no scene any more;ragdoll.dartexports them besideRagdollCorpses. -
Breaking:
RagdollCorpsesfalls by its world. Thegravityparameter ofRagdollCorpses(is gone: a corpse falls by the collision world'sproperties. Itsmassdefaults toreferenceBodyMass(73 kg) andRagdollCorpses.defaultPushis that times two metres a second. -
New: the gameplay parts that need the native physics core, split out of
flutter3d_game_kitso a game that uses none of them compiles no C:ragdoll.dart,wrecks.dartandparty.dart, which wereflutter3d_addon_ragdoll,flutter3d_addon_wrecksandflutter3d_addon_party, andelements.dart, withElementSoundsandElementCuesfrom the soundtrack andDaylight.lightWaterfrom the world as theDaylightOnWaterextension.flutter3d_game_physics.dartexports them all.dart run flutter3d_build:migratemoves a project's dependencies and imports; the packages' own histories are indoc/changelogs/.
ragdoll.dart, from flutter3d_addon_ragdoll 1.0.0-rc.1 #
-
Actors that fall as bodies when they die.
RagdollCorpsesis anActorCorpses: handed toActorVisuals, it takes a dead actor's skeleton over and lets it fall in the physics core against the level and the actors still standing. A rig the ragdoll profile does not name keeps its death clip. -
Pushed away from the blow.
pushedFromsays where the killing blow came from, and the chest is thrown away from there, level and a little up. The push, the body it lands on and the body's mass are a game's to set. -
Display, not simulation. The bodies step on the frame, in fixed sixtieths of their own and at most four a frame, and are in no save or replay: nothing in a step asks where a body lies.
-
From the dungeon demo, which now hands it the player's position as where each blow came from.
wrecks.dart, from flutter3d_addon_wrecks 1.0.0-rc.1 #
-
Wrecks that burn and sink, on the elements.
BurningWrecksplaces what a hit leaves in a game'sElementsand holds a blast's fireball to it:oilis a slick of crude afloat and alight, drawn black and glossy, carried off by the current while the hull goes down under it;timbersis a heap of wood burning where it fell. The physics core's heat burns them as long as their fuel lasts, and the elements draw the flames and the smoke. -
Let go behind the player.
stepis told how far the player has come along the way the game travels,along, and lets go of every wreck more thanbehindmetres back.clearputs every fire out for a new run. -
From the River demo, whose tankers and depots leave these behind.
-
BurningWreckstakeselementsanddeviceas plain positional parameters rather thanthis._elementsandthis._device, which put a private name in the API. Callers pass them as before.
party.dart, from flutter3d_addon_party 1.0.0-rc.1 #
-
Breaking: a boolean reads as a question, and no
boolis positional.PartySession.fullisisFull.dart fixcarries the renames. -
Breaking:
RoomSession.createishost, besidejoin:createis the synchronous verb, and this one opens a session on the relay. -
The relay is asked with the whole
SimulationVersion, andSideRecordingtakes thephysicsits side plays on. -
Party sessions for any game.
PartySession<G>makes, joins or finds a party on the relay and hands the seat to the game's ownstage; the relay settles the size and the slot.seatsrefuses a party bigger than the game can stage, before anything is staged. -
The simulation's version always goes with the ask.
PartySessionandRoomSessionrequire aSimulationVersionand send it asrelayVersionOfreads it,engine × 1000 + game. A party used to ask with none, which met only builds that named none; now a build on other rules is turned away with the relay's reason. -
A room for two, and one side's run.
RoomSessionseats the maker at 0 and the one who joins at 1, and keeps why the relay closed it.SideRecordingkeeps a side's start, input tape and settled digests as aDemo, so the two sides' files can be compared. -
No
dart:io. Writing the run to a file is left to the application, so the package runs on the web.