F3dDocument class final

A .f3d file, read as a ModelDocument.

The point of the format, and the reason ModelDocument was made an abstraction in the first place: ModelAsset.fromDocument, the resource cache and the instancing path are all untouched by this file existing. Adding a format meant writing a decoder, not editing the loader.

Nothing is parsed eagerly. The header and the section directory are read to find where things are, and every array the engine asks for afterwards is a view over the file bytesFloat32List.view on the same buffer, no copy and no per-element work. That is what makes loading a converted teapot a different order of magnitude from parsing the OBJ it came from.

Inheritance

Constructors

F3dDocument.parse(Uint8List bytes)
Reads the header of bytes. The body is decoded lazily.
factory

Properties

animations List<AnimationClip>
Clips that drive nodes. Empty for formats that carry no animation.
latefinal
asset DocumentAsset?
What the source file said about itself. Null for a format that carries no such block, or a document nobody has set one on.
latefinal
cameras List<ModelCamera>
Cameras a node in nodes may point at, by ModelNode.cameraIndex. Empty for formats that carry none — OBJ and .f3d among them.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
images List<EncodedImage>
latefinal
lights List<ModelLight>
Punctual lights a node in nodes may point at, by ModelNode.lightIndexfmt-28's own row. Empty for formats that carry no light, which is every one of them except glTF's own KHR_lights_punctual.
no setterinherited
materials List<SurfaceMaterial>
latefinal
nodes List<ModelNode>
The model's node hierarchy.
latefinal
roots List<int>
Indices into nodes with no parent.
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
skins List<ModelSkin>
Skeletons. Empty for formats that carry no skinning.
latefinal
surfaces List<ModelSurface>
latefinal
triangleCount int
no setterinherited
vertexCount int
no setterinherited
warnings List<String>
Non-fatal findings from decoding: ignored extensions, skipped primitives, unresolved references. Surfaced rather than logged so callers can decide whether to care.
latefinal

Methods

computeBounds() → Aabb3
Bounds in the model's own space.
inherited
maskUnder(String name) AnimationMask
The joints at and under the node called name, as a mask a layer takes.
inherited
maskUnderIndex(int root) AnimationMask
The same, from an index into nodes.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited