Explorar el Código

Docs:: Add documentation for `ClippingGroup`. (#29833)

* add docs

* move ClippingGroup.js

---------

Co-authored-by: aardgoose <angus.sawyer@email.com>
Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
aardgoose hace 1 año
padre
commit
ed9f5a1977

+ 62 - 0
docs/api/en/objects/ClippingGroup.html

@@ -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 - 0
docs/list.json

@@ -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",

+ 1 - 0
src/Three.WebGPU.Nodes.js

@@ -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';

+ 1 - 1
src/Three.WebGPU.js

@@ -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';
@@ -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';

+ 2 - 2
src/renderers/common/ClippingGroup.js → src/objects/ClippingGroup.js

@@ -1,4 +1,4 @@
-import { Group } from '../../objects/Group.js';
+import { Group } from './Group.js';
 
 class ClippingGroup extends Group {
 
@@ -16,4 +16,4 @@ class ClippingGroup extends Group {
 
 }
 
-export default ClippingGroup;
+export { ClippingGroup };

粤ICP备19079148号