BufferPointCollection

Collection of points held in ArrayBuffer storage for performance and memory optimization.

Default buffer memory allocation is arbitrary, and collections cannot be resized, so specific per-buffer capacities should be provided in the collection constructor when available.

new Cesium.BufferPointCollection(options)

参数名称 类型 描述信息
options object
参数名称 类型 默认值 描述信息
modelMatrix Matrix4 Matrix4.IDENTITY 可选 Transforms geometry from model to world coordinates.
primitiveCountMax number BufferPrimitiveCollection.DEFAULT_CAPACITY 可选
show boolean true 可选
positionDatatype ComponentDatatype ComponentDatatype.DOUBLE 可选
allowPicking boolean false 可选 When true, primitives are pickable with Scene#pick. When false, memory and initialization cost are lower.
debugShowBoundingVolume boolean false 可选
使用示例:
const collection = new BufferPointCollection({primitiveCountMax: 1024});

const point = new BufferPoint();
const material = new BufferPointMaterial({color: Color.WHITE});

// Create a new point, temporarily bound to 'point' local variable.
collection.add({
  position: new Cartesian3(0.0, 0.0, 0.0),
  material
}, point);

// Iterate over all points in collection, temporarily binding 'point'
// local variable to each, and updating point material.
for (let i = 0; i < collection.primitiveCount; i++) {
  collection.get(i, point);
  point.setMaterial(material);
}
Experimental

This feature is not final and is subject to change without Cesium's standard deprecation policy.

参考:

继承

方法

Adds a new point to the collection, with the specified options. A BufferPoint instance is linked to the new point, using the 'result' argument if given, or a new instance if not. For repeated calls, prefer to reuse a single BufferPoint instance rather than allocating a new instance on each call.
参数名称 类型 描述信息
options BufferPointOptions
result BufferPoint
返回值: