Skip to content

Commit

Permalink
Docs:: Add documentation for ClippingGroup. (mrdoob#29833)
Browse files Browse the repository at this point in the history
* add docs

* move ClippingGroup.js

---------

Co-authored-by: aardgoose <angus.sawyer@email.com>
Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
  • Loading branch information
3 people authored Nov 12, 2024
1 parent e08c3e7 commit ed9f5a1
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 3 deletions.
62 changes: 62 additions & 0 deletions docs/api/en/objects/ClippingGroup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Group] &rarr;

<h1>[name]</h1>

<p class="desc">
A special version of the Group object that defines clipping planes for decendant objects.
ClippingGroups can be nested, with clipping planes accumulating by type: intersection or union.
</p>

<p>Note: ClippingGroup is only supported with WebGPURenderer.</p>

<h2>Constructor</h2>

<h3>[name]( )</h3>

<h2>Properties</h2>
<p>See the base [page:Group] class for common properties.</p>

<h3>[property:Boolean isClippingGroup]</h3>
<p>Read-only flag to check if a given object is of type [name].</p>

<h3>[property:Array clippingPlanes]</h3>
<p>
User-defined clipping planes specified as THREE.Plane objects in world
space. These planes apply to the objects that are children of this ClippingGroup.
Points in space whose signed distance to the plane is negative are clipped
(not rendered). See the [example:webgpu_clipping webgpu / clipping] example. Default is `[]`.
</p>

<h3>[property:Boolean enabled]</h3>
<p>Determines if the clipping planes defined by this object are applied. Default is `true`.</p>

<h3>[property:Boolean clipIntersection]</h3>
<p>
Changes the behavior of clipping planes so that only their intersection is
clipped, rather than their union. Default is `false`.
</p>

<h3>[property:Boolean clipShadows]</h3>
<p>
Defines whether to clip shadows according to the clipping planes specified
by this ClippingGroup. Default is `false`.
</p>

<h2>Methods</h2>
<p>See the base [page:Object3D] class for common methods.</p>

<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>
1 change: 1 addition & 0 deletions docs/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
"Objects": {
"BatchedMesh": "api/en/objects/BatchedMesh",
"Bone": "api/en/objects/Bone",
"ClippingGroup": "api/en/objects/ClippingGroup",
"Group": "api/en/objects/Group",
"InstancedMesh": "api/en/objects/InstancedMesh",
"Line": "api/en/objects/Line",
Expand Down
1 change: 1 addition & 0 deletions src/Three.WebGPU.Nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ export { default as IESSpotLight } from './lights/webgpu/IESSpotLight.js';
export { default as NodeLoader } from './loaders/nodes/NodeLoader.js';
export { default as NodeObjectLoader } from './loaders/nodes/NodeObjectLoader.js';
export { default as NodeMaterialLoader } from './loaders/nodes/NodeMaterialLoader.js';
export { ClippingGroup } from './objects/ClippingGroup.js';
export * from './nodes/Nodes.js';
export * from './nodes/TSL.js';
2 changes: 1 addition & 1 deletion src/Three.WebGPU.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export * from './Three.core.js';

export * from './materials/nodes/NodeMaterials.js';
export { default as WebGPURenderer } from './renderers/webgpu/WebGPURenderer.js';
export { default as ClippingGroup } from './renderers/common/ClippingGroup.js';
export { default as Lighting } from './renderers/common/Lighting.js';
export { default as BundleGroup } from './renderers/common/BundleGroup.js';
export { default as QuadMesh } from './renderers/common/QuadMesh.js';
Expand All @@ -18,5 +17,6 @@ export { default as IESSpotLight } from './lights/webgpu/IESSpotLight.js';
export { default as NodeLoader } from './loaders/nodes/NodeLoader.js';
export { default as NodeObjectLoader } from './loaders/nodes/NodeObjectLoader.js';
export { default as NodeMaterialLoader } from './loaders/nodes/NodeMaterialLoader.js';
export { ClippingGroup } from './objects/ClippingGroup.js';
export * from './nodes/Nodes.js';
export * from './nodes/TSL.js';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Group } from '../../objects/Group.js';
import { Group } from './Group.js';

class ClippingGroup extends Group {

Expand All @@ -16,4 +16,4 @@ class ClippingGroup extends Group {

}

export default ClippingGroup;
export { ClippingGroup };

0 comments on commit ed9f5a1

Please sign in to comment.