Specifies a set of clipping planes. Clipping planes selectively disable rendering in a region on the
outside of the specified list of
ClippingPlane
objects for a single gltf model, 3D Tileset, or the globe.
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
optional
Object with the following properties:
|
Members
edgeColor : Color
The color applied to highlight the edge along which an object is clipped.
-
Default Value:
Color.WHITE
The width, in pixels, of the highlight applied to the edge along which an object is clipped.
-
Default Value:
0.0
If true, clipping will be enabled.
-
Default Value:
true
Returns the number of planes in this collection. This is commonly used with
ClippingPlaneCollection#get
to iterate over all the planes
in the collection.
modelMatrix : Matrix4
The 4x4 transformation matrix specifying an additional transform relative to the clipping planes
original coordinate system.
-
Default Value:
Matrix4.IDENTITY
If true, a region will be clipped if included in any plane in the collection. Otherwise, the region
to be clipped must intersect the regions defined by all planes in this collection.
-
Default Value:
false
Methods
Adds the specified
ClippingPlane
to the collection to be used to selectively disable rendering
on the outside of each plane. Use ClippingPlaneCollection#unionClippingRegions
to modify
how modify the clipping behavior of multiple planes.
Name | Type | Description |
---|---|---|
plane |
ClippingPlane | The ClippingPlane to add to the collection. |
See:
clone(result) → ClippingPlaneCollection
Duplicates this ClippingPlaneCollection instance.
Name | Type | Description |
---|---|---|
result |
ClippingPlaneCollection | optional The object onto which to store the result. |
Returns:
The modified result parameter or a new ClippingPlaneCollection instance if one was not provided.
Checks whether this collection contains a ClippingPlane equal to the given ClippingPlane.
Name | Type | Description |
---|---|---|
clippingPlane |
ClippingPlane | optional The ClippingPlane to check for. |
Returns:
true if this collection contains the ClippingPlane, false otherwise.
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.
Once an object is destroyed, it should not be used; calling any function other than
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:
clippingPlanes = clippingPlanes && clippingPlanes .destroy();
See:
get(index) → ClippingPlane
Returns the plane in the collection at the specified index. Indices are zero-based
and increase as planes are added. Removing a plane shifts all planes after
it to the left, changing their indices. This function is commonly used with
ClippingPlaneCollection#length
to iterate over all the planes
in the collection.
Name | Type | Description |
---|---|---|
index |
Number | The zero-based index of the plane. |
Returns:
The ClippingPlane at the specified index.
Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other than
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
.
Removes the first occurrence of the given ClippingPlane from the collection.
Name | Type | Description |
---|---|---|
clippingPlane |
ClippingPlane |
Returns:
true
if the plane was removed; false
if the plane was not found in the collection.
Removes all planes from the collection.
Called when
Viewer
or CesiumWidget
render the scene to
build the resources for clipping planes.
Do not call this function directly.