ShowGeometryInstanceAttribute

new Cesium.ShowGeometryInstanceAttribute(show)

每个实例几何图形属性的值和类型信息,用于确定是否显示几何图形实例。
Name Type Default Description
show boolean true optional 确定是否显示几何实例。
Example:
const instance = new Cesium.GeometryInstance({
  geometry : new Cesium.BoxGeometry({
    vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
    minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
    maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
  }),
  modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
    Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  id : 'box',
  attributes : {
    show : new Cesium.ShowGeometryInstanceAttribute(false)
  }
});
See:

Members

属性中每个组件的数据类型,例如,其中的单个元素 ColorGeometryInstanceAttribute#value.
Default Value: ComponentDatatype.UNSIGNED_BYTE

readonly componentsPerAttribute : number

属性中的组件数,即 ColorGeometryInstanceAttribute#value
Default Value: 1
truecomponentDatatype 为整数格式时, 表示组件应映射到范围 [0, 1](无符号) 或 [-1, 1](带符号)当它们作为浮点进行访问以进行渲染时。
Default Value: true
存储在类型化数组中的属性的值。
Default Value: [1.0]

Methods

static Cesium.ShowGeometryInstanceAttribute.toValue(show, result)Uint8Array

将布尔值 show 转换为可用于分配 show 属性的类型化数组。
Name Type Description
show boolean 显示值。
result Uint8Array optional 用于存储结果的数组,如果未定义,将创建一个新实例。
Returns:
修改后的结果参数或者如果 result 未定义,则为新实例。
Example:
const attributes = primitive.getGeometryInstanceAttributes('an id');
attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true, attributes.show);
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.