ClippingPlanesEditor

new IonSdkMeasurements.ClippingPlanesEditor(options)

Creates visual clipping planes and mouse handlers for adjusting the clipping planes added to a Cesium3DTileset, Model or Globe.
Name Type Description
options Object An object with the following properties:
Name Type Default Description
scene Scene The scene.
clippingPlanes ClippingPlaneCollection A clipping plane collection that has been set for a Cesium3DTileset, Model or Globe.
origin Cartesian3 optional The position the visual clipping planes are relative to. If not provided, a position will be computed from the modelMatrix or the primitive bounding sphere.
planeSizeInMeters Cartesian2 optional The width and height of the clipping planes in meters. If not provided, size will be computed based on the primitive bounding sphere radius, or 200.0 for terrain clipping.
movePlanesToOrigin Boolean true optional If true, ClippingPlanesEditor recomputes the plane distance to move the clipping planes to the origin. Otherwise the original plane distance is unaltered.
pixelSize Cartesian2 Cesium.Cartesian2(100, 100) optional The size of the clipping planes in pixels of screen space in each direction. This overrides options.planeSizeInMeters. To disable fixed screen-space size for either the x- or y-direction, set the corresponding component(s) to 0
maximumSizeInMeters Cartesian2 Cesium.Cartesian2(Infinity, Infinity) optional The maximum size of the clipping planes in meters when fixed screen-space size is enabled. To disable this size limit for either the x- or y-direction, set the corresponding component(s) to Infinity
Example:
// Attach 4 clipping planes to a tileset
tileset.clippingPlanes = new IonSdkMeasurements.ClippingPlaneCollection({
 planes : [
   new IonSdkMeasurements.ClippingPlane(new Cesium.Cartesian3(1.0, 0.0, 0.0), 100),
   new IonSdkMeasurements.ClippingPlane(new Cesium.Cartesian3(-1.0, 0.0, 0.0), 100),
   new IonSdkMeasurements.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 100),
   new IonSdkMeasurements.ClippingPlane(new Cesium.Cartesian3(0.0, -1.0, 0.0), 100),
 ],
 unionClippingRegions: true,
 edgeWidth : 1.0
});
// Create and activate the editor to visualize and move the planes.
var clippingPlanesEditor = new IonSdkMeasurements.ClippingPlanesEditor({
 scene: viewer.scene,
 clippingPlanes: tileset.clippingPlanes,
 movePlanesToOrigin: false
});
clippingPlanesEditor.activate();
Demo:

Members

readonly active : Boolean

Gets whether the clipping plane tool is active.

readonly clippingPlanes : ClippingPlaneCollection

Gets the clipping plane collection.

readonly scene : Scene

Gets the scene.

Methods

activate()

Activates mouse handlers.

deactivate()

Deactivates the mouse handlers.

destroy()

Destroys the clipping planes tool.

isDestroyed()Boolean

Returns:
true if the object has been destroyed, false otherwise.

reset()

Resets the clipping planes to their start position.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.