flutter3d_foundation 1.0.0-rc.1
flutter3d_foundation: ^1.0.0-rc.1 copied to clipboard
The types every flutter3d package shares: the exception roots, WorldPosition, LinearColor, the file envelope, Registration and portable maths. Plain Dart over vector_math.
1.0.0-rc.1 #
-
MaterialParametersand its schema live here.MaterialParameters,ParameterKey,ParameterType,ParameterDeclaration,MaterialParameterSchemaandMaterialParameterExceptionmoved fromflutter3d_core, so a level's material, which may not import the engine, holds the same type the renderer does. New:MaterialParameters.of(numbers by name, copied and checked),[](the bound floats, for a hot path that writes in place),[]=,names,isNotEmpty,copyandadopt(a hot reload's new schema, in place). -
internal.dartis outside semver, and the engine's packages ask for each other within one minor ('>=1.0.0-rc.1 <1.1.0'), so a minor that changes the parser never resolves under a core built before it. -
ExpressionType.measuringtakescomponents:andExpressionParser.failwhere:by name, so either can gain an option beside it. -
Breaking: a crash reporter takes one
CrashContext. ACrashReporteris handed aCrashContext(new) with theerror, itsstackTraceand therecordthe log kept, so a minor can tell a reporter more without breaking one written against 1.0. -
One severity, one kind of light and one pose for every package.
Severity(note,warning,error) is what a mesh check, an export, a level's validation and anIssue(newseverity:, a warning unless said) report in.LightTypemoved here from the core, so a level, a modeller project and a model file hold the scene's kinds,areaand a plugin's own among them.RigidPose(a position and an orientation, immutable, withcomponentsandfromComponents) is a tracked head, an XR pose, a ragdoll's bone and an element's body. -
ExpressionTokentakesnumber:by name, so a token can carry more than its number in a minor. -
internal.dartnames the expression bytecode (ExpressionBytecodeand its version) forflutter3d_physics_native, whose C core runs it: still internal, not covered by semver for applications, its format versioned in its header. -
The engine's expression language.
parseExpressionreads text such as1.8e-6 [Pa·s] * exp(1850 [K] / T)orT > 100 [°C] && p < 2 [bar]into a typedExpressiontree whose every node carries anExpressionType: its components and theDimensionit measures, so a sum of a length and a time is refused where it is written. Numbers in a unit are kept in the coherent SI unit.CompiledExpressionturns the tree into Dart closures once and runs it onPortablemaths, the same bits on every platform, with values taken asQuantitys by name;ExpressionCodecwrites the canonical text a document stores;ExpressionVisitor(withvisitUnknown) is how a translator reads the tree.ExpressionBuiltinlists the functions, each with its unit rule;Unit.coherentnames the coherent unit of a dimension. -
package:flutter3d_foundation/internal.dart: what a host language stands on, outside the API.ExpressionParser, thebase classthe material language extends, itsExpressionTokens andtokenizeExpression, and the operator arithmetic every evaluator shares (applyExpressionOperator,broadcastExpressionArguments). For the engine's own packages, asflutter3d_shaders'internal.dartis: a minor that grows the grammar may change them, so an application reads expressions throughparseExpressionand the types the main library names. -
A refusal of bad bytes is still a
FormatException.Flutter3dFormatExceptionimplements it, so code that catcheson FormatException, as 0.8 code does, keeps catching the engine's format refusals;sourceandoffsetare null unless a refusal knows them. -
UnsupportedCapabilityException, renamed fromUnsupportedCapabilityso that what is thrown says so in its name, as every other exception of the engine does. -
PlacedEventis abase mixin class: an event mixes it in beside theBusEventit extends (extends BusEvent with PlacedEvent), anddirectionis null unless the event says otherwise. -
LinearColor.toSrgb()returns anSrgbColor, a final class withr,g,b,a, value equality andtoLinear(), where it returned a record: the fields read as before, and a destructuring pattern names the class (final SrgbColor(:r, :g, :b, :a) = color.toSrgb()).Portable.sinCosandWorldPosition.relativeTokeep their records: a sine and a cosine, an offset's three components, maths that never grows. -
EngineLog: what an engine says about itself, one log per engine. Records at aLogLevel(trace,debug,info,warning,error, an open set with wire names) reach the listenerslistenregisters, and an error nothing caught goes throughreportCrashto everyonCrashreporter whatever the level, which is where a crash reporter is wired. No log is global, and none reads a clock unless it is handed one. -
FormatSpecs, the formats one program knows. A registry the packages that own formats add theirFormatSpecs to, found by id, alias or the longest suffix of a path; a second format under a taken id or alias is refused.flutter3d migrate --dataanddoctorwalk a project with it. -
UnitandQuantity: a unit is a vector of dimension exponents and a scale. SI's seven bases and the angle, so a lumen is not a candela and rad/s is not a hertz. Two units are equal when they measure the same dimension at the same size, whatever their symbols, soN·mis a joule.Unit.parsereads products, quotients, powers and SI prefixes (kPa,J/(kg·K),m/s²,s^-1), andtoJson/fromJsonwrite the symbol where it reads back and the whole unit where it does not, so a base this build does not name survives.Quantityconverts between units of one dimension (offsets included, so 20 °C is 293.15 K) and throwsUnitMismatchExceptionacross dimensions; text that is not a unit is aUnitFormatException. The parameter schemas, the expression language, the probes and the property laws all take this one type. -
ShaderCompileExceptionsays where. It gainsstage,target(the bundle section,webglorwebgpu),line,columnandexcerpt, or a list ofShaderDiagnostics, each with its own place, andtoJsonfor a tool.ShaderDiagnostic.parseLogreads GLSL'sERROR: 0:12:and thefile:14:7: error:of glslang, Tint and Naga. The constructor of before still works. -
UnsupportedCapabilityExceptionandCapabilityare here, so the core and the platforms refuse what they lack the way a device does. The refusal came fromflutter3d_hardware; itsfeatureis now aCapability, whichDeviceFeatureextends, and the sentence's "ask first" comes fromCapability.askedBy. -
ShaderCompileExceptionandAssetNotFoundException, the two failures every backend and loader share. The first, aFlutter3dFormatException, names theshader(or the pair a linker refused), thebackendand the compiler'slog; the second, aResourceException, names the asset'skeywith an optionaldetail, and keeps the platform's own failure as itscause. -
FormatSpec.openrefuses a version below 1, saying"version" counts from 1;versionOfreturns the 0 or negative number the document holds where it used to answer 1. -
The first release: the types every package shares, in a package of their own.
Flutter3dExceptionand its four families,DocumentFormatException,WorldPosition,LinearColor,IssueandIssueSink,FormatSpec,FormatDocument,FormatMigration,FormatRefusalandRegistrationcome fromflutter3d_plugin_api, which re-exports them, so nothing written against it changes. The crossings intovector_math(WorldPositionVector,Vector3Foundation,Vector4Foundation,LinearColorVector) andPortablecome fromflutter3d_physics, which no longer exports them;flutter3d_simandflutter3d_corestill do. It depends onvector_mathonly, so the hardware layer, the shaders and the backends no longer need the plugin API to throw or to read a file. -
PlacedEvent, the shape of an event that says where it happened, comes fromflutter3d_particles, so the elements' simulation can publish a placed event without depending on what draws it.