Skip to content

Commit ed9f5a1

Browse files
aardgooseaardgooseMugen87
authored
Docs:: Add documentation for ClippingGroup. (mrdoob#29833)
* add docs * move ClippingGroup.js --------- Co-authored-by: aardgoose <[email protected]> Co-authored-by: Michael Herzog <[email protected]>
1 parent e08c3e7 commit ed9f5a1

File tree

5 files changed

+67
-3
lines changed

5 files changed

+67
-3
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<base href="../../../" />
6+
<script src="page.js"></script>
7+
<link type="text/css" rel="stylesheet" href="page.css" />
8+
</head>
9+
<body>
10+
[page:Group] &rarr;
11+
12+
<h1>[name]</h1>
13+
14+
<p class="desc">
15+
A special version of the Group object that defines clipping planes for decendant objects.
16+
ClippingGroups can be nested, with clipping planes accumulating by type: intersection or union.
17+
</p>
18+
19+
<p>Note: ClippingGroup is only supported with WebGPURenderer.</p>
20+
21+
<h2>Constructor</h2>
22+
23+
<h3>[name]( )</h3>
24+
25+
<h2>Properties</h2>
26+
<p>See the base [page:Group] class for common properties.</p>
27+
28+
<h3>[property:Boolean isClippingGroup]</h3>
29+
<p>Read-only flag to check if a given object is of type [name].</p>
30+
31+
<h3>[property:Array clippingPlanes]</h3>
32+
<p>
33+
User-defined clipping planes specified as THREE.Plane objects in world
34+
space. These planes apply to the objects that are children of this ClippingGroup.
35+
Points in space whose signed distance to the plane is negative are clipped
36+
(not rendered). See the [example:webgpu_clipping webgpu / clipping] example. Default is `[]`.
37+
</p>
38+
39+
<h3>[property:Boolean enabled]</h3>
40+
<p>Determines if the clipping planes defined by this object are applied. Default is `true`.</p>
41+
42+
<h3>[property:Boolean clipIntersection]</h3>
43+
<p>
44+
Changes the behavior of clipping planes so that only their intersection is
45+
clipped, rather than their union. Default is `false`.
46+
</p>
47+
48+
<h3>[property:Boolean clipShadows]</h3>
49+
<p>
50+
Defines whether to clip shadows according to the clipping planes specified
51+
by this ClippingGroup. Default is `false`.
52+
</p>
53+
54+
<h2>Methods</h2>
55+
<p>See the base [page:Object3D] class for common methods.</p>
56+
57+
<h2>Source</h2>
58+
<p>
59+
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
60+
</p>
61+
</body>
62+
</html>

docs/list.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@
267267
"Objects": {
268268
"BatchedMesh": "api/en/objects/BatchedMesh",
269269
"Bone": "api/en/objects/Bone",
270+
"ClippingGroup": "api/en/objects/ClippingGroup",
270271
"Group": "api/en/objects/Group",
271272
"InstancedMesh": "api/en/objects/InstancedMesh",
272273
"Line": "api/en/objects/Line",

src/Three.WebGPU.Nodes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ export { default as IESSpotLight } from './lights/webgpu/IESSpotLight.js';
1717
export { default as NodeLoader } from './loaders/nodes/NodeLoader.js';
1818
export { default as NodeObjectLoader } from './loaders/nodes/NodeObjectLoader.js';
1919
export { default as NodeMaterialLoader } from './loaders/nodes/NodeMaterialLoader.js';
20+
export { ClippingGroup } from './objects/ClippingGroup.js';
2021
export * from './nodes/Nodes.js';
2122
export * from './nodes/TSL.js';

src/Three.WebGPU.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ export * from './Three.core.js';
22

33
export * from './materials/nodes/NodeMaterials.js';
44
export { default as WebGPURenderer } from './renderers/webgpu/WebGPURenderer.js';
5-
export { default as ClippingGroup } from './renderers/common/ClippingGroup.js';
65
export { default as Lighting } from './renderers/common/Lighting.js';
76
export { default as BundleGroup } from './renderers/common/BundleGroup.js';
87
export { default as QuadMesh } from './renderers/common/QuadMesh.js';
@@ -18,5 +17,6 @@ export { default as IESSpotLight } from './lights/webgpu/IESSpotLight.js';
1817
export { default as NodeLoader } from './loaders/nodes/NodeLoader.js';
1918
export { default as NodeObjectLoader } from './loaders/nodes/NodeObjectLoader.js';
2019
export { default as NodeMaterialLoader } from './loaders/nodes/NodeMaterialLoader.js';
20+
export { ClippingGroup } from './objects/ClippingGroup.js';
2121
export * from './nodes/Nodes.js';
2222
export * from './nodes/TSL.js';

src/renderers/common/ClippingGroup.js renamed to src/objects/ClippingGroup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Group } from '../../objects/Group.js';
1+
import { Group } from './Group.js';
22

33
class ClippingGroup extends Group {
44

@@ -16,4 +16,4 @@ class ClippingGroup extends Group {
1616

1717
}
1818

19-
export default ClippingGroup;
19+
export { ClippingGroup };

0 commit comments

Comments
 (0)