ClippingPlanesEditor

SWVL new Cesium.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 Cesium.ClippingPlaneCollection({
 planes : [
   new Cesium.ClippingPlane(new Cesium.Cartesian3(1.0, 0.0, 0.0), 100),
   new Cesium.ClippingPlane(new Cesium.Cartesian3(-1.0, 0.0, 0.0), 100),
   new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 100),
   new Cesium.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 Cesium.ClippingPlanesEditor({
 scene: viewer.scene,
 clippingPlanes: tileset.clippingPlanes,
 movePlanesToOrigin: false
});
clippingPlanesEditor.activate();
Demo:

Members

Gets whether the clipping plane tool is active.
Gets the clipping plane collection.
Gets the scene.

Methods

Activates mouse handlers.
Deactivates the mouse handlers.
Destroys the clipping planes tool.
Returns:
true if the object has been destroyed, false otherwise.
Resets the clipping planes to their start position.