Shape class abstract base

A parameterized generator of geometry.

An abstraction rather than a bag of static factory methods, so a shape is a value: it can be stored, passed around, compared, kept in a list of things the UI offers, and swapped for a caller-defined implementation. A static Primitives.sphere(...) call can only be invoked, never held.

Implementations are expected to be immutable and cheap to construct; the work happens in build. base, so this can grow. A game writes its own shape by extending this; it may not implements it. An implementer would stop compiling the day a member is added here, which would make every addition to the shape contract a breaking change for a published engine.

Implementers

Constructors

Shape()
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
name → String
Name for diagnostics and UI labels.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

build({VertexLayout layout = VertexLayout.standard}) → MeshData
Generates the geometry for the requested layout.
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