SceneMesh class Widgets

A declarative mesh node: SceneNode plus a Geometry and Material.

The geometry and material are engine objects diffed by identity, so the mesh is only reassigned when a different instance is passed. Create them once (for example in initState or a field) rather than per build; constructing new GPU resources every rebuild is the main performance hazard of the declarative layer.

SceneMesh(
  geometry: CuboidGeometry(Vector3(1, 1, 1)),
  material: PhysicallyBasedMaterial(),
  position: Vector3(0, 1, 0),
)
Inheritance

Constructors

SceneMesh({Key? key, required Geometry geometry, required Material material, String? name, Vector3? position, Quaternion? rotation, Vector3? scale, Matrix4? transform, bool visible = true, List<Component> components = const [], SceneNodeController? controller, List<Widget> children = const []})
const

Properties

children → List<Widget>
Scene widgets describing this node's children.
finalinherited
components → List<Component>
Engine-side behavior attached to the node. Diffed by identity: keep a component instance stable across rebuilds to keep its state.
finalinherited
controller → SceneNodeController?
Imperative handle to the managed node.
finalinherited
geometry → Geometry
The vertex data to draw.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
material → Material
The material shading geometry.
final
name → String?
The node's name, for lookups and debugging. Defaults to ''.
finalinherited
position → Vector3?
Local translation. Identity when null.
finalinherited
rotation → Quaternion?
Local rotation. Identity when null.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scale → Vector3?
Local scale. One when null.
finalinherited
transform → Matrix4?
Full local transform. Mutually exclusive with the decomposed props.
finalinherited
visible → bool
Whether the node (and its subtree) renders.
finalinherited

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<SceneMesh>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

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