MeshBuilder class - mapview library - Dart API
MeshBuilder
MeshBuilder class abstract
Builder for meshes.
Such meshes can contain different kinds of primitives, like quads or triangles. Both primitives support adding texture coordinates that are mapped to the corners of the primitives. See TriangleMeshBuilder and QuadMeshBuilder for more details.
Note: Normals cannot be set as they are not necessary when using the MeshBuilder.
Example how to build a cube using QuadMeshBuilder
Mesh? cube = MeshBuilder()
.quad(Point3D(0.5, 0.5, 0.5),
Point3D(-0.5, 0.5, 0.5),
Point3D(0.5, -0.5, 0.5),
Point3D(-0.5, -0.5, 0.5))
.quad(Point3D(-0.5, 0.5, -0.5),
Point3D(0.5, 0.5, -0.5),
Point3D(-0.5, -0.5, -0.5),
Point3D(0.5, -0.5, -0.5))
.quad(Point3D(0.5, 0.5, -0.5),
Point3D(0.5, 0.5, 0.5),
Point3D(0.5, -0.5, -0.5),
Point3D(0.5, -0.5, 0.5))
.quad(Point3D(-0.5, 0.5, 0.5),
Point3D(-0.5, 0.5, -0.5),
Point3D(-0.5, -0.5, 0.5),
Point3D(-0.5, -0.5, -0.5))
.quad(Point3D(-0.5, 0.5, 0.5),
Point3D(0.5, 0.5, 0.5),
Point3D(-0.5, 0.5, -0.5),
Point3D(0.5, 0.5, -0.5))
.quad(Point3D(0.5, -0.5, 0.5),
Point3D(-0.5, -0.5, 0.5),
Point3D(0.5, -0.5, -0.5),
Point3D(-0.5, -0.5, -0.5))
.build();
- Implementers
Constructors
- MeshBuilder()
-
Constructs an instance of MeshBuilder.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
) → Mesh? - Returns Mesh?. mesh containing added geometry or 'null' if no geometry was added.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
quad(
Point3D a, Point3D b, Point3D c, Point3D d) → QuadMeshBuilder - Adds a quad.
-
toString(
) → String -
A string representation of this object.
inherited
-
triangle(
Point3D a, Point3D b, Point3D c) → TriangleMeshBuilder - Adds a triangle.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited