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
positionDatatype ComponentDatatype ComponentDatatype.DOUBLE optional
positionNormalized boolean false optional
show boolean true optional
allowPicking boolean false optionaltrue 时,图元可通过 Scene#pick 拾取。当 false 时,内存和初始化开销更低。
boundingVolume BoundingSphere optional 集合在世界空间中的包围盒。当未指定时, 包围盒会自动计算并在图元位置变化时更新。当指定时, 用户需要根据需要自行更新包围盒。手动预计算包围盒, 并仅在需要时更新,将提升大型动态集合的性能。
debugShowBoundingVolume boolean false optional
blendOption BlendOption BlendOption.TRANSLUCENT optional
Example:
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

此功能尚未最终确定,可能会在 Cesium 标准弃用政策之外发生变化。

See:

Extends

Methods

使用指定选项向集合添加新点。一个 BufferPoint 实例会链接到新点, 若提供 'result' 参数则使用该实例,否则创建新实例。对于重复调用, 建议重用单个 BufferPoint 实例,而不是在每次调用时 分配新实例。
Name Type Description
options BufferPointOptions
result BufferPoint
Returns:
需要帮助?获取答案的最快方式是在 Cesium 论坛 上向社区和团队提问。