@types/three 0.150.2 → 0.152.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 +2 -2
- three/build/three.min.d.ts +2 -0
- three/build/three.module.min.d.ts +2 -0
- 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/libs/tween.module.d.ts +2 -0
- 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 +131 -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 -11
- 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/core/constants.d.ts +1 -0
- 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/LightUtils.d.ts +4 -0
- three/examples/jsm/nodes/lighting/PointLightNode.d.ts +10 -0
- three/examples/jsm/nodes/lighting/SpotLightNode.d.ts +15 -0
- three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +0 -7
- three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +0 -9
- three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +0 -9
- three/examples/jsm/nodes/materials/NodeMaterial.d.ts +17 -1
- three/examples/jsm/nodes/math/MathNode.d.ts +2 -2
- three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +2 -2
- three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +0 -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/CSS3DRenderer.d.ts +2 -2
- three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +1 -21
- three/examples/jsm/utils/BufferGeometryUtils.d.ts +12 -2
- three/examples/jsm/utils/SkeletonUtils.d.ts +3 -19
- three/index.d.ts +1 -1
- three/package.json +3 -2
- three/src/Three.d.ts +1 -0
- three/src/constants.d.ts +3 -23
- three/src/core/BufferGeometry.d.ts +60 -33
- three/src/core/Raycaster.d.ts +2 -1
- 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/materials/ShaderMaterial.d.ts +1 -1
- 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/Points.d.ts +7 -6
- three/src/objects/Skeleton.d.ts +5 -1
- three/src/objects/SkinnedMesh.d.ts +37 -25
- three/src/renderers/WebGLRenderTarget.d.ts +3 -0
- three/src/renderers/WebGLRenderer.d.ts +25 -1
- three/src/renderers/shaders/ShaderChunk.d.ts +58 -37
- three/src/renderers/shaders/UniformsLib.d.ts +88 -57
- three/src/textures/CanvasTexture.d.ts +0 -1
- three/src/textures/CompressedTexture.d.ts +3 -2
- three/src/textures/CubeTexture.d.ts +3 -4
- three/src/textures/DataTexture.d.ts +3 -3
- three/src/textures/Texture.d.ts +37 -24
- three/examples/jsm/nodes/functions/light/getDistanceAttenuation.d.ts +0 -5
- three/examples/jsm/nodes/lighting/PunctualLightNode.d.ts +0 -12
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { NodeValueOption } from './constants';
|
|
2
2
|
import Node from './Node';
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export interface NodeChild {
|
|
5
|
+
property: string;
|
|
6
|
+
index?: number | string;
|
|
7
|
+
childNode: Node;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function getCacheKey(object: Node): string;
|
|
11
|
+
export function getNodeChildren(object: Node): Generator<NodeChild, void>;
|
|
5
12
|
export function getValueType(value: NodeValueOption): string | null;
|
|
6
13
|
export function getValueFromType(type: string, ...params: number[]): NodeValueOption | null;
|
|
7
|
-
export function getCacheKey(object: Node): string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Color, Vector2, Vector3, Vector4 } from '../../../../src/Three';
|
|
2
2
|
import Node from '../core/Node';
|
|
3
|
+
import NodeBuilder from '../core/NodeBuilder';
|
|
3
4
|
|
|
4
5
|
export type RangeModeBound = number | Color | Vector2 | Vector3 | Vector4;
|
|
5
6
|
|
|
@@ -8,5 +9,5 @@ export default class RangeNode extends Node {
|
|
|
8
9
|
max: RangeModeBound;
|
|
9
10
|
|
|
10
11
|
constructor(min: RangeModeBound, max: RangeModeBound);
|
|
11
|
-
getVectorLength(): number;
|
|
12
|
+
getVectorLength(builder: NodeBuilder): number;
|
|
12
13
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import AnalyticLightNode from './AnalyticLightNode';
|
|
2
|
+
import Node from '../core/Node';
|
|
3
|
+
import { PointLight } from '../../../../src/Three';
|
|
4
|
+
|
|
5
|
+
export default class PointLightNode extends AnalyticLightNode<PointLight> {
|
|
6
|
+
cutoffDistanceNode: Node;
|
|
7
|
+
decayExponentNode: Node;
|
|
8
|
+
|
|
9
|
+
constructor(light?: PointLight | null);
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import AnalyticLightNode from './AnalyticLightNode';
|
|
2
|
+
import Node from '../core/Node';
|
|
3
|
+
import { SpotLight } from '../../../../src/Three';
|
|
4
|
+
|
|
5
|
+
export default class PointLightNode extends AnalyticLightNode<SpotLight> {
|
|
6
|
+
directionNode: Node;
|
|
7
|
+
|
|
8
|
+
coneCosNode: Node;
|
|
9
|
+
penumbraCosNode: Node;
|
|
10
|
+
|
|
11
|
+
cutoffDistanceNode: Node;
|
|
12
|
+
decayExponentNode: Node;
|
|
13
|
+
|
|
14
|
+
constructor(light?: SpotLight | null);
|
|
15
|
+
}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import NodeMaterial from './NodeMaterial';
|
|
2
2
|
import { ShaderMaterialParameters } from '../../../../src/Three';
|
|
3
|
-
import { Node } from '../Nodes';
|
|
4
3
|
|
|
5
4
|
export default class LineBasicNodeMaterial extends NodeMaterial {
|
|
6
5
|
isLineBasicNodeMaterial: true;
|
|
7
6
|
|
|
8
|
-
colorNode: Node | null;
|
|
9
|
-
opacityNode: Node | null;
|
|
10
|
-
alphaTestNode: Node | null;
|
|
11
|
-
lightNode: Node | null;
|
|
12
|
-
positionNode: Node | null;
|
|
13
|
-
|
|
14
7
|
constructor(parameters?: ShaderMaterialParameters);
|
|
15
8
|
copy(source: LineBasicNodeMaterial): this;
|
|
16
9
|
}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import NodeMaterial from './NodeMaterial';
|
|
2
|
-
import Node from '../core/Node';
|
|
3
2
|
import { ShaderMaterialParameters } from '../../../../src/Three';
|
|
4
3
|
|
|
5
4
|
export default class MeshBasicNodeMaterial extends NodeMaterial {
|
|
6
5
|
isMeshBasicNodeMaterial: true;
|
|
7
6
|
lights: true;
|
|
8
7
|
|
|
9
|
-
colorNode: Node | null;
|
|
10
|
-
opacityNode: Node | null;
|
|
11
|
-
|
|
12
|
-
alphaTestNode: Node | null;
|
|
13
|
-
lightNode: Node | null;
|
|
14
|
-
|
|
15
|
-
positionNode: Node | null;
|
|
16
|
-
|
|
17
8
|
constructor(paramters?: ShaderMaterialParameters);
|
|
18
9
|
copy(source: MeshBasicNodeMaterial): this;
|
|
19
10
|
}
|
|
@@ -5,10 +5,6 @@ import NodeMaterial from './NodeMaterial';
|
|
|
5
5
|
export default class MeshStandardNodeMaterial extends NodeMaterial {
|
|
6
6
|
isMeshStandardNodeMaterial: true;
|
|
7
7
|
|
|
8
|
-
colorNode: Node | null;
|
|
9
|
-
opacityNode: Node | null;
|
|
10
|
-
alphaTestNode: Node | null;
|
|
11
|
-
normalNode: Node | null;
|
|
12
8
|
emissiveNode: Node | null;
|
|
13
9
|
|
|
14
10
|
metalnessNode: Node | null;
|
|
@@ -17,11 +13,6 @@ export default class MeshStandardNodeMaterial extends NodeMaterial {
|
|
|
17
13
|
clearcoatNode: Node | null;
|
|
18
14
|
clearcoatRoughnessNode: Node | null;
|
|
19
15
|
|
|
20
|
-
envNode: Node | null;
|
|
21
|
-
|
|
22
|
-
lightsNode: Node | null;
|
|
23
|
-
positionNode: Node | null;
|
|
24
|
-
|
|
25
16
|
constructor(paramters?: ShaderMaterialParameters);
|
|
26
17
|
copy(source: MeshStandardNodeMaterial): this;
|
|
27
18
|
}
|
|
@@ -5,8 +5,24 @@ import { LightingModelNode } from '../lighting/LightingContextNode';
|
|
|
5
5
|
|
|
6
6
|
export default class NodeMaterial extends ShaderMaterial {
|
|
7
7
|
isNodeMaterial: true;
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
type: string;
|
|
10
|
+
|
|
11
|
+
lights: true;
|
|
12
|
+
normals: true;
|
|
13
|
+
|
|
14
|
+
lightsNode: Node | null;
|
|
15
|
+
envNode: Node | null;
|
|
16
|
+
|
|
17
|
+
colorNode: Node | null;
|
|
18
|
+
normalNode: Node | null;
|
|
19
|
+
opacityNode: Node | null;
|
|
20
|
+
backdropNode: Node | null;
|
|
21
|
+
backdropAlphaNode: Node | null;
|
|
22
|
+
alphaTestNode: Node | null;
|
|
23
|
+
|
|
24
|
+
positionNode: Node | null;
|
|
25
|
+
|
|
10
26
|
constructor();
|
|
11
27
|
|
|
12
28
|
build(builder: NodeBuilder): void;
|
|
@@ -24,7 +24,7 @@ export type MathNodeMethod1 =
|
|
|
24
24
|
| typeof MathNode.SIGN
|
|
25
25
|
| typeof MathNode.LENGTH
|
|
26
26
|
| typeof MathNode.NEGATE
|
|
27
|
-
| typeof MathNode.
|
|
27
|
+
| typeof MathNode.ONE_MINUS
|
|
28
28
|
| typeof MathNode.DFDX
|
|
29
29
|
| typeof MathNode.DFDY
|
|
30
30
|
| typeof MathNode.ROUND;
|
|
@@ -76,7 +76,7 @@ export default class MathNode extends TempNode {
|
|
|
76
76
|
static SIGN: 'sign';
|
|
77
77
|
static LENGTH: 'length';
|
|
78
78
|
static NEGATE: 'negate';
|
|
79
|
-
static
|
|
79
|
+
static ONE_MINUS: 'oneMinus';
|
|
80
80
|
static DFDX: 'dFdx';
|
|
81
81
|
static DFDY: 'dFdy';
|
|
82
82
|
static ROUND: 'round';
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
UserDataNode,
|
|
51
51
|
UVNode,
|
|
52
52
|
VarNode,
|
|
53
|
-
|
|
53
|
+
VaryingNode,
|
|
54
54
|
} from '../Nodes';
|
|
55
55
|
import StorageBufferNode from '../accessors/StorageBufferNode';
|
|
56
56
|
import NodeCache from '../core/NodeCache';
|
|
@@ -130,7 +130,7 @@ export function fn<P extends FunctionNodeArguments>(
|
|
|
130
130
|
export const instanceIndex: Swizzable<InstanceIndexNode>;
|
|
131
131
|
export function label(node: NodeRepresentation, name?: string): Swizzable<VarNode>;
|
|
132
132
|
export function temp(node: NodeRepresentation, name?: string): Swizzable<VarNode>;
|
|
133
|
-
export function vary(node: NodeRepresentation, name?: string): Swizzable<
|
|
133
|
+
export function vary(node: NodeRepresentation, name?: string): Swizzable<VaryingNode>;
|
|
134
134
|
|
|
135
135
|
// accesors
|
|
136
136
|
|
|
@@ -56,8 +56,6 @@ export { default as DFGApprox } from '../functions/BSDF/DFGApprox';
|
|
|
56
56
|
export { default as F_Schlick } from '../functions/BSDF/F_Schlick';
|
|
57
57
|
export { default as V_GGX_SmithCorrelated } from '../functions/BSDF/V_GGX_SmithCorrelated';
|
|
58
58
|
|
|
59
|
-
export { default as getDistanceAttenuation } from '../functions/light/getDistanceAttenuation';
|
|
60
|
-
|
|
61
59
|
export { default as getGeometryRoughness } from '../functions/material/getGeometryRoughness';
|
|
62
60
|
export { default as getRoughness } from '../functions/material/getRoughness';
|
|
63
61
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Mesh, IcosahedronGeometry, ShaderMaterial, Texture } from '../../../src/Three';
|
|
2
2
|
|
|
3
|
-
export class
|
|
3
|
+
export class GroundProjectedSkybox extends Mesh<IcosahedronGeometry, ShaderMaterial> {
|
|
4
4
|
constructor(texture: Texture, options?: { height?: number; radius?: number });
|
|
5
5
|
|
|
6
6
|
set radius(radius: number);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Object3D, Scene, Camera } from '../../../src/Three';
|
|
1
|
+
import { Object3D, Scene, Camera, Vector2 } from '../../../src/Three';
|
|
2
2
|
|
|
3
3
|
export class CSS2DObject extends Object3D {
|
|
4
4
|
constructor(element: HTMLElement);
|
|
5
5
|
element: HTMLElement;
|
|
6
|
+
center: Vector2;
|
|
6
7
|
|
|
7
8
|
onBeforeRender: (renderer: unknown, scene: Scene, camera: Camera) => void;
|
|
8
9
|
onAfterRender: (renderer: unknown, scene: Scene, camera: Camera) => void;
|
|
@@ -12,9 +12,9 @@ export class CSS3DSprite extends CSS3DObject {
|
|
|
12
12
|
constructor(element: HTMLElement);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export
|
|
15
|
+
export interface CSS3DParameters {
|
|
16
16
|
element?: HTMLElement;
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
|
|
19
19
|
export class CSS3DRenderer {
|
|
20
20
|
constructor(parameters?: CSS3DParameters);
|
|
@@ -12,27 +12,7 @@ export class WebGLNodeBuilder extends NodeBuilder {
|
|
|
12
12
|
);
|
|
13
13
|
|
|
14
14
|
addSlot(shaderStage: NodeShaderStageOption, slotNode: SlotNode): Node;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
getTexture(textureProperty: string, uvSnippet: string): string;
|
|
18
|
-
getTextureBias(textureProperty: string, uvSnippet: string, biasSnippet: string): string;
|
|
19
|
-
|
|
20
|
-
getTextureLevel(
|
|
21
|
-
textureProperty: string,
|
|
22
|
-
uvSnippet: string,
|
|
23
|
-
biasSnippet: string,
|
|
24
|
-
shaderStage?: NodeShaderStageOption,
|
|
25
|
-
): string;
|
|
26
|
-
getCubeTexture(texturePropert: string, uvSnippet: string, shaderStage?: NodeShaderStageOption): string;
|
|
27
|
-
|
|
28
|
-
getCubeTextureLevel(
|
|
29
|
-
textureProperty: string,
|
|
30
|
-
uvSnippet: string,
|
|
31
|
-
biasSnippet: string,
|
|
32
|
-
shaderStage?: NodeShaderStageOption,
|
|
33
|
-
): string;
|
|
34
|
-
|
|
35
|
-
getCubeTextureBias(textureProperty: string, uvSnippet: string, biasSnippet: string): string;
|
|
15
|
+
|
|
36
16
|
getUniforms(shaderStage: string): string;
|
|
37
17
|
|
|
38
18
|
getAttributes(shaderStage: string): string;
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
} from '../../../src/Three';
|
|
12
12
|
|
|
13
13
|
export function deepCloneAttribute(attribute: BufferAttribute): BufferAttribute;
|
|
14
|
-
export function
|
|
15
|
-
export function
|
|
14
|
+
export function mergeGeometries(geometries: BufferGeometry[], useGroups?: boolean): BufferGeometry;
|
|
15
|
+
export function mergeAttributes(attributes: BufferAttribute[]): BufferAttribute;
|
|
16
16
|
export function interleaveAttributes(attributes: BufferAttribute[]): InterleavedBufferAttribute;
|
|
17
17
|
export function estimateBytesUsed(geometry: BufferGeometry): number;
|
|
18
18
|
export function mergeVertices(geometry: BufferGeometry, tolerance?: number): BufferGeometry;
|
|
@@ -34,3 +34,13 @@ export function deinterleaveGeometry(geometry: BufferGeometry): void;
|
|
|
34
34
|
* @param creaseAngle The crease angle.
|
|
35
35
|
*/
|
|
36
36
|
export function toCreasedNormals(geometry: BufferGeometry, creaseAngle?: number): BufferGeometry;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use mergeGeometries instead.
|
|
40
|
+
*/
|
|
41
|
+
export function mergeBufferGeometries(geometries: BufferGeometry[], useGroups?: boolean): BufferGeometry;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated Use mergeAttributes instead.
|
|
45
|
+
*/
|
|
46
|
+
export function mergeBufferAttributes(attributes: BufferAttribute[]): BufferAttribute;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { AnimationClip,
|
|
1
|
+
import { AnimationClip, Object3D, Skeleton } from '../../../src/Three';
|
|
2
|
+
|
|
3
|
+
export function clone(source: Object3D): Object3D;
|
|
2
4
|
|
|
3
5
|
export function retarget(target: Object3D | Skeleton, source: Object3D | Skeleton, options: {}): void;
|
|
4
6
|
|
|
@@ -8,21 +10,3 @@ export function retargetClip(
|
|
|
8
10
|
clip: AnimationClip,
|
|
9
11
|
options: {},
|
|
10
12
|
): AnimationClip;
|
|
11
|
-
|
|
12
|
-
export function getHelperFromSkeleton(skeleton: Skeleton): SkeletonHelper;
|
|
13
|
-
|
|
14
|
-
export function getSkeletonOffsets(target: Object3D | Skeleton, source: Object3D | Skeleton, options: {}): Matrix4[];
|
|
15
|
-
|
|
16
|
-
export function renameBones(skeleton: Skeleton, names: {}): any;
|
|
17
|
-
|
|
18
|
-
export function getBones(skeleton: Skeleton | Bone[]): Bone[];
|
|
19
|
-
|
|
20
|
-
export function getBoneByName(name: string, skeleton: Skeleton): Bone;
|
|
21
|
-
|
|
22
|
-
export function getNearestBone(bone: Bone, names: {}): Bone;
|
|
23
|
-
|
|
24
|
-
export function findBoneTrackData(name: string, tracks: any[]): {};
|
|
25
|
-
|
|
26
|
-
export function getEqualsBonesNames(skeleton: Skeleton, targetSkeleton: Skeleton): string[];
|
|
27
|
-
|
|
28
|
-
export function clone(source: Object3D): Object3D;
|
three/index.d.ts
CHANGED
three/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.152.0",
|
|
4
4
|
"description": "TypeScript definitions for three",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,12 +25,13 @@
|
|
|
25
25
|
},
|
|
26
26
|
"scripts": {},
|
|
27
27
|
"dependencies": {
|
|
28
|
+
"@tweenjs/tween.js": "~18.6.4",
|
|
28
29
|
"@types/stats.js": "*",
|
|
29
30
|
"@types/webxr": "*",
|
|
30
31
|
"fflate": "~0.6.9",
|
|
31
32
|
"lil-gui": "~0.17.0"
|
|
32
33
|
},
|
|
33
|
-
"typesPublisherContentHash": "
|
|
34
|
+
"typesPublisherContentHash": "c206b6e9fcb60fc53d60b9c172bf339b663fa61d521aa358641f9b16d55913ed",
|
|
34
35
|
"typeScriptVersion": "4.4",
|
|
35
36
|
"exports": {
|
|
36
37
|
".": {
|
three/src/Three.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ export * from './extras/core/Path';
|
|
|
65
65
|
export * from './extras/core/ShapePath';
|
|
66
66
|
export * from './extras/core/CurvePath';
|
|
67
67
|
export * from './extras/core/Curve';
|
|
68
|
+
export * from './extras/core/Interpolations';
|
|
68
69
|
export * as DataUtils from './extras/DataUtils';
|
|
69
70
|
export * from './extras/ImageUtils';
|
|
70
71
|
export * from './extras/ShapeUtils';
|
three/src/constants.d.ts
CHANGED
|
@@ -681,11 +681,14 @@ export type TrianglesDrawModes = typeof TrianglesDrawMode | typeof TriangleStrip
|
|
|
681
681
|
///////////////////////////////////////////////////////////////////////////////
|
|
682
682
|
// Texture Encodings
|
|
683
683
|
|
|
684
|
+
/** @deprecated Use {@link LinearSRGBColorSpace} or {@link NoColorSpace} in three.js r152+. */
|
|
684
685
|
export const LinearEncoding: 3000;
|
|
686
|
+
/** @deprecated Use {@link SRGBColorSpace} in three.js r152+. */
|
|
685
687
|
export const sRGBEncoding: 3001;
|
|
686
688
|
/**
|
|
687
689
|
* Texture Encodings.
|
|
688
690
|
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
|
|
691
|
+
* @deprecated Use {@link ColorSpace} in three.js r152+.
|
|
689
692
|
*/
|
|
690
693
|
export type TextureEncoding = typeof LinearEncoding | typeof sRGBEncoding;
|
|
691
694
|
|
|
@@ -901,26 +904,3 @@ export type PixelFormatGPU =
|
|
|
901
904
|
| 'DEPTH_COMPONENT32F'
|
|
902
905
|
| 'DEPTH24_STENCIL8'
|
|
903
906
|
| 'DEPTH32F_STENCIL8';
|
|
904
|
-
|
|
905
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
906
|
-
|
|
907
|
-
export type BuiltinShaderAttributeName =
|
|
908
|
-
| 'position'
|
|
909
|
-
| 'normal'
|
|
910
|
-
| 'uv'
|
|
911
|
-
| 'color'
|
|
912
|
-
| 'skinIndex'
|
|
913
|
-
| 'skinWeight'
|
|
914
|
-
| 'instanceMatrix'
|
|
915
|
-
| 'morphTarget0'
|
|
916
|
-
| 'morphTarget1'
|
|
917
|
-
| 'morphTarget2'
|
|
918
|
-
| 'morphTarget3'
|
|
919
|
-
| 'morphTarget4'
|
|
920
|
-
| 'morphTarget5'
|
|
921
|
-
| 'morphTarget6'
|
|
922
|
-
| 'morphTarget7'
|
|
923
|
-
| 'morphNormal0'
|
|
924
|
-
| 'morphNormal1'
|
|
925
|
-
| 'morphNormal2'
|
|
926
|
-
| 'morphNormal3';
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { BufferAttribute } from './BufferAttribute';
|
|
2
2
|
import { InterleavedBufferAttribute } from './InterleavedBufferAttribute';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Vector3 } from './../math/Vector3';
|
|
3
|
+
import { Box3 } from '../math/Box3';
|
|
4
|
+
import { Sphere } from '../math/Sphere';
|
|
5
|
+
import { Matrix4 } from '../math/Matrix4';
|
|
6
|
+
import { Quaternion } from '../math/Quaternion';
|
|
7
|
+
import { Vector2 } from '../math/Vector2';
|
|
8
|
+
import { Vector3 } from '../math/Vector3';
|
|
10
9
|
import { EventDispatcher } from './EventDispatcher';
|
|
11
|
-
import {
|
|
12
|
-
|
|
10
|
+
import { GLBufferAttribute } from './GLBufferAttribute';
|
|
11
|
+
|
|
12
|
+
export type NormalBufferAttributes = Record<string, BufferAttribute | InterleavedBufferAttribute>;
|
|
13
|
+
export type NormalOrGLBufferAttributes = Record<
|
|
14
|
+
string,
|
|
15
|
+
BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute
|
|
16
|
+
>;
|
|
13
17
|
|
|
14
18
|
/**
|
|
15
19
|
* A representation of mesh, line, or point geometry
|
|
@@ -19,20 +23,46 @@ import * as BufferGeometryUtils from '../../examples/jsm/utils/BufferGeometryUti
|
|
|
19
23
|
* @example
|
|
20
24
|
* ```typescript
|
|
21
25
|
* const geometry = new THREE.BufferGeometry();
|
|
26
|
+
*
|
|
22
27
|
* // create a simple square shape. We duplicate the top left and bottom right
|
|
23
28
|
* // vertices because each vertex needs to appear once per triangle.
|
|
24
|
-
* const vertices = new Float32Array([
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
29
|
+
* const vertices = new Float32Array( [
|
|
30
|
+
* -1.0, -1.0, 1.0, // v0
|
|
31
|
+
* 1.0, -1.0, 1.0, // v1
|
|
32
|
+
* 1.0, 1.0, 1.0, // v2
|
|
33
|
+
*
|
|
34
|
+
* 1.0, 1.0, 1.0, // v3
|
|
35
|
+
* -1.0, 1.0, 1.0, // v4
|
|
36
|
+
* -1.0, -1.0, 1.0 // v5
|
|
37
|
+
* ] );
|
|
28
38
|
*
|
|
29
|
-
* 1.0, 1.0, 1.0,
|
|
30
|
-
* -1.0, 1.0, 1.0,
|
|
31
|
-
* -1.0, -1.0, 1.0]);
|
|
32
39
|
* // itemSize = 3 because there are 3 values (components) per vertex
|
|
33
|
-
* geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));
|
|
34
|
-
* const material = new THREE.MeshBasicMaterial({ color: 0xff0000 });
|
|
35
|
-
* const mesh = new THREE.Mesh(geometry, material);
|
|
40
|
+
* geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
|
|
41
|
+
* const material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
|
|
42
|
+
* const mesh = new THREE.Mesh( geometry, material );
|
|
43
|
+
* ```
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* const geometry = new THREE.BufferGeometry();
|
|
47
|
+
*
|
|
48
|
+
* const vertices = new Float32Array( [
|
|
49
|
+
* -1.0, -1.0, 1.0, // v0
|
|
50
|
+
* 1.0, -1.0, 1.0, // v1
|
|
51
|
+
* 1.0, 1.0, 1.0, // v2
|
|
52
|
+
* -1.0, 1.0, 1.0, // v3
|
|
53
|
+
* ] );
|
|
54
|
+
* geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
|
|
55
|
+
*
|
|
56
|
+
* const indices = [
|
|
57
|
+
* 0, 1, 2,
|
|
58
|
+
* 2, 3, 0,
|
|
59
|
+
* ];
|
|
60
|
+
*
|
|
61
|
+
* geometry.setIndex( indices );
|
|
62
|
+
* geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
|
|
63
|
+
*
|
|
64
|
+
* const material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
|
|
65
|
+
* const mesh = new THREE.Mesh( geometry, material );
|
|
36
66
|
* ```
|
|
37
67
|
* @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry | Mesh with non-indexed faces}
|
|
38
68
|
* @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_indexed | Mesh with indexed faces}
|
|
@@ -43,7 +73,9 @@ import * as BufferGeometryUtils from '../../examples/jsm/utils/BufferGeometryUti
|
|
|
43
73
|
* @see {@link https://threejs.org/docs/index.html#api/en/core/BufferGeometry | Official Documentation}
|
|
44
74
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/BufferGeometry.js | Source}
|
|
45
75
|
*/
|
|
46
|
-
export class BufferGeometry
|
|
76
|
+
export class BufferGeometry<
|
|
77
|
+
Attributes extends NormalOrGLBufferAttributes = NormalBufferAttributes,
|
|
78
|
+
> extends EventDispatcher {
|
|
47
79
|
/**
|
|
48
80
|
* This creates a new {@link THREE.BufferGeometry | BufferGeometry} object.
|
|
49
81
|
*/
|
|
@@ -87,9 +119,7 @@ export class BufferGeometry extends EventDispatcher {
|
|
|
87
119
|
* use {@link setAttribute | .setAttribute} and {@link getAttribute | .getAttribute} to access attributes of this geometry.
|
|
88
120
|
* @defaultValue `{}`
|
|
89
121
|
*/
|
|
90
|
-
attributes:
|
|
91
|
-
[name: string]: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute; // TODO Replace for 'Record<>'
|
|
92
|
-
};
|
|
122
|
+
attributes: Attributes;
|
|
93
123
|
|
|
94
124
|
/**
|
|
95
125
|
* Hashmap of {@link THREE.BufferAttribute | BufferAttributes} holding details of the geometry's morph targets.
|
|
@@ -185,30 +215,25 @@ export class BufferGeometry extends EventDispatcher {
|
|
|
185
215
|
* @param name
|
|
186
216
|
* @param attribute
|
|
187
217
|
*/
|
|
188
|
-
setAttribute(
|
|
189
|
-
name: BuiltinShaderAttributeName | (string & {}),
|
|
190
|
-
attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute,
|
|
191
|
-
): this;
|
|
218
|
+
setAttribute<K extends keyof Attributes>(name: K, attribute: Attributes[K]): this;
|
|
192
219
|
|
|
193
220
|
/**
|
|
194
221
|
* Returns the {@link attributes | attribute} with the specified name.
|
|
195
222
|
* @param name
|
|
196
223
|
*/
|
|
197
|
-
getAttribute(
|
|
198
|
-
name: BuiltinShaderAttributeName | (string & {}),
|
|
199
|
-
): BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute;
|
|
224
|
+
getAttribute<K extends keyof Attributes>(name: K): Attributes[K];
|
|
200
225
|
|
|
201
226
|
/**
|
|
202
227
|
* Deletes the {@link attributes | attribute} with the specified name.
|
|
203
228
|
* @param name
|
|
204
229
|
*/
|
|
205
|
-
deleteAttribute(name:
|
|
230
|
+
deleteAttribute(name: keyof Attributes): this;
|
|
206
231
|
|
|
207
232
|
/**
|
|
208
233
|
* Returns true if the {@link attributes | attribute} with the specified name exists.
|
|
209
234
|
* @param name
|
|
210
235
|
*/
|
|
211
|
-
hasAttribute(name:
|
|
236
|
+
hasAttribute(name: keyof Attributes): boolean;
|
|
212
237
|
|
|
213
238
|
/**
|
|
214
239
|
* Adds a group to this geometry
|
|
@@ -329,7 +354,9 @@ export class BufferGeometry extends EventDispatcher {
|
|
|
329
354
|
computeTangents(): void;
|
|
330
355
|
|
|
331
356
|
/**
|
|
332
|
-
* Computes vertex normals
|
|
357
|
+
* Computes vertex normals for the given vertex data. For indexed geometries, the method sets each vertex normal to
|
|
358
|
+
* be the average of the face normals of the faces that share that vertex. For non-indexed geometries, vertices are
|
|
359
|
+
* not shared, and the method sets each vertex normal to be the same as the face normal.
|
|
333
360
|
*/
|
|
334
361
|
computeVertexNormals(): void;
|
|
335
362
|
|
three/src/core/Raycaster.d.ts
CHANGED
|
@@ -27,7 +27,8 @@ export interface Intersection<TIntersected extends Object3D = Object3D> {
|
|
|
27
27
|
/** The intersected object */
|
|
28
28
|
object: TIntersected;
|
|
29
29
|
uv?: Vector2 | undefined;
|
|
30
|
-
|
|
30
|
+
uv1?: Vector2 | undefined;
|
|
31
|
+
normal?: Vector3;
|
|
31
32
|
/** The index number of the instance where the ray intersects the {@link THREE.InstancedMesh | InstancedMesh } */
|
|
32
33
|
instanceId?: number | undefined;
|
|
33
34
|
}
|
three/src/extras/DataUtils.d.ts
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a half precision floating point value from the given single precision floating point value.
|
|
3
|
+
* @param val A single precision floating point value.
|
|
4
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/extras/DataUtils | Official Documentation}
|
|
5
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/DataUtils.js | Source}
|
|
6
|
+
*/
|
|
1
7
|
export function toHalfFloat(val: number): number;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Returns a single precision floating point value from the given half precision floating point value.
|
|
11
|
+
* @param val A half precision floating point value.
|
|
12
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/extras/DataUtils | Official Documentation}
|
|
13
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/DataUtils.js | Source}
|
|
14
|
+
*/
|
|
2
15
|
export function fromHalfFloat(val: number): number;
|
three/src/extras/Earcut.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An implementation of the {@link Earcut} polygon triangulation algorithm
|
|
3
|
+
* @remarks
|
|
4
|
+
* The code is a port of {@link https://github.com/mapbox/earcut | mapbox/earcut}.
|
|
5
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/extras/Earcut | Official Documentation}
|
|
6
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/Earcut.js | Source}
|
|
7
|
+
*/
|
|
1
8
|
export const Earcut: {
|
|
9
|
+
/**
|
|
10
|
+
* Triangulates the given shape definition by returning an array of triangles
|
|
11
|
+
* @remarks
|
|
12
|
+
* A triangle is defined by three consecutive integers representing vertex indices.
|
|
13
|
+
*/
|
|
2
14
|
triangulate(data: number[], holeIndices?: number[], dim?: number): number[];
|
|
3
15
|
};
|