Scene to be highlighted.
A primitive combines geometry instances with an Appearance that describes the full shading, including
Material and RenderState. Roughly, the geometry instance defines the structure and placement,
而外观则定义了视觉特征. 调和几何和外观,让我们可以混合
并匹配其中的大部分,并添加一个新的几何或外观,彼此独立.
Only PerInstanceColorAppearance with the same color across all instances is supported at this time when using
ClassificationPrimitive directly.
For full Appearance support when classifying terrain or 3D Tiles use GroundPrimitive instead.
为了正确渲染,这个特性需要EXT frag 深度 WebGL 扩展. 对于不支持此扩展名的硬件, 这里 将会为某些取景角度制作文物.
有效的几何是 BoxGeometry , CylinderGeometry , EllipsoidGeometry , PolylineVolumeGeometry ,和 SphereGeometry .
沿椭圆形表面的几何,如 CircleGeometry , CorridorGeometry , EllipseGeometry , PolygonGeometry ,和 RectangleGeometry ,
如果它们被挤压成卷,也是有效的;否则它们不会被制成.
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
optional
下列属性的对象 :
|
Members
true, each geometry instance will only be pickable with Scene#pick. When false, GPU memory is saved.
-
Default Value:
true
-
Default Value:
true
classificationType : ClassificationType
-
Default Value:
ClassificationType.BOTH
-
Default Value:
true
绘制原始中每个绘图命令的边框.
-
Default Value:
false
为原始的每个几何绘制阴影音量.
-
Default Value:
false
readonly geometryInstances : Array|GeometryInstance
true when the primitive is constructed.
原始化后改变这个属性没有效果.
由于使用的渲染技术,所有几何实例都必须是相同的颜色.
If there is an instance with a differing color, a DeveloperError will be thrown
第一次尝试.
-
Default Value:
undefined
-
Default Value:
false
ClassificationPrimitive#update
is called.
true, the primitive does not keep a reference to the input geometryInstances to save memory.
-
Default Value:
true
-
Default Value:
true
-
Default Value:
true
Methods
| Name | Type | Description |
|---|---|---|
scene |
Scene | The scene. |
Returns:
true if ClassificationPrimitives are supported; otherwise, returns false
Once an object is destroyed, it should not be used; calling any function other than
isDestroyed will result in a DeveloperError exception. Therefore,
assign the return value (undefined) to the object as done in the example.
Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
e = e && e.destroy();
See:
GeometryInstance.
| Name | Type | Description |
|---|---|---|
id |
* |
The id of the GeometryInstance. |
Returns:
Throws:
-
DeveloperError : must call update before calling getGeometryInstanceAttributes.
Example:
const attributes = primitive.getGeometryInstanceAttributes('an id');
attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
If this object was destroyed, it should not be used; calling any function other than
isDestroyed will result in a DeveloperError exception.
Returns:
true if this object was destroyed; otherwise, false.
Viewer or CesiumWidget render the scene to
获得使这个原始化所需的绘图命令.
不要直接调用此函数 。 记录下来的只是 列出场景拍摄时可能宣传的例外情况:
Throws:
-
DeveloperError : All instance geometries must have the same primitiveType.
-
DeveloperError : Appearance and material have a uniform with the same name.
-
DeveloperError : Not all of the geometry instances have the same color attribute.