Clipper
A lightweight component to easily create, delete and handle clipping planes. 📕 Tutorial. 📘 API.
Param
the instance of Components used. E.g. SimplePlane.
Extends
Implements
Createable
Disposable
Hideable
Configurable
<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
list:
SimplePlane
[] =[]
A list of all the clipping planes created by this component.
onAfterCancel
readonly
onAfterCancel:Event
<unknown
>
Event that fires after the user cancels the creation of a clipping plane.
onAfterCreate
readonly
onAfterCreate:Event
<SimplePlane
>
Event that fires after a clipping plane has been created.
Param
The newly created clipping plane.
onAfterDelete
readonly
onAfterDelete:Event
<SimplePlane
>
Event that fires after a clipping plane has been deleted.
Param
The deleted clipping plane.
onAfterDrag
readonly
onAfterDrag:Event
<void
>
Event that fires when the user stops dragging a clipping plane.
onBeforeCancel
readonly
onBeforeCancel:Event
<unknown
>
Event that fires when the user cancels the creation of a clipping plane.
onBeforeCreate
readonly
onBeforeCreate:Event
<unknown
>
Event that fires when the user starts creating a clipping plane.
onBeforeDelete
readonly
onBeforeDelete:Event
<unknown
>
Event that fires when the user starts deleting a clipping plane.
onBeforeDrag
readonly
onBeforeDrag:Event
<void
>
Event that fires when the user starts dragging a clipping plane.
onDisposed
readonly
onDisposed:Event
<string
>
Implementation of
onSetup
readonly
onSetup: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
static
readonly
uuid:"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
get
enabled():boolean
set
enabled(state
):void
Parameters
Parameter | Type |
---|---|
state | boolean |
Returns
boolean
material
get
material():MeshBasicMaterial
The material of the clipping plane representation.
set
material(material
):void
The material of the clipping plane representation.
Parameters
Parameter | Type |
---|---|
material | MeshBasicMaterial |
Returns
MeshBasicMaterial
size
get
size():number
The size of the geometric representation of the clippings planes.
set
size(size
):void
The size of the geometric representation of the clippings planes.
Parameters
Parameter | Type |
---|---|
size | number |
Returns
number
visible
get
visible():boolean
set
visible(state
):void
Parameters
Parameter | Type |
---|---|
state | boolean |
Returns
boolean
Methods
create()
create(
world
):null
|SimplePlane
Parameters
Parameter | Type |
---|---|
world | World |
Returns
null
| SimplePlane
Implementation of
createFromNormalAndCoplanarPoint()
createFromNormalAndCoplanarPoint(
world
,normal
,point
):SimplePlane
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
delete()
delete(
world
,plane
?):void
Parameters
Parameter | Type | Description |
---|---|---|
world | World | the world where the plane to delete is. |
plane ? | SimplePlane | the plane to delete. If undefined, the first plane |
found under the cursor will be deleted. |
Returns
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