PolylineGeometry class

A thick, camera-facing line through a list of points.

PolylineGeometry builds a triangle strip that always faces the camera, which suits navigation routes and other overlay lines. The strip is regenerated for the current view by updateForCamera, which should be called every frame before rendering.

The result is an ordinary triangle mesh: pair it with any material, and use perVertexColor for gradient or distance-fade effects.

PolylineCap.round adds a camera-facing disk at each end point, drawStart/drawEnd trim the line or animate it drawing on, and a DashPattern breaks it into dashes, which its own cap can round. Corners use an averaged direction, which stays smooth on a finely sampled curve but can pinch on a very sharp turn. Rounded corner joins and a GPU vertex-shader expansion that avoids the per-frame rebuild are planned follow-ups.

Inheritance

Constructors

PolylineGeometry(List<Vector3> points, {double width = 8.0, PolylineWidthMode widthMode = PolylineWidthMode.screenPixels, PolylineCap cap = PolylineCap.butt, DashPattern? dash, List<double>? perVertexWidth, List<Vector4>? perVertexColor})
Creates a polyline through points (at least two).
factory

Properties

drawEnd double
The fraction of the line, by arc length, where the visible range ends. See drawStart. The default is 1.
getter/setter pair
drawStart double
The fraction of the line, by arc length, where the visible range begins. With drawEnd this trims the line or animates it drawing on. Clamped to 0..1; the default is 0.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isUpdatable bool
Whether this geometry can be updated in place.
no setterinherited
localBoundingSphere → Sphere?
Local-space bounding sphere paired with localBounds. Same nullability semantics.
no setterinherited
localBounds → Aabb3?
Local-space axis-aligned bounding box of this geometry's vertex positions, or null if bounds are unknown. Computed by uploadVertexData for procedural geometry, populated from the .model flatbuffer for imported geometry, and (for the advanced setVertices path where the caller manages its own GPU buffer) left null unless the caller assigns it via setLocalBounds.
no setterinherited
localBoundsVersion int
A counter that increments each time setLocalBounds changes the bounds.
no setterinherited
primitiveType ↔ PrimitiveType
How the vertex/index data is assembled into primitives when drawn.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storage GeometryStorage
How this geometry's GPU buffers are managed; see GeometryStorage.
finalinherited
vertexCount int
The number of vertices currently drawn.
no setterinherited
vertexShader Shader
The vertex shader used when rendering this geometry.
no setterinherited

Methods

bind(RenderPass pass, HostBuffer transientsBuffer, Matrix4 modelTransform, Matrix4 cameraTransform, Vector3 cameraPosition) → void
Binds vertex/index buffers and per-frame uniforms onto pass in preparation for a draw call.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rebuild({required Float32List positions, Float32List? normals, Float32List? texCoords, Float32List? colors, List<int>? indices}) → void
Replaces all of this geometry's data, allowing the vertex and index counts to change.
inherited
setIndices(BufferView indices, IndexType indexType) → void
Binds an already-uploaded index buffer view, with element width determined by indexType.
inherited
setJointsTexture(Texture? texture, int width) → void
Hook for skinned geometries to receive the joints texture computed by Skin.getJointsTexture.
inherited
setLocalBounds(Aabb3? aabb, Sphere? sphere) → void
Override the bounds. Useful for callers driving setVertices from a caller-managed gpu.DeviceBuffer who want to participate in bounds-driven scene queries (e.g. frustum culling).
inherited
setVertexShader(Shader shader) → void
Assigns the vertex shader used when this geometry is drawn.
inherited
setVertices(BufferView vertices, int vertexCount) → void
Binds an already-uploaded vertex buffer view as this geometry's vertex source.
inherited
toString() String
A string representation of this object.
inherited
updateColors(Float32List colors) → void
Replaces every vertex color, keeping the vertex count unchanged.
inherited
updateForCamera(Camera camera, Size viewportSize) → void
Rebuilds the camera-facing strip for camera and viewportSize.
updateNormals(Float32List normals) → void
Replaces every vertex normal, keeping the vertex count unchanged.
inherited
updatePositions(Float32List positions) → void
Replaces every vertex position, keeping the vertex count unchanged.
inherited
updateTexCoords(Float32List texCoords) → void
Replaces every texture coordinate, keeping the vertex count unchanged.
inherited
uploadVertexData(ByteData vertices, int vertexCount, ByteData? indices, {IndexType indexType = gpu.IndexType.int16}) → void
Allocates a gpu.DeviceBuffer and uploads vertices (and optional indices) into it in one step.
inherited

Operators

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