ModelAsset class final

Reusable description of a visual model available to the renderer.

Filament loads binary glTF (.glb) files from Android or Flutter assets. The bundled Android viewport can also load static Wavefront OBJ (.obj) meshes by converting them to a minimal runtime GLB before handing them to Filament. If an OBJ references an MTL file, basic diffuse material colors are loaded from the neighboring packaged .mtl asset.

Constructors

ModelAsset({required String assetPath, double normalizedScale = 1, int? animationIndex, ModelVerticalAnchor verticalAnchor = ModelVerticalAnchor.center, bool castShadows = true, bool receiveShadows = true})
Creates a model asset prototype.
const

Properties

animationIndex int?
Optional glTF animation clip played in a loop.
final
assetPath String
Asset path, for example assets/models/Fox.glb or models/chair.obj.
final
castShadows bool
Whether instances of this asset render into shadow maps.
final
hashCode int
The hash code for this object.
no setterinherited
normalizedScale double
Scale applied after fitting the model inside a normalized unit cube.
final
receiveShadows bool
Whether instances of this asset receive scene shadows.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
verticalAnchor ModelVerticalAnchor
Which vertical point of the model bounds is placed at the transform.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMessage() Map<String, Object?>
Serializes asset settings for the native renderer bridge.
toString() String
A string representation of this object.
inherited

Operators

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