Mesh class base Geometry

Defines the shape and appearance of a 3D model in the scene.

It consists of a list of MeshPrimitive instances, where each primitive contains the Geometry and the Material to render a specific part of the 3d model.

Constructors

Mesh(Geometry geometry, Material material)
Creates a Mesh consisting of a single MeshPrimitive with the given Geometry and Material.
Mesh.primitives({required List<MeshPrimitive> primitives})
Creates a Mesh composed of the supplied MeshPrimitive list.

Properties

hashCode int
The hash code for this object.
no setterinherited
localBounds → Aabb3?
Local-space union of every primitive's Geometry.localBounds, or null when no primitive has computable bounds.
no setter
morphTargets MorphTargetData?
The morph target data of this mesh's first morphed primitive, or null when no primitive carries targets. Every primitive of an imported mesh shares one target count and order (the importers validate it), so the first primitive's names, defaults, and count speak for the whole mesh.
no setter
primitives List<MeshPrimitive>
The list of MeshPrimitive objects that make up the Geometry and Material of the 3D model.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clone() Mesh
Returns a shallow copy: a new Mesh with new MeshPrimitives that reuse this mesh's Geometry and Material instances.
markLocalBoundsDirty() → void
Invalidate the cached localBounds. Rarely needed, since the cache already detects a replaced primitive geometry and a bumped Geometry.localBoundsVersion; call this only after mutating a geometry's bounds through a path that leaves its version unchanged.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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