@types/three 0.150.2 → 0.151.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- three/README.md +1 -1
- three/examples/jsm/controls/MapControls.d.ts +21 -0
- three/examples/jsm/controls/OrbitControls.d.ts +1 -5
- three/examples/jsm/controls/PointerLockControls.d.ts +3 -0
- three/examples/jsm/controls/TrackballControls.d.ts +2 -0
- three/examples/jsm/helpers/ViewHelper.d.ts +3 -4
- three/examples/jsm/loaders/GLTFLoader.d.ts +2 -4
- three/examples/jsm/loaders/SVGLoader.d.ts +15 -3
- three/examples/jsm/nodes/Nodes.d.ts +130 -226
- three/examples/jsm/nodes/{core → code}/CodeNode.d.ts +2 -3
- three/examples/jsm/nodes/{core → code}/ExpressionNode.d.ts +2 -2
- three/examples/jsm/nodes/{core → code}/FunctionCallNode.d.ts +2 -2
- three/examples/jsm/nodes/{core → code}/FunctionNode.d.ts +4 -4
- three/examples/jsm/nodes/core/InputNode.d.ts +4 -0
- three/examples/jsm/nodes/core/NodeBuilder.d.ts +1 -3
- three/examples/jsm/nodes/core/NodeUtils.d.ts +8 -2
- three/examples/jsm/nodes/core/{VaryNode.d.ts → VaryingNode.d.ts} +1 -1
- three/examples/jsm/nodes/fog/FogNode.d.ts +1 -1
- three/examples/jsm/nodes/geometry/RangeNode.d.ts +2 -1
- three/examples/jsm/nodes/lighting/PointLightNode.d.ts +10 -0
- three/examples/jsm/nodes/lighting/SpotLightNode.d.ts +15 -0
- three/examples/jsm/nodes/math/MathNode.d.ts +2 -2
- three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +2 -2
- three/examples/jsm/objects/{GroundProjectedEnv.d.ts → GroundProjectedSkybox.d.ts} +1 -1
- three/examples/jsm/postprocessing/Pass.d.ts +2 -0
- three/examples/jsm/renderers/CSS2DRenderer.d.ts +2 -1
- three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +0 -1
- three/examples/jsm/utils/BufferGeometryUtils.d.ts +12 -2
- three/index.d.ts +1 -1
- three/package.json +2 -2
- three/src/Three.d.ts +1 -0
- three/src/core/Raycaster.d.ts +1 -0
- three/src/extras/DataUtils.d.ts +13 -0
- three/src/extras/Earcut.d.ts +12 -0
- three/src/extras/ImageUtils.d.ts +20 -20
- three/src/extras/PMREMGenerator.d.ts +66 -0
- three/src/extras/ShapeUtils.d.ts +19 -1
- three/src/extras/core/Curve.d.ts +86 -31
- three/src/extras/core/CurvePath.d.ts +46 -4
- three/src/extras/core/Interpolations.d.ts +36 -0
- three/src/extras/core/Path.d.ts +122 -15
- three/src/extras/core/Shape.d.ts +56 -6
- three/src/extras/core/ShapePath.d.ts +73 -8
- three/src/extras/curves/ArcCurve.d.ts +35 -3
- three/src/extras/curves/CatmullRomCurve3.d.ts +62 -15
- three/src/extras/curves/CubicBezierCurve.d.ts +48 -7
- three/src/extras/curves/CubicBezierCurve3.d.ts +48 -7
- three/src/extras/curves/EllipseCurve.d.ts +73 -18
- three/src/extras/curves/LineCurve.d.ts +26 -5
- three/src/extras/curves/LineCurve3.d.ts +26 -5
- three/src/extras/curves/QuadraticBezierCurve.d.ts +44 -6
- three/src/extras/curves/QuadraticBezierCurve3.d.ts +44 -6
- three/src/extras/curves/SplineCurve.d.ts +39 -3
- three/src/helpers/ArrowHelper.d.ts +47 -16
- three/src/helpers/AxesHelper.d.ts +35 -3
- three/src/helpers/Box3Helper.d.ts +28 -4
- three/src/helpers/BoxHelper.d.ts +44 -4
- three/src/helpers/CameraHelper.d.ts +38 -19
- three/src/helpers/DirectionalLightHelper.d.ts +57 -10
- three/src/helpers/GridHelper.d.ts +32 -6
- three/src/helpers/HemisphereLightHelper.d.ts +56 -3
- three/src/helpers/PlaneHelper.d.ts +31 -8
- three/src/helpers/PointLightHelper.d.ts +54 -6
- three/src/helpers/PolarGridHelper.d.ts +35 -8
- three/src/helpers/SkeletonHelper.d.ts +56 -8
- three/src/helpers/SpotLightHelper.d.ts +59 -4
- three/src/lights/AmbientLight.d.ts +23 -10
- three/src/lights/AmbientLightProbe.d.ts +18 -0
- three/src/lights/DirectionalLight.d.ts +75 -20
- three/src/lights/DirectionalLightShadow.d.ts +68 -2
- three/src/lights/HemisphereLight.d.ts +45 -12
- three/src/lights/HemisphereLightProbe.d.ts +19 -0
- three/src/lights/Light.d.ts +40 -43
- three/src/lights/LightProbe.d.ts +32 -5
- three/src/lights/LightShadow.d.ts +100 -18
- three/src/lights/PointLight.d.ts +57 -12
- three/src/lights/PointLightShadow.d.ts +18 -2
- three/src/lights/RectAreaLight.d.ts +60 -8
- three/src/lights/SpotLight.d.ts +105 -20
- three/src/lights/SpotLightShadow.d.ts +63 -3
- three/src/materials/LineBasicMaterial.d.ts +7 -1
- three/src/materials/MeshDistanceMaterial.d.ts +0 -15
- three/src/math/Color.d.ts +23 -2
- three/src/math/Quaternion.d.ts +6 -0
- three/src/math/Triangle.d.ts +40 -0
- three/src/math/Vector2.d.ts +5 -0
- three/src/math/Vector3.d.ts +10 -3
- three/src/objects/InstancedMesh.d.ts +22 -30
- three/src/objects/LineSegments.d.ts +2 -0
- three/src/objects/Skeleton.d.ts +5 -1
- three/src/objects/SkinnedMesh.d.ts +37 -25
- three/src/renderers/WebGLRenderer.d.ts +16 -0
- three/src/renderers/shaders/ShaderChunk.d.ts +58 -37
- three/src/renderers/shaders/UniformsLib.d.ts +88 -57
- three/src/textures/Texture.d.ts +5 -22
- three/examples/jsm/nodes/lighting/PunctualLightNode.d.ts +0 -12
|
@@ -1,31 +1,72 @@
|
|
|
1
1
|
import { Vector3 } from './../../math/Vector3';
|
|
2
2
|
import { Curve } from './../core/Curve';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Create a smooth **3D** {@link http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:Bezier_curve.svg | cubic bezier curve},
|
|
6
|
+
* defined by a start point, endpoint and two control points.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const curve = new THREE.CubicBezierCurve(
|
|
10
|
+
* new THREE.Vector2(-10, 0),
|
|
11
|
+
* new THREE.Vector2(-5, 15),
|
|
12
|
+
* new THREE.Vector2(20, 15),
|
|
13
|
+
* new THREE.Vector2(10, 0));
|
|
14
|
+
* const points = curve.getPoints(50);
|
|
15
|
+
* const geometry = new THREE.BufferGeometry().setFromPoints(points);
|
|
16
|
+
* const material = new THREE.LineBasicMaterial({
|
|
17
|
+
* color: 0xff0000
|
|
18
|
+
* });
|
|
19
|
+
* // Create the final object to add to the scene
|
|
20
|
+
* const curveObject = new THREE.Line(geometry, material);
|
|
21
|
+
* ```
|
|
22
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/extras/curves/CubicBezierCurve | Official Documentation}
|
|
23
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/curves/CubicBezierCurve.js | Source}
|
|
24
|
+
*/
|
|
4
25
|
export class CubicBezierCurve3 extends Curve<Vector3> {
|
|
5
|
-
|
|
26
|
+
/**
|
|
27
|
+
* This constructor creates a new {@link CubicBezierCurve3}.
|
|
28
|
+
* @param v0 The starting point. Default is `new THREE.Vector3()`.
|
|
29
|
+
* @param v1 The first control point. Default is `new THREE.Vector3()`.
|
|
30
|
+
* @param v2 The second control point. Default is `new THREE.Vector3()`.
|
|
31
|
+
* @param v3 The ending point. Default is `new THREE.Vector3()`.
|
|
32
|
+
*/
|
|
33
|
+
constructor(v0?: Vector3, v1?: Vector3, v2?: Vector3, v3?: Vector3);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Read-only flag to check if a given object is of type {@link CubicBezierCurve3}.
|
|
37
|
+
* @remarks This is a _constant_ value
|
|
38
|
+
* @defaultValue `true`
|
|
39
|
+
*/
|
|
40
|
+
readonly isCubicBezierCurve3 = true;
|
|
6
41
|
|
|
7
42
|
/**
|
|
8
|
-
*
|
|
43
|
+
* A Read-only _string_ to check if `this` object type.
|
|
44
|
+
* @remarks Sub-classes will update this value.
|
|
45
|
+
* @defaultValue `CubicBezierCurve3`
|
|
9
46
|
*/
|
|
10
|
-
type: string;
|
|
47
|
+
override readonly type: string | 'CubicBezierCurve3';
|
|
11
48
|
|
|
12
49
|
/**
|
|
13
|
-
*
|
|
50
|
+
* The starting point.
|
|
51
|
+
* @defaultValue `new THREE.Vector3()`.
|
|
14
52
|
*/
|
|
15
53
|
v0: Vector3;
|
|
16
54
|
|
|
17
55
|
/**
|
|
18
|
-
*
|
|
56
|
+
* The first control point.
|
|
57
|
+
* @defaultValue `new THREE.Vector3()`.
|
|
19
58
|
*/
|
|
20
59
|
v1: Vector3;
|
|
21
60
|
|
|
22
61
|
/**
|
|
23
|
-
*
|
|
62
|
+
* The second control point.
|
|
63
|
+
* @defaultValue `new THREE.Vector3()`.
|
|
24
64
|
*/
|
|
25
65
|
v2: Vector3;
|
|
26
66
|
|
|
27
67
|
/**
|
|
28
|
-
*
|
|
68
|
+
* The ending point.
|
|
69
|
+
* @defaultValue `new THREE.Vector3()`.
|
|
29
70
|
*/
|
|
30
71
|
v3: Vector3;
|
|
31
72
|
}
|
|
@@ -1,60 +1,115 @@
|
|
|
1
1
|
import { Curve } from './../core/Curve';
|
|
2
2
|
import { Vector2 } from '../../math/Vector2';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Creates a 2d curve in the shape of an ellipse
|
|
6
|
+
* @remarks
|
|
7
|
+
* Setting the {@link xRadius} equal to the {@link yRadius} will result in a circle.
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const curve = new THREE.EllipseCurve(
|
|
11
|
+
* 0, 0, // ax, aY
|
|
12
|
+
* 10, 10, // xRadius, yRadius
|
|
13
|
+
* 0, 2 * Math.PI, // aStartAngle, aEndAngle
|
|
14
|
+
* false, // aClockwise
|
|
15
|
+
* 0 // aRotation
|
|
16
|
+
* );
|
|
17
|
+
* const points = curve.getPoints(50);
|
|
18
|
+
* const geometry = new THREE.BufferGeometry().setFromPoints(points);
|
|
19
|
+
* const material = new THREE.LineBasicMaterial({ color: 0xff0000 });
|
|
20
|
+
* // Create the final object to add to the scene
|
|
21
|
+
* const ellipse = new THREE.Line(geometry, material);
|
|
22
|
+
* ```
|
|
23
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/extras/curves/EllipseCurve | Official Documentation}
|
|
24
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/curves/EllipseCurve.js | Source}
|
|
25
|
+
*/
|
|
4
26
|
export class EllipseCurve extends Curve<Vector2> {
|
|
27
|
+
/**
|
|
28
|
+
* This constructor creates a new {@link EllipseCurve}.
|
|
29
|
+
* @param aX The X center of the ellipse. Expects a `Float`. Default is `0`.
|
|
30
|
+
* @param aY The Y center of the ellipse. Expects a `Float`. Default is `0`.
|
|
31
|
+
* @param xRadius The radius of the ellipse in the x direction. Expects a `Float`. Default is `1`.
|
|
32
|
+
* @param yRadius The radius of the ellipse in the y direction. Expects a `Float`. Default is `1`.
|
|
33
|
+
* @param aStartAngle The start angle of the curve in radians starting from the positive X axis. Default is `0`.
|
|
34
|
+
* @param aEndAngle The end angle of the curve in radians starting from the positive X axis. Default is `2 x Math.PI`.
|
|
35
|
+
* @param aClockwise Whether the ellipse is drawn clockwise. Default is `false`.
|
|
36
|
+
* @param aRotation The rotation angle of the ellipse in radians, counterclockwise from the positive X axis. Default is `0`.
|
|
37
|
+
*/
|
|
5
38
|
constructor(
|
|
6
|
-
aX
|
|
7
|
-
aY
|
|
8
|
-
xRadius
|
|
9
|
-
yRadius
|
|
10
|
-
aStartAngle
|
|
11
|
-
aEndAngle
|
|
12
|
-
aClockwise
|
|
13
|
-
aRotation
|
|
39
|
+
aX?: number,
|
|
40
|
+
aY?: number,
|
|
41
|
+
xRadius?: number,
|
|
42
|
+
yRadius?: number,
|
|
43
|
+
aStartAngle?: number,
|
|
44
|
+
aEndAngle?: number,
|
|
45
|
+
aClockwise?: boolean,
|
|
46
|
+
aRotation?: number,
|
|
14
47
|
);
|
|
15
48
|
|
|
16
49
|
/**
|
|
17
|
-
* @
|
|
50
|
+
* Read-only flag to check if a given object is of type {@link EllipseCurve}.
|
|
51
|
+
* @remarks This is a _constant_ value
|
|
52
|
+
* @defaultValue `true`
|
|
53
|
+
*/
|
|
54
|
+
readonly isEllipseCurve = true;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A Read-only _string_ to check if `this` object type.
|
|
58
|
+
* @remarks Sub-classes will update this value.
|
|
59
|
+
* @defaultValue `EllipseCurve`
|
|
18
60
|
*/
|
|
19
|
-
type: string;
|
|
61
|
+
override readonly type: string | 'EllipseCurve';
|
|
20
62
|
|
|
21
63
|
/**
|
|
22
|
-
*
|
|
64
|
+
* The X center of the ellipse.
|
|
65
|
+
* @remarks Expects a `Float`
|
|
66
|
+
* @defaultValue `0`
|
|
23
67
|
*/
|
|
24
68
|
aX: number;
|
|
25
69
|
|
|
26
70
|
/**
|
|
27
|
-
*
|
|
71
|
+
* The Y center of the ellipse.
|
|
72
|
+
* @remarks Expects a `Float`
|
|
73
|
+
* @defaultValue `0`
|
|
28
74
|
*/
|
|
29
75
|
aY: number;
|
|
30
76
|
|
|
31
77
|
/**
|
|
32
|
-
*
|
|
78
|
+
* The radius of the ellipse in the x direction.
|
|
79
|
+
* @defaultValue `1`
|
|
33
80
|
*/
|
|
34
81
|
xRadius: number;
|
|
35
82
|
|
|
36
83
|
/**
|
|
37
|
-
*
|
|
84
|
+
* The radius of the ellipse in the y direction.
|
|
85
|
+
* @defaultValue `1`
|
|
38
86
|
*/
|
|
39
87
|
yRadius: number;
|
|
40
88
|
|
|
41
89
|
/**
|
|
42
|
-
*
|
|
90
|
+
* The start angle of the curve in radians starting from the middle right side.
|
|
91
|
+
* @remarks Expects a `Float`
|
|
92
|
+
* @defaultValue `0`
|
|
43
93
|
*/
|
|
44
94
|
aStartAngle: number;
|
|
45
95
|
|
|
46
96
|
/**
|
|
47
|
-
*
|
|
97
|
+
* The end angle of the curve in radians starting from the middle right side.
|
|
98
|
+
* @remarks Expects a `Float`
|
|
99
|
+
* @defaultValue `2 * Math.PI`
|
|
48
100
|
*/
|
|
49
101
|
aEndAngle: number;
|
|
50
102
|
|
|
51
103
|
/**
|
|
52
|
-
*
|
|
104
|
+
* Whether the ellipse is drawn clockwise.
|
|
105
|
+
* @defaultValue `false``
|
|
53
106
|
*/
|
|
54
107
|
aClockwise: boolean;
|
|
55
108
|
|
|
56
109
|
/**
|
|
57
|
-
*
|
|
110
|
+
* The rotation angle of the ellipse in radians, counterclockwise from the positive X axis (optional).
|
|
111
|
+
* @remarks Expects a `Float`
|
|
112
|
+
* @defaultValue `0`
|
|
58
113
|
*/
|
|
59
114
|
aRotation: number;
|
|
60
115
|
}
|
|
@@ -1,21 +1,42 @@
|
|
|
1
1
|
import { Vector2 } from './../../math/Vector2';
|
|
2
2
|
import { Curve } from './../core/Curve';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A curve representing a **2D** line segment.
|
|
6
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/extras/curves/LineCurve | Official Documentation}
|
|
7
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/curves/LineCurve.js | Source}
|
|
8
|
+
*/
|
|
4
9
|
export class LineCurve extends Curve<Vector2> {
|
|
5
|
-
|
|
10
|
+
/**
|
|
11
|
+
* This constructor creates a new {@link LineCurve}.
|
|
12
|
+
* @param v1 The start point. Default is `new THREE.Vector2()`.
|
|
13
|
+
* @param v2 The end point. Default is `new THREE.Vector2()`.
|
|
14
|
+
*/
|
|
15
|
+
constructor(v1?: Vector2, v2?: Vector2);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Read-only flag to check if a given object is of type {@link LineCurve}.
|
|
19
|
+
* @remarks This is a _constant_ value
|
|
20
|
+
* @defaultValue `true`
|
|
21
|
+
*/
|
|
22
|
+
readonly isLineCurve = true;
|
|
6
23
|
|
|
7
24
|
/**
|
|
8
|
-
*
|
|
25
|
+
* A Read-only _string_ to check if `this` object type.
|
|
26
|
+
* @remarks Sub-classes will update this value.
|
|
27
|
+
* @defaultValue `LineCurve`
|
|
9
28
|
*/
|
|
10
|
-
type: string;
|
|
29
|
+
override readonly type: string | 'LineCurve';
|
|
11
30
|
|
|
12
31
|
/**
|
|
13
|
-
*
|
|
32
|
+
* The start point.
|
|
33
|
+
* @defaultValue `new THREE.Vector2()`
|
|
14
34
|
*/
|
|
15
35
|
v1: Vector2;
|
|
16
36
|
|
|
17
37
|
/**
|
|
18
|
-
*
|
|
38
|
+
* The end point
|
|
39
|
+
* @defaultValue `new THREE.Vector2()`
|
|
19
40
|
*/
|
|
20
41
|
v2: Vector2;
|
|
21
42
|
}
|
|
@@ -1,21 +1,42 @@
|
|
|
1
1
|
import { Vector3 } from './../../math/Vector3';
|
|
2
2
|
import { Curve } from './../core/Curve';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A curve representing a **3D** line segment.
|
|
6
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/extras/curves/LineCurve3 | Official Documentation}
|
|
7
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/curves/LineCurve3.js | Source}
|
|
8
|
+
*/
|
|
4
9
|
export class LineCurve3 extends Curve<Vector3> {
|
|
5
|
-
|
|
10
|
+
/**
|
|
11
|
+
* This constructor creates a new {@link LineCurve3}.
|
|
12
|
+
* @param v1 The start point. Default is `new THREE.Vector3()`.
|
|
13
|
+
* @param v2 The end point. Default is `new THREE.Vector3()`.
|
|
14
|
+
*/
|
|
15
|
+
constructor(v1?: Vector3, v2?: Vector3);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Read-only flag to check if a given object is of type {@link LineCurve3}.
|
|
19
|
+
* @remarks This is a _constant_ value
|
|
20
|
+
* @defaultValue `true`
|
|
21
|
+
*/
|
|
22
|
+
readonly isLineCurve3 = true;
|
|
6
23
|
|
|
7
24
|
/**
|
|
8
|
-
*
|
|
25
|
+
* A Read-only _string_ to check if `this` object type.
|
|
26
|
+
* @remarks Sub-classes will update this value.
|
|
27
|
+
* @defaultValue `LineCurve3`
|
|
9
28
|
*/
|
|
10
|
-
type: string;
|
|
29
|
+
override readonly type: string | 'LineCurve3';
|
|
11
30
|
|
|
12
31
|
/**
|
|
13
|
-
*
|
|
32
|
+
* The start point.
|
|
33
|
+
* @defaultValue `new THREE.Vector3()`.
|
|
14
34
|
*/
|
|
15
35
|
v1: Vector3;
|
|
16
36
|
|
|
17
37
|
/**
|
|
18
|
-
*
|
|
38
|
+
* The end point.
|
|
39
|
+
* @defaultValue `new THREE.Vector3()`.
|
|
19
40
|
*/
|
|
20
41
|
v2: Vector3;
|
|
21
42
|
}
|
|
@@ -1,26 +1,64 @@
|
|
|
1
1
|
import { Vector2 } from './../../math/Vector2';
|
|
2
2
|
import { Curve } from './../core/Curve';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Create a smooth **2D** {@link http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:B%C3%A9zier_2_big.gif | quadratic bezier curve},
|
|
6
|
+
* defined by a start point, end point and a single control point.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const curve = new THREE.QuadraticBezierCurve(
|
|
10
|
+
* new THREE.Vector2(-10, 0),
|
|
11
|
+
* new THREE.Vector2(20, 15),
|
|
12
|
+
* new THREE.Vector2(10, 0));
|
|
13
|
+
* const points = curve.getPoints(50);
|
|
14
|
+
* const geometry = new THREE.BufferGeometry().setFromPoints(points);
|
|
15
|
+
* const material = new THREE.LineBasicMaterial({
|
|
16
|
+
* color: 0xff0000
|
|
17
|
+
* });
|
|
18
|
+
* // Create the final object to add to the scene
|
|
19
|
+
* const curveObject = new THREE.Line(geometry, material);
|
|
20
|
+
* ```
|
|
21
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/extras/curves/QuadraticBezierCurve | Official Documentation}
|
|
22
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/curves/QuadraticBezierCurve.js | Source}
|
|
23
|
+
*/
|
|
4
24
|
export class QuadraticBezierCurve extends Curve<Vector2> {
|
|
5
|
-
|
|
25
|
+
/**
|
|
26
|
+
* This constructor creates a new {@link QuadraticBezierCurve}.
|
|
27
|
+
* @param v0 The start point. Default is `new THREE.Vector2()`.
|
|
28
|
+
* @param v1 The control point. Default is `new THREE.Vector2()`.
|
|
29
|
+
* @param v2 The end point. Default is `new THREE.Vector2()`.
|
|
30
|
+
*/
|
|
31
|
+
constructor(v0?: Vector2, v1?: Vector2, v2?: Vector2);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Read-only flag to check if a given object is of type {@link LineCurve3}.
|
|
35
|
+
* @remarks This is a _constant_ value
|
|
36
|
+
* @defaultValue `true`
|
|
37
|
+
*/
|
|
38
|
+
readonly isQuadraticBezierCurve = true;
|
|
6
39
|
|
|
7
40
|
/**
|
|
8
|
-
*
|
|
41
|
+
* A Read-only _string_ to check if `this` object type.
|
|
42
|
+
* @remarks Sub-classes will update this value.
|
|
43
|
+
* @defaultValue `QuadraticBezierCurve`
|
|
9
44
|
*/
|
|
10
|
-
type: string;
|
|
45
|
+
override readonly type: string | 'QuadraticBezierCurve';
|
|
11
46
|
|
|
12
47
|
/**
|
|
13
|
-
*
|
|
48
|
+
* The start point.
|
|
49
|
+
* @defaultValue `new THREE.Vector2()`
|
|
14
50
|
*/
|
|
15
51
|
v0: Vector2;
|
|
16
52
|
|
|
17
53
|
/**
|
|
18
|
-
*
|
|
54
|
+
* The control point.
|
|
55
|
+
* @defaultValue `new THREE.Vector2()`
|
|
19
56
|
*/
|
|
20
57
|
v1: Vector2;
|
|
21
58
|
|
|
22
59
|
/**
|
|
23
|
-
*
|
|
60
|
+
* The end point.
|
|
61
|
+
* @defaultValue `new THREE.Vector2()`
|
|
24
62
|
*/
|
|
25
63
|
v2: Vector2;
|
|
26
64
|
}
|
|
@@ -1,26 +1,64 @@
|
|
|
1
1
|
import { Vector3 } from './../../math/Vector3';
|
|
2
2
|
import { Curve } from './../core/Curve';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Create a smooth **3D** {@link http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:B%C3%A9zier_2_big.gif | quadratic bezier curve},
|
|
6
|
+
* defined by a start point, end point and a single control point.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const curve = new THREE.QuadraticBezierCurve3(
|
|
10
|
+
* new THREE.Vector3(-10, 0, 0),
|
|
11
|
+
* new THREE.Vector3(20, 15, 0),
|
|
12
|
+
* new THREE.Vector3(10, 0, 0));
|
|
13
|
+
* const points = curve.getPoints(50);
|
|
14
|
+
* const geometry = new THREE.BufferGeometry().setFromPoints(points);
|
|
15
|
+
* const material = new THREE.LineBasicMaterial({
|
|
16
|
+
* color: 0xff0000
|
|
17
|
+
* });
|
|
18
|
+
* // Create the final object to add to the scene
|
|
19
|
+
* const curveObject = new THREE.Line(geometry, material);
|
|
20
|
+
* ```
|
|
21
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/extras/curves/QuadraticBezierCurve3 | Official Documentation}
|
|
22
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/curves/QuadraticBezierCurve3.js | Source}
|
|
23
|
+
*/
|
|
4
24
|
export class QuadraticBezierCurve3 extends Curve<Vector3> {
|
|
5
|
-
|
|
25
|
+
/**
|
|
26
|
+
* This constructor creates a new {@link QuadraticBezierCurve}.
|
|
27
|
+
* @param v0 The start point. Default is `new THREE.Vector3()`.
|
|
28
|
+
* @param v1 The control point. Default is `new THREE.Vector3()`.
|
|
29
|
+
* @param v2 The end point. Default is `new THREE.Vector3()`.
|
|
30
|
+
*/
|
|
31
|
+
constructor(v0?: Vector3, v1?: Vector3, v2?: Vector3);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Read-only flag to check if a given object is of type {@link QuadraticBezierCurve3}.
|
|
35
|
+
* @remarks This is a _constant_ value
|
|
36
|
+
* @defaultValue `true`
|
|
37
|
+
*/
|
|
38
|
+
readonly isQuadraticBezierCurve3 = true;
|
|
6
39
|
|
|
7
40
|
/**
|
|
8
|
-
*
|
|
41
|
+
* A Read-only _string_ to check if `this` object type.
|
|
42
|
+
* @remarks Sub-classes will update this value.
|
|
43
|
+
* @defaultValue `QuadraticBezierCurve3`
|
|
9
44
|
*/
|
|
10
|
-
type: string;
|
|
45
|
+
override readonly type: string | 'QuadraticBezierCurve3';
|
|
11
46
|
|
|
12
47
|
/**
|
|
13
|
-
*
|
|
48
|
+
* The start point.
|
|
49
|
+
* @defaultValue `new THREE.Vector3()`
|
|
14
50
|
*/
|
|
15
51
|
v0: Vector3;
|
|
16
52
|
|
|
17
53
|
/**
|
|
18
|
-
*
|
|
54
|
+
* The control point.
|
|
55
|
+
* @defaultValue `new THREE.Vector3()`
|
|
19
56
|
*/
|
|
20
57
|
v1: Vector3;
|
|
21
58
|
|
|
22
59
|
/**
|
|
23
|
-
*
|
|
60
|
+
* The end point.
|
|
61
|
+
* @defaultValue `new THREE.Vector3()`
|
|
24
62
|
*/
|
|
25
63
|
v2: Vector3;
|
|
26
64
|
}
|
|
@@ -1,16 +1,52 @@
|
|
|
1
1
|
import { Vector2 } from './../../math/Vector2';
|
|
2
2
|
import { Curve } from './../core/Curve';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Create a smooth **2D** spline curve from a series of points.
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* // Create a sine-like wave
|
|
9
|
+
* const curve = new THREE.SplineCurve([
|
|
10
|
+
* new THREE.Vector2(-10, 0),
|
|
11
|
+
* new THREE.Vector2(-5, 5),
|
|
12
|
+
* new THREE.Vector2(0, 0),
|
|
13
|
+
* new THREE.Vector2(5, -5),
|
|
14
|
+
* new THREE.Vector2(10, 0)]);
|
|
15
|
+
* const points = curve.getPoints(50);
|
|
16
|
+
* const geometry = new THREE.BufferGeometry().setFromPoints(points);
|
|
17
|
+
* const material = new THREE.LineBasicMaterial({
|
|
18
|
+
* color: 0xff0000
|
|
19
|
+
* });
|
|
20
|
+
* // Create the final object to add to the scene
|
|
21
|
+
* const splineObject = new THREE.Line(geometry, material);
|
|
22
|
+
* ```
|
|
23
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/extras/curves/SplineCurve | Official Documentation}
|
|
24
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/curves/SplineCurve.js | Source}
|
|
25
|
+
*/
|
|
4
26
|
export class SplineCurve extends Curve<Vector2> {
|
|
27
|
+
/**
|
|
28
|
+
* This constructor creates a new {@link SplineCurve}.
|
|
29
|
+
* @param points An array of {@link THREE.Vector2 | Vector2} points that define the curve. Default `[]`
|
|
30
|
+
*/
|
|
5
31
|
constructor(points?: Vector2[]);
|
|
6
32
|
|
|
7
33
|
/**
|
|
8
|
-
* @
|
|
34
|
+
* Read-only flag to check if a given object is of type {@link SplineCurve}.
|
|
35
|
+
* @remarks This is a _constant_ value
|
|
36
|
+
* @defaultValue `true`
|
|
37
|
+
*/
|
|
38
|
+
readonly isSplineCurve = true;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A Read-only _string_ to check if `this` object type.
|
|
42
|
+
* @remarks Sub-classes will update this value.
|
|
43
|
+
* @defaultValue `SplineCurve`
|
|
9
44
|
*/
|
|
10
|
-
type: string;
|
|
45
|
+
override readonly type: string | 'SplineCurve';
|
|
11
46
|
|
|
12
47
|
/**
|
|
13
|
-
* @
|
|
48
|
+
* The array of {@link THREE.Vector2 | Vector2} points that define the curve.
|
|
49
|
+
* @defaultValue `[]`
|
|
14
50
|
*/
|
|
15
51
|
points: Vector2[];
|
|
16
52
|
}
|
|
@@ -4,16 +4,32 @@ import { Mesh } from './../objects/Mesh';
|
|
|
4
4
|
import { Object3D } from './../core/Object3D';
|
|
5
5
|
import { ColorRepresentation } from '../math/Color';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* An 3D arrow object for visualizing directions.
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const dir = new THREE.Vector3(1, 2, 0);
|
|
12
|
+
* //normalize the direction vector (convert to vector of length 1)
|
|
13
|
+
* dir.normalize();
|
|
14
|
+
* const origin = new THREE.Vector3(0, 0, 0);
|
|
15
|
+
* const length = 1;
|
|
16
|
+
* const hex = 0xffff00;
|
|
17
|
+
* const {@link ArrowHelper} = new THREE.ArrowHelper(dir, origin, length, hex);
|
|
18
|
+
* scene.add(arrowHelper);
|
|
19
|
+
* ```
|
|
20
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_shadowmesh | WebGL / shadowmesh}
|
|
21
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/helpers/ArrowHelper | Official Documentation}
|
|
22
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/ArrowHelper.js | Source}
|
|
23
|
+
*/
|
|
9
24
|
export class ArrowHelper extends Object3D {
|
|
10
25
|
/**
|
|
11
|
-
*
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
26
|
+
* Create a new instance of {@link ArrowHelper}
|
|
27
|
+
* @param dir Direction from origin. Must be a unit vector. Default `new THREE.Vector3(0, 0, 1)`
|
|
28
|
+
* @param origin Point at which the arrow starts. Default `new THREE.Vector3(0, 0, 0)`
|
|
29
|
+
* @param length Length of the arrow. Default `1`
|
|
30
|
+
* @param hex Hexadecimal value to define color. Default `0xffff00`
|
|
31
|
+
* @param headLength The length of the head of the arrow. Default `0.2 * length`
|
|
32
|
+
* @param headWidth The width of the head of the arrow. Default `0.2 * headLength`
|
|
17
33
|
*/
|
|
18
34
|
constructor(
|
|
19
35
|
dir?: Vector3,
|
|
@@ -25,9 +41,12 @@ export class ArrowHelper extends Object3D {
|
|
|
25
41
|
);
|
|
26
42
|
|
|
27
43
|
/**
|
|
28
|
-
*
|
|
44
|
+
* A Read-only _string_ to check if `this` object type.
|
|
45
|
+
* @remarks Sub-classes will update this value.
|
|
46
|
+
* @override
|
|
47
|
+
* @defaultValue `ArrowHelper`
|
|
29
48
|
*/
|
|
30
|
-
type: string;
|
|
49
|
+
override readonly type: string | 'ArrowHelper';
|
|
31
50
|
|
|
32
51
|
/**
|
|
33
52
|
* Contains the line part of the arrowHelper.
|
|
@@ -39,24 +58,36 @@ export class ArrowHelper extends Object3D {
|
|
|
39
58
|
*/
|
|
40
59
|
cone: Mesh;
|
|
41
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Sets the color of the arrowHelper.
|
|
63
|
+
* @param color The desired color.
|
|
64
|
+
*/
|
|
65
|
+
setColor(color: ColorRepresentation): void;
|
|
66
|
+
|
|
42
67
|
/**
|
|
43
68
|
* @param dir The desired direction. Must be a unit vector.
|
|
44
69
|
*/
|
|
45
70
|
setDirection(dir: Vector3): void;
|
|
46
71
|
|
|
47
72
|
/**
|
|
73
|
+
* Sets the length of the arrowhelper.
|
|
48
74
|
* @param length The desired length.
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
75
|
+
* @param headLength The length of the head of the arrow. Default `0.2 * length`
|
|
76
|
+
* @param headWidth The width of the head of the arrow. Default `0.2 * headLength`
|
|
51
77
|
*/
|
|
52
78
|
setLength(length: number, headLength?: number, headWidth?: number): void;
|
|
53
79
|
|
|
54
80
|
/**
|
|
55
|
-
*
|
|
81
|
+
* Copy the given object into this object
|
|
82
|
+
* @remarks Note: event listeners and user-defined callbacks ({@link onAfterRender | .onAfterRender} and {@link onBeforeRender | .onBeforeRender}) are not copied.
|
|
83
|
+
* @param source
|
|
56
84
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
copy(source: this): this;
|
|
85
|
+
override copy(source: this): this;
|
|
60
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Frees the GPU-related resources allocated by this instance
|
|
89
|
+
* @remarks
|
|
90
|
+
* Call this method whenever this instance is no longer used in your app.
|
|
91
|
+
*/
|
|
61
92
|
dispose(): void;
|
|
62
93
|
}
|
|
@@ -1,18 +1,50 @@
|
|
|
1
1
|
import { Color } from '../math/Color';
|
|
2
2
|
import { LineSegments } from './../objects/LineSegments';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* An axis object to visualize the 3 axes in a simple way.
|
|
6
|
+
* @remarks
|
|
7
|
+
* The X axis is red
|
|
8
|
+
* The Y axis is green
|
|
9
|
+
* The Z axis is blue.
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const {@link AxesHelper} = new THREE.AxesHelper(5);
|
|
13
|
+
* scene.add(axesHelper);
|
|
14
|
+
* ```
|
|
15
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_compression | WebGL / buffergeometry / compression}
|
|
16
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_geometry_convex | WebGL / geometry / convex}
|
|
17
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_loader_nrrd | WebGL / loader / nrrd}
|
|
18
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/helpers/AxesHelper | Official Documentation}
|
|
19
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/AxesHelper.js | Source}
|
|
20
|
+
*/
|
|
4
21
|
export class AxesHelper extends LineSegments {
|
|
5
22
|
/**
|
|
6
|
-
* @
|
|
23
|
+
* Create a new instance of {@link AxesHelper}
|
|
24
|
+
* @param size Size of the lines representing the axes. Default `1`
|
|
7
25
|
*/
|
|
8
26
|
constructor(size?: number);
|
|
9
27
|
|
|
10
28
|
/**
|
|
11
|
-
*
|
|
29
|
+
* A Read-only _string_ to check if `this` object type.
|
|
30
|
+
* @remarks Sub-classes will update this value.
|
|
31
|
+
* @override
|
|
32
|
+
* @defaultValue `AxesHelper`
|
|
12
33
|
*/
|
|
13
|
-
type: string;
|
|
34
|
+
override readonly type: string | 'AxesHelper';
|
|
14
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Sets the axes colors to {@link Color | xAxisColor}, {@link Color | yAxisColor}, {@link Color | zAxisColor}.
|
|
38
|
+
* @param xAxisColor
|
|
39
|
+
* @param yAxisColor
|
|
40
|
+
* @param zAxisColor
|
|
41
|
+
*/
|
|
15
42
|
setColors(xAxisColor: Color, yAxisColor: Color, zAxisColor: Color): this;
|
|
16
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Frees the GPU-related resources allocated by this instance
|
|
46
|
+
* @remarks
|
|
47
|
+
* Call this method whenever this instance is no longer used in your app.
|
|
48
|
+
*/
|
|
17
49
|
dispose(): void;
|
|
18
50
|
}
|