Class: ClippingTools
Class: ClippingTools
Functions for clipping planes management in scene. See SceneManager.clippingTools property in SceneManager class.
Hierarchy
EventTarget
↳
ClippingTools
Constructors
constructor
• new ClippingTools(sceneManager
): ClippingTools
Parameters
Name | Type | Description |
---|---|---|
sceneManager | SceneManager | SceneManager instance. |
Returns
Overrides
EventTarget.constructor
Properties
capOutlinesColor
• capOutlinesColor: string
Color for generated cap outlines of cropped elements.
capsColor
• capsColor: string
Color for generated cap faces of cropped elements.
scene
• scene: Scene
The scene for storing elements caps.
Methods
addAutoEventListener
▸ addAutoEventListener(eventType
, eventListener
, signal
): void
Add event listener with automatic dispose.
Parameters
Name | Type | Description |
---|---|---|
eventType | Update | event type. |
eventListener | EventListenerOrEventListenerObject | event listener. |
signal | AbortSignal | optional abort signal for manual aborting event listener. |
Returns
void
clearOutlines
▸ clearOutlines(): void
Clear outlines geometry.
Returns
void
deletePlanes
▸ deletePlanes(names
): void
Deletes clipping planes by its names.
Parameters
Name | Type | Description |
---|---|---|
names | string [] | array of plane names. |
Returns
void
dispose
▸ dispose(): void
Destroy clipping planes tool and release all resources.
Returns
void
generateOutlines
▸ generateOutlines(): void
Generates new outlines geometry.
Returns
void
getActivePlanes
▸ getActivePlanes(): Plane
[]
Get only active clipping planes as array of Plane objects.
Returns
Plane
[]
getPlanes
▸ getPlanes(): Plane
[]
Get all clipping planes as array of Plane objects.
Returns
Plane
[]
isElementVisible
▸ isElementVisible(elementData
): boolean
Test scene element visibility by its bounding sphere.
Parameters
Name | Type | Description |
---|---|---|
elementData | ElementData | element data. See SceneManager.elementDatas in SceneManager class. |
Returns
boolean
isInstanceMeshVisible
▸ isInstanceMeshVisible(mesh
, idx
): boolean
Test instance mesh item visibility.
Parameters
Name | Type | Description |
---|---|---|
mesh | InstancedMesh <BufferGeometry <NormalBufferAttributes >, Material | Material [], InstancedMeshEventMap > | instance mesh object. |
idx | number | instance item index. |
Returns
boolean
render
▸ render(renderer
, camera
, generateIntersectionCaps?
): void
render cap faces.
Parameters
Name | Type | Description |
---|---|---|
renderer | WebGLRenderer | web GL renderer instance. |
camera | PerspectiveCamera | OrthographicCamera | perspective camera. |
generateIntersectionCaps? | boolean | is it necessary to generate cap faces at the intersection of volumes. |
Returns
void
renderOutlines
▸ renderOutlines(renderer
, camera
): void
Render generated outlines.
Parameters
Name | Type | Description |
---|---|---|
renderer | WebGLRenderer | current renderer. |
camera | PerspectiveCamera | OrthographicCamera | current camera. |
Returns
void
setPlanes
▸ setPlanes(planes
, isReplace?
): void
Sets clipping planes for scene.
Parameters
Name | Type | Description |
---|---|---|
planes | Map <string , Plane > | Array of clipping planes. |
isReplace? | boolean | Replace current planes set or only add/modify. |
Returns
void
updatePlaneSizes
▸ updatePlaneSizes(bbox
): void
Update clipping plane sizes for new bounding box.
Parameters
Name | Type | Description |
---|---|---|
bbox | Box3 | bounding box. |
Returns
void
updatePlanes
▸ updatePlanes(bbox
): void
Update cap planes size for proper visibility in scene by scene bounding box.
Parameters
Name | Type | Description |
---|---|---|
bbox | Box3 | Scene bounding box. |
Returns
void
updated
▸ updated(): void
Hook when planes has been updated internally or externally.
Returns
void