Clipper
A lightweight component to easily create, delete and handle clipping planes. 📕 Tutorial. 📘 API.
Extends
Implements
CreateableDisposableHideableConfigurable<ClipperConfigManager,ClipperConfig>
Properties
Type()
Type: (...
args) =>SimplePlane=SimplePlane
The type of clipping plane to be created. Default is SimplePlane.
Parameters
| Parameter | Type |
|---|---|
...args | any |
Returns
config
config:
ClipperConfigManager
Implementation of
isSetup
isSetup:
boolean=false
Implementation of
list
readonlylist:DataMap<string,SimplePlane>
A list of all the clipping planes created by this component.
onAfterCancel
readonlyonAfterCancel:Event<unknown>
Event that fires after the user cancels the creation of a clipping plane.
onAfterCreate
readonlyonAfterCreate:Event<SimplePlane>
Event that fires after a clipping plane has been created.
Param
The newly created clipping plane.
onAfterDelete
readonlyonAfterDelete:Event<SimplePlane>
Event that fires after a clipping plane has been deleted.
Param
The deleted clipping plane.
onAfterDrag
readonlyonAfterDrag:Event<void>
Event that fires when the user stops dragging a clipping plane.
onBeforeCancel
readonlyonBeforeCancel:Event<unknown>
Event that fires when the user cancels the creation of a clipping plane.
onBeforeCreate
readonlyonBeforeCreate:Event<unknown>
Event that fires when the user starts creating a clipping plane.
onBeforeDelete
readonlyonBeforeDelete:Event<unknown>
Event that fires when the user starts deleting a clipping plane.
onBeforeDrag
readonlyonBeforeDrag:Event<void>
Event that fires when the user starts dragging a clipping plane.
onDisposed
readonlyonDisposed:Event<string>
Implementation of
onSetup
readonlyonSetup:Event<unknown>
Implementation of
orthogonalY
orthogonalY:
boolean=false
Whether to force the clipping plane to be orthogonal in the Y direction (up). This is desirable when clipping a building horizontally and a clipping plane is created in its roof, which might have a slight slope for draining purposes.
toleranceOrthogonalY
toleranceOrthogonalY:
number=0.7
The tolerance that determines whether an almost-horizontal clipping plane
will be forced to be orthogonal to the Y direction. orthogonalY
has to be true for this to apply.
uuid
staticreadonlyuuid:"66290bc5-18c4-4cd1-9379-2e17a0617611"
A unique identifier for the component. This UUID is used to register the component within the Components system.
Accessors
enabled
getenabled():boolean
setenabled(state):void
Parameters
| Parameter | Type |
|---|---|
state | boolean |
Returns
boolean
material
getmaterial():MeshBasicMaterial
The material of the clipping plane representation.
setmaterial(material):void
The material of the clipping plane representation.
Parameters
| Parameter | Type |
|---|---|
material | MeshBasicMaterial |
Returns
MeshBasicMaterial
size
getsize():number
The size of the geometric representation of the clippings planes.
setsize(size):void
The size of the geometric representation of the clippings planes.
Parameters
| Parameter | Type |
|---|---|
size | number |
Returns
number
visible
getvisible():boolean
setvisible(state):void
Parameters
| Parameter | Type |
|---|---|
state | boolean |
Returns
boolean
Methods
create()
create(
world):Promise<null|SimplePlane>
Parameters
| Parameter | Type |
|---|---|
world | World |
Returns
Promise<null | SimplePlane>
Implementation of
createFromNormalAndCoplanarPoint()
createFromNormalAndCoplanarPoint(
world,normal,point):string
Creates a plane in a certain place and with a certain orientation, without the need of the mouse.
Parameters
| Parameter | Type | Description |
|---|---|---|
world | World | the world where this plane should be created. |
normal | Vector3 | the orientation of the clipping plane. |
point | Vector3 | the position of the clipping plane. |
| navigation. |
Returns
string
delete()
delete(
world,planeId?):Promise<void>
Parameters
| Parameter | Type | Description |
|---|---|---|
world | World | the world where the plane to delete is. |
planeId? | string | the plane to delete. If undefined, the first plane |
| found under the cursor will be deleted. |
Returns
Promise<void>
Implementation of
deleteAll()
deleteAll(
types?):void
Deletes all the existing clipping planes.
Parameters
| Parameter | Type | Description |
|---|---|---|
types? | Set<string> | the types of planes to be deleted. If not provided, all planes will be deleted. |
Returns
void
dispose()
dispose():
void
Returns
void
Implementation of
isConfigurable()
isConfigurable():
this is Configurable<any, any>
Whether is component is Configurable.
Returns
this is Configurable<any, any>
Inherited from
isDisposeable()
isDisposeable():
this is Disposable
Whether is component is Disposable.
Returns
this is Disposable
Inherited from
isHideable()
isHideable():
this is Hideable
Whether is component is Hideable.
Returns
this is Hideable
Inherited from
isResizeable()
isResizeable():
this is Resizeable
Whether is component is Resizeable.
Returns
this is Resizeable
Inherited from
isUpdateable()
isUpdateable():
this is Updateable
Whether is component is Updateable.
Returns
this is Updateable
Inherited from
setup()
setup(
config?):void
Parameters
| Parameter | Type |
|---|---|
config? | Partial<ClipperConfig> |
Returns
void