每个实例几何体属性的值和类型信息,用于确定几何体实例是否显示。
| 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
readonly componentDatatype : ComponentDatatype
属性中每个组件的数据类型,例如
ColorGeometryInstanceAttribute#value中的单个元素。
-
Default Value:
ComponentDatatype.UNSIGNED_BYTE
属性中的组件数量,即
ColorGeometryInstanceAttribute#value。
-
Default Value:
1
当
true且componentDatatype为整数格式时,
表示在作为浮点数访问以进行渲染时,组件应映射到范围[0, 1](无符号)
或[-1, 1](有符号)。
-
Default Value:
false
存储在类型化数组中的属性值。
-
Default Value:
[1.0]
Methods
将布尔显示值转换为可用于分配显示属性的类型化数组。
| 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);
