BufferPointCollection

存储在 ArrayBuffer 中的点集合,用于性能和内存优化。

默认缓冲内存分配是任意的,且集合无法调整大小, 因此在可用时应在集合构造函数中提供特定的每缓冲容量。

new Cesium.BufferPointCollection(options)

Name Type Description
options object
Name Type Default Description
modelMatrix Matrix4 Matrix4.IDENTITY optional 将几何体从模型坐标变换到世界坐标。
primitiveCountMax number BufferPrimitiveCollection.DEFAULT_CAPACITY optional
show boolean true optional
positionDatatype ComponentDatatype ComponentDatatype.DOUBLE optional
allowPicking boolean false optionaltrue 时,图元可使用 Scene#pick 进行拾取。当 false 时,内存和初始化成本更低。
debugShowBoundingVolume boolean false optional
Example:
const collection = new BufferPointCollection({primitiveCountMax: 1024});

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

// 创建新点,临时绑定到 'point' 局部变量。
collection.add({
  position: new Cartesian3(0.0, 0.0, 0.0),
  material
}, point);

// 遍历集合中的所有点,将 'point' 局部变量临时绑定到每个点,
// 并更新点材质。
for (let i = 0; i < collection.primitiveCount; i++) {
  collection.get(i, point);
  point.setMaterial(material);
}
Experimental

此功能尚未最终确定,可能会在不遵循 Cesium 标准弃用政策的情况下进行更改。

See:

Extends

Methods

向集合添加新点,并指定选项。 BufferPoint 实例链接到新点,使用 'result' 参数(如果提供),否则使用新实例。 对于重复调用,建议重用单个 BufferPoint 实例,而不是在每次调用时分配新实例。
Name Type Description
options BufferPointOptions
result BufferPoint
Returns:
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.