-
-
Notifications
You must be signed in to change notification settings - Fork 35.7k
/
Copy pathClippingGroup.js
68 lines (57 loc) · 1.3 KB
/
ClippingGroup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { Group } from './Group.js';
/**
* In earlier three.js versions, clipping was defined globally
* on the renderer or on material level. This special version of
* `THREE.Group` allows to encode the clipping state into the scene
* graph. Meaning if you create an instance of this group, all
* descendant 3D objects will be affected by the respective clipping
* planes.
*
* Note: `ClippingGroup` can only be used with `WebGPURenderer`.
*
* @augments Group
*/
class ClippingGroup extends Group {
/**
* Constructs a new clipping group.
*/
constructor() {
super();
/**
* This flag can be used for type testing.
*
* @type {boolean}
* @readonly
* @default true
*/
this.isClippingGroup = true;
/**
* An array with clipping planes.
*
* @type {Array<Plane>}
*/
this.clippingPlanes = [];
/**
* Whether clipping should be enabled or not.
*
* @type {boolean}
* @default true
*/
this.enabled = true;
/**
* Whether the intersection of the clipping planes is used to clip objects, rather than their union.
*
* @type {boolean}
* @default false
*/
this.clipIntersection = false;
/**
* Whether shadows should be clipped or not.
*
* @type {boolean}
* @default false
*/
this.clipShadows = false;
}
}
export { ClippingGroup };