PointPrimitiveCollection

A renderable collection of points.

Points are added and removed from the collection using PointPrimitiveCollection.add and PointPrimitiveCollection.remove.

// Create a pointPrimitive collection with two points
const points = scene.primitives.add(new PointPrimitiveCollection());
points.add({
position : new Cartesian3(1.0, 2.0, 3.0),
color : Color.YELLOW
});
points.add({
position : new Cartesian3(4.0, 5.0, 6.0),
color : Color.CYAN
});

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The point blending option. The default is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent, setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.

Link copied to clipboard

This property is for debugging only; it is not for production use nor is it optimized.

Link copied to clipboard
var length: Int

Returns the number of points in this collection. This is commonly used with PointPrimitiveCollection.get to iterate over all the points in the collection.

Link copied to clipboard

The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates. When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates. Local reference frames can be used by providing a different transformation matrix, like that returned by Transforms.eastNorthUpToFixedFrame.

Link copied to clipboard

Determines if primitives in this collection will be shown.

Functions

Link copied to clipboard
fun add(options: Any? = definedExternally): PointPrimitive

Creates and adds a point with the specified initial properties to the collection. The added point is returned so it can be modified or removed from the collection later.

Link copied to clipboard
fun contains(pointPrimitive: PointPrimitive? = definedExternally): Boolean

Check whether this collection contains a given point.

Link copied to clipboard
fun destroy()

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.

Link copied to clipboard
operator fun get(index: Int): PointPrimitive

Returns the point in the collection at the specified index. Indices are zero-based and increase as points are added. Removing a point shifts all points after it to the left, changing their indices. This function is commonly used with PointPrimitiveCollection.length to iterate over all the points in the collection.

Link copied to clipboard

Returns true if this object was destroyed; otherwise, false.

Link copied to clipboard
fun remove(pointPrimitive: PointPrimitive): Boolean

Removes a point from the collection.

Link copied to clipboard
fun removeAll()

Removes all points from the collection.