用于確定是否顯示幾何體實例的每個實例幾何體屬性的值和類型信息。
new ShowGeometryInstanceAttribute(show)
Parameters:
show
(Boolean)
(default true
)
確定是否顯示幾何體實例。
Example
var instance = new bmgl.GeometryInstance({
geometry : new bmgl.BoxGeometry({
vertexFormat : bmgl.VertexFormat.POSITION_AND_NORMAL,
minimum : new bmgl.Cartesian3(-250000.0, -250000.0, -250000.0),
maximum : new bmgl.Cartesian3(250000.0, 250000.0, 250000.0)
}),
modelMatrix : bmgl.Matrix4.multiplyByTranslation(bmgl.Transforms.eastNorthUpToFixedFrame(
bmgl.Cartesian3.fromDegrees(-75.59777, 40.03883)), new bmgl.Cartesian3(0.0, 0.0, 1000000.0), new bmgl.Matrix4()),
id : 'box',
attributes : {
show : new bmgl.ShowGeometryInstanceAttribute(false)
}
});
Members
(readonly) componentDatatype : ComponentDatatype
屬性中每個組件的數(shù)據(jù)類型,例如
ColorGeometryInstanceAttribute#value
中的單個元素。
-
Default Value:
ComponentDatatype.UNSIGNED_BYTE
(readonly) componentsPerAttribute : Number
屬性中的組件數(shù),即
ColorGeometryInstanceAttribute#value
。
-
Default Value:
1
(readonly) normalize : Boolean
當(dāng)
true
和componentDatatype
為整數(shù)格式時,表示當(dāng)組件作為浮點進行渲染訪問時,應(yīng)將它們映射到范圍[0,1](無符號)或[-1,1](有符號)中。
-
Default Value:
true
value : Uint8Array
存儲在類型化數(shù)組中的屬性值。
-
Default Value:
[1.0]
Methods
(static) toValue(show, result) → {Uint8Array}
將布爾顯示轉(zhuǎn)換為可用于分配顯示屬性的類型化數(shù)組。
Parameters:
show
(Boolean)
顯示值。
result
(Uint8Array)
存儲結(jié)果的數(shù)組,如果未定義,將創(chuàng)建一個新實例。
Example
var attributes = primitive.getGeometryInstanceAttributes('an id');
attributes.show = bmgl.ShowGeometryInstanceAttribute.toValue(true, attributes.show);