mesh property
Mesh?
get
mesh
The collection of MeshPrimitive objects that represent the 3D geometry and material properties of this node.
This is a convenience over the node's first MeshComponent. The
getter returns that component's mesh, or null when the node has no
MeshComponent. The setter replaces the first MeshComponent's
mesh (adding a MeshComponent when there is none), or, given
null, removes every MeshComponent.
Implementation
Mesh? get mesh => _meshComponents.isEmpty ? null : _meshComponents.first.mesh;
set
mesh
(Mesh? value)
Implementation
set mesh(Mesh? value) {
if (value == null) {
for (final meshComponent in _meshComponents.toList()) {
removeComponent(meshComponent);
}
} else if (_meshComponents.isNotEmpty) {
_meshComponents.first.mesh = value;
} else {
addComponent(MeshComponent(value));
}
}