BufferPolyline

open external class BufferPolyline : BufferPrimitive(source)

View bound to the underlying buffer data of a BufferPolylineCollection.

BufferPolyline instances are flyweights: a single BufferPolyline instance can be temporarily bound to any conceptual "polyline" in a BufferPolylineCollection, allowing very large collections to be iterated and updated with a minimal memory footprint.

Represented as two (2) or more positions.

See also

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
external object Companion

Properties

Link copied to clipboard
external var featureId: Int

Feature ID associated with the primitive; not required to be unique.

Link copied to clipboard
external var show: Boolean

Whether primitive is shown.

Link copied to clipboard
external val vertexCount: Double

Count of positions (vertices) in this polyline, number of VEC3 elements.

Functions

Link copied to clipboard
Link copied to clipboard
external fun getPositions(result: TypedArray<*, *, *, *>? = definedExternally)

Returns an array view of this polyline's vertex positions. If 'result' argument is given, vertex positions are written to that array and returned. Otherwise, returns an ArrayView on collection memory — changes to this array will not trigger render updates, which requires .setPositions().

Link copied to clipboard
external fun setMaterial(material: BufferPrimitiveMaterial)
Link copied to clipboard
external fun setPositions(positions: TypedArray<*, *, *, *>)
Link copied to clipboard
open external override fun toJSON(): JsAny

Returns a JSON-serializable object representing the polyline. This encoding is not memory-efficient, and should generally be used for debugging and testing.