ClassificationPrimitive

external class ClassificationPrimitive(options: ClassificationPrimitive.ConstructorOptions? = definedExternally)(source)

A classification primitive represents a volume enclosing geometry in the 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, and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix and match most of them and add a new geometry or appearance independently of each other. 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.

For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there will be rendering artifacts for some viewing angles.

Valid geometries are BoxGeometry, CylinderGeometry, EllipsoidGeometry, PolylineVolumeGeometry, and SphereGeometry.

Geometries that follow the surface of the ellipsoid, such as CircleGeometry, CorridorGeometry, EllipseGeometry, PolygonGeometry, and RectangleGeometry, are also valid if they are extruded volumes; otherwise, they will not be rendered.

See also

Constructors

Link copied to clipboard
constructor(options: ClassificationPrimitive.ConstructorOptions? = definedExternally)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed interface ConstructorOptions

Properties

Link copied to clipboard

When true, each geometry instance will only be pickable with Scene.pick. When false, GPU memory is saved.

Link copied to clipboard

Determines if the geometry instances will be created and batched on a web worker.

Link copied to clipboard

Determines whether terrain, 3D Tiles or both will be classified.

Link copied to clipboard

When true, geometry vertices are compressed, which will save memory.

Link copied to clipboard

This property is for debugging only; it is not for production use nor is it optimized.

Link copied to clipboard

This property is for debugging only; it is not for production use nor is it optimized.

Link copied to clipboard

The geometry instance rendered with this primitive. This may be undefined if options.releaseGeometryInstances is true when the primitive is constructed.

Link copied to clipboard

Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.

Link copied to clipboard

Determines if the primitive is complete and ready to render. If this property is true, the primitive will be rendered the next time that ClassificationPrimitive.update is called.

Link copied to clipboard

When true, the primitive does not keep a reference to the input geometryInstances to save memory.

Link copied to clipboard

Determines if the primitive will be shown. This affects all geometry instances in the primitive.

Link copied to clipboard

When true, geometry vertices are optimized for the pre and post-vertex-shader caches.

Functions

Link copied to clipboard
fun destroy()

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.

Link copied to clipboard

Returns the modifiable per-instance attributes for a GeometryInstance.

Link copied to clipboard

Returns true if this object was destroyed; otherwise, false.

Link copied to clipboard
fun update()

Called when Viewer or CesiumWidget render the scene to get the draw commands needed to render this primitive.