@types/three 0.184.0 → 0.185.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/Addons.d.ts +2 -0
- three/examples/jsm/controls/FirstPersonControls.d.ts +9 -0
- three/examples/jsm/controls/OrbitControls.d.ts +2 -2
- three/examples/jsm/controls/TransformControls.d.ts +32 -1
- three/examples/jsm/csm/CSMFrustum.d.ts +73 -13
- three/examples/jsm/exporters/DRACOExporter.d.ts +1 -1
- three/examples/jsm/exporters/GLTFExporter.d.ts +2 -2
- three/examples/jsm/exporters/PLYExporter.d.ts +5 -4
- three/examples/jsm/exporters/USDZExporter.d.ts +5 -1
- three/examples/jsm/generators/CityGenerator.d.ts +75 -0
- three/examples/jsm/generators/ForestGenerator.d.ts +79 -0
- three/examples/jsm/generators/TerrainGenerator.d.ts +67 -0
- three/examples/jsm/generators/TreeGenerator.d.ts +97 -0
- three/examples/jsm/generators/city/SidewalkGenerator.d.ts +40 -0
- three/examples/jsm/generators/city/SkyscraperGenerator.d.ts +83 -0
- three/examples/jsm/geometries/LoftGeometry.d.ts +83 -0
- three/examples/jsm/inspector/tabs/Parameters.d.ts +5 -2
- three/examples/jsm/lighting/ClusteredLighting.d.ts +45 -0
- three/examples/jsm/lighting/LightProbeGrid.d.ts +131 -13
- three/examples/jsm/loaders/DRACOLoader.d.ts +20 -6
- three/examples/jsm/loaders/EXRLoader.d.ts +2 -12
- three/examples/jsm/loaders/GLTFLoader.d.ts +1 -1
- three/examples/jsm/loaders/HDRLoader.d.ts +2 -12
- three/examples/jsm/loaders/KTX2Loader.d.ts +1 -1
- three/examples/jsm/loaders/LWOLoader.d.ts +6 -0
- three/examples/jsm/loaders/RGBELoader.d.ts +1 -7
- three/examples/jsm/loaders/SVGLoader.d.ts +9 -6
- three/examples/jsm/loaders/TGALoader.d.ts +2 -2
- three/examples/jsm/loaders/TIFFLoader.d.ts +2 -11
- three/examples/jsm/loaders/USDLoader.d.ts +6 -1
- three/examples/jsm/misc/TileCreasedNormalsPlugin.d.ts +49 -0
- three/examples/jsm/objects/MarchingCubes.d.ts +2 -2
- three/examples/jsm/objects/Reflector.d.ts +38 -5
- three/examples/jsm/objects/SkyMesh.d.ts +1 -1
- three/examples/jsm/physics/RapierPhysics.d.ts +1 -0
- three/examples/jsm/tsl/display/BloomNode.d.ts +23 -6
- three/examples/jsm/tsl/display/ImportanceSampledEnvironment.d.ts +84 -0
- three/examples/jsm/tsl/display/RecurrentDenoiseNode.d.ts +89 -0
- three/examples/jsm/tsl/display/SSAAPassNode.d.ts +0 -2
- three/examples/jsm/tsl/display/SSGINode.d.ts +4 -1
- three/examples/jsm/tsl/display/SSRNode.d.ts +303 -30
- three/examples/jsm/tsl/display/TRAANode.d.ts +1 -1
- three/examples/jsm/tsl/display/TemporalReprojectNode.d.ts +64 -0
- three/examples/jsm/tsl/lighting/ClusteredLightsNode.d.ts +54 -0
- three/examples/jsm/tsl/math/curlNoise.d.ts +38 -0
- three/examples/jsm/tsl/utils/GroundedSkybox.d.ts +17 -0
- three/examples/jsm/tsl/utils/RNoise.d.ts +12 -0
- three/examples/jsm/tsl/utils/SpecularHelpers.d.ts +20 -0
- three/examples/jsm/webxr/WebGLXRFallback.d.ts +14 -0
- three/package.json +3 -3
- three/src/Three.TSL.d.ts +10 -3
- three/src/Three.WebGPU.Nodes.d.ts +2 -2
- three/src/Three.WebGPU.d.ts +5 -3
- three/src/animation/AnimationClip.d.ts +0 -10
- three/src/cameras/Camera.d.ts +1 -1
- three/src/core/InterleavedBuffer.d.ts +1 -1
- three/src/core/Object3D.d.ts +8 -4
- three/src/core/RenderTarget.d.ts +11 -0
- three/src/core/Timer.d.ts +1 -1
- three/src/core/UniformsGroup.d.ts +1 -1
- three/src/extras/Controls.d.ts +6 -5
- three/src/extras/core/ShapePath.d.ts +61 -65
- three/src/loaders/DataTextureLoader.d.ts +37 -3
- three/src/loaders/MaterialLoader.d.ts +8 -0
- three/src/materials/LineBasicMaterial.d.ts +5 -0
- three/src/materials/Material.d.ts +9 -1
- three/src/materials/MeshBasicMaterial.d.ts +30 -0
- three/src/materials/MeshDepthMaterial.d.ts +13 -0
- three/src/materials/MeshDistanceMaterial.d.ts +13 -0
- three/src/materials/MeshLambertMaterial.d.ts +50 -1
- three/src/materials/MeshMatcapMaterial.d.ts +31 -1
- three/src/materials/MeshNormalMaterial.d.ts +11 -1
- three/src/materials/MeshPhongMaterial.d.ts +50 -1
- three/src/materials/MeshPhysicalMaterial.d.ts +50 -0
- three/src/materials/MeshStandardMaterial.d.ts +53 -1
- three/src/materials/MeshToonMaterial.d.ts +43 -1
- three/src/materials/PointsMaterial.d.ts +9 -0
- three/src/materials/ShaderMaterial.d.ts +2 -0
- three/src/materials/SpriteMaterial.d.ts +9 -0
- three/src/materials/nodes/Line2NodeMaterial.d.ts +18 -13
- three/src/materials/nodes/NodeMaterial.d.ts +33 -13
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +0 -84
- three/src/math/Box2.d.ts +3 -3
- three/src/math/Box3.d.ts +255 -19
- three/src/math/Color.d.ts +10 -10
- three/src/math/FrustumArray.d.ts +75 -16
- three/src/math/Interpolant.d.ts +111 -8
- three/src/math/Matrix2.d.ts +1 -1
- three/src/math/Matrix3.d.ts +10 -1
- three/src/math/Matrix4.d.ts +329 -105
- three/src/math/Vector2.d.ts +1 -2
- three/src/math/Vector3.d.ts +3 -4
- three/src/math/Vector4.d.ts +1 -2
- three/src/math/interpolants/BezierInterpolant.d.ts +19 -3
- three/src/math/interpolants/CubicInterpolant.d.ts +18 -3
- three/src/math/interpolants/DiscreteInterpolant.d.ts +8 -3
- three/src/math/interpolants/LinearInterpolant.d.ts +7 -3
- three/src/math/interpolants/QuaternionLinearInterpolant.d.ts +7 -3
- three/src/nodes/Nodes.d.ts +4 -13
- three/src/nodes/TSL.d.ts +7 -5
- three/src/nodes/accessors/Batch.d.ts +19 -0
- three/src/nodes/accessors/Instance.d.ts +34 -0
- three/src/nodes/accessors/MaterialNode.d.ts +86 -79
- three/src/nodes/accessors/Morph.d.ts +11 -0
- three/src/nodes/accessors/Skinning.d.ts +23 -0
- three/src/nodes/accessors/StorageBufferNode.d.ts +22 -23
- three/src/nodes/accessors/StorageTexture3DNode.d.ts +17 -0
- three/src/nodes/accessors/StorageTextureNode.d.ts +6 -4
- three/src/nodes/accessors/TextureNode.d.ts +15 -10
- three/src/nodes/core/ArrayNode.d.ts +16 -8
- three/src/nodes/core/ContextNode.d.ts +5 -6
- three/src/nodes/core/LightingModel.d.ts +2 -0
- three/src/nodes/core/Node.d.ts +50 -51
- three/src/nodes/core/NodeBuilder.d.ts +1 -133
- three/src/nodes/core/OverrideContextNode.d.ts +92 -0
- three/src/nodes/core/PropertyNode.d.ts +13 -2
- three/src/nodes/core/StructNode.d.ts +0 -2
- three/src/nodes/core/StructTypeNode.d.ts +5 -4
- three/src/nodes/core/UniformNode.d.ts +48 -9
- three/src/nodes/display/BlendModes.d.ts +72 -11
- three/src/nodes/display/FrontFacingNode.d.ts +62 -3
- three/src/nodes/display/PassNode.d.ts +0 -2
- three/src/nodes/display/PremultiplyAlphaFunctions.d.ts +37 -0
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +53 -45
- three/src/nodes/lighting/LightingContextNode.d.ts +9 -2
- three/src/nodes/lighting/LightsNode.d.ts +4 -4
- three/src/nodes/math/MathNode.d.ts +358 -304
- three/src/nodes/math/OperatorNode.d.ts +253 -82
- three/src/nodes/tsl/TSLCore.d.ts +16 -9
- three/src/nodes/utils/ArrayElementNode.d.ts +5 -4
- three/src/nodes/utils/EquirectUV.d.ts +31 -1
- three/src/nodes/utils/Packing.d.ts +50 -3
- three/src/nodes/utils/RTTNode.d.ts +7 -12
- three/src/nodes/utils/Remap.d.ts +216 -29
- three/src/nodes/utils/SampleNode.d.ts +18 -8
- three/src/objects/BatchedMesh.d.ts +1 -1
- three/src/objects/InstancedMesh.d.ts +0 -8
- three/src/objects/Skeleton.d.ts +0 -2
- three/src/renderers/common/Backend.d.ts +0 -3
- three/src/renderers/common/CanvasTarget.d.ts +0 -49
- three/src/renderers/common/ClippingContext.d.ts +6 -1
- three/src/renderers/common/CubeRenderTarget.d.ts +2 -1
- three/src/renderers/common/Info.d.ts +26 -66
- three/src/renderers/common/InspectorBase.d.ts +0 -7
- three/src/renderers/common/Lighting.d.ts +49 -5
- three/src/renderers/common/Renderer.d.ts +34 -458
- three/src/renderers/common/RendererUtils.d.ts +1 -2
- three/src/renderers/common/TimestampQueryPool.d.ts +1 -1
- three/src/renderers/common/XRManager.d.ts +32 -299
- three/src/renderers/common/nodes/NodeLibrary.d.ts +0 -117
- three/src/renderers/webgl/WebGLPrograms.d.ts +2 -0
- three/src/renderers/webgl/WebGLRenderLists.d.ts +5 -1
- three/src/renderers/webgl/WebGLState.d.ts +2 -0
- three/src/renderers/webgl-fallback/WebGLBackend.d.ts +1 -1
- three/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts +0 -10
- three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +0 -1
- three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +5 -121
- three/src/textures/CubeDepthTexture.d.ts +2 -3
- three/src/textures/DataTexture.d.ts +2 -1
- three/src/textures/DepthTexture.d.ts +5 -5
- three/examples/jsm/lighting/TiledLighting.d.ts +0 -9
- three/examples/jsm/tsl/display/AnamorphicNode.d.ts +0 -31
- three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +0 -22
- three/src/nodes/accessors/BatchNode.d.ts +0 -12
- three/src/nodes/accessors/InstanceNode.d.ts +0 -30
- three/src/nodes/accessors/InstancedMeshNode.d.ts +0 -10
- three/src/nodes/accessors/MorphNode.d.ts +0 -14
- three/src/nodes/accessors/SkinningNode.d.ts +0 -32
- three/src/renderers/common/Animation.d.ts +0 -102
- three/src/renderers/common/Attributes.d.ts +0 -59
- three/src/renderers/common/Background.d.ts +0 -47
- three/src/renderers/common/BindGroup.d.ts +0 -39
- three/src/renderers/common/Binding.d.ts +0 -50
- three/src/renderers/common/Bindings.d.ts +0 -132
- three/src/renderers/common/Buffer.d.ts +0 -90
- three/src/renderers/common/ChainMap.d.ts +0 -49
- three/src/renderers/common/Color4.d.ts +0 -55
- three/src/renderers/common/ComputePipeline.d.ts +0 -34
- three/src/renderers/common/DataMap.d.ts +0 -42
- three/src/renderers/common/Geometries.d.ts +0 -111
- three/src/renderers/common/Pipeline.d.ts +0 -29
- three/src/renderers/common/Pipelines.d.ts +0 -186
- three/src/renderers/common/ProgrammableStage.d.ts +0 -73
- three/src/renderers/common/RenderBundle.d.ts +0 -25
- three/src/renderers/common/RenderBundles.d.ts +0 -34
- three/src/renderers/common/RenderContext.d.ts +0 -235
- three/src/renderers/common/RenderContexts.d.ts +0 -47
- three/src/renderers/common/RenderList.d.ts +0 -226
- three/src/renderers/common/RenderLists.d.ts +0 -46
- three/src/renderers/common/RenderObject.d.ts +0 -448
- three/src/renderers/common/RenderObjectPipeline.d.ts +0 -33
- three/src/renderers/common/RenderObjects.d.ts +0 -151
- three/src/renderers/common/SampledTexture.d.ts +0 -28
- three/src/renderers/common/Sampler.d.ts +0 -19
- three/src/renderers/common/Textures.d.ts +0 -125
- three/src/renderers/common/Uniform.d.ts +0 -262
- three/src/renderers/common/UniformBuffer.d.ts +0 -20
- three/src/renderers/common/UniformsGroup.d.ts +0 -152
- three/src/renderers/common/XRRenderTarget.d.ts +0 -67
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +0 -121
- three/src/renderers/common/nodes/NodeManager.d.ts +0 -309
- three/src/renderers/common/nodes/NodeSampledTexture.d.ts +0 -29
- three/src/renderers/common/nodes/NodeSampler.d.ts +0 -12
- three/src/renderers/common/nodes/NodeUniform.d.ts +0 -250
- three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +0 -41
- three/src/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +0 -6
- three/src/renderers/webgpu/nodes/WGSLNodeParser.d.ts +0 -6
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { Color } from "../../math/Color.js";
|
|
2
|
+
import { Matrix2 } from "../../math/Matrix2.js";
|
|
3
|
+
import { Matrix3 } from "../../math/Matrix3.js";
|
|
4
|
+
import { Matrix4 } from "../../math/Matrix4.js";
|
|
1
5
|
import { Vector2 } from "../../math/Vector2.js";
|
|
2
6
|
import { Vector3 } from "../../math/Vector3.js";
|
|
3
7
|
import { Vector4 } from "../../math/Vector4.js";
|
|
@@ -143,17 +147,33 @@ export default class MathNode extends TempNode {
|
|
|
143
147
|
}
|
|
144
148
|
|
|
145
149
|
type FloatOrNumber = Node<"float"> | number;
|
|
146
|
-
type IntOrNumber = Node<"int"> | number;
|
|
147
150
|
type FloatVector = Node<"vec2"> | Node<"vec3"> | Node<"vec4">;
|
|
148
151
|
type FloatVectorOrNumber = FloatOrNumber | Node<"vec2"> | Node<"vec3"> | Node<"vec4">;
|
|
149
152
|
|
|
150
|
-
type
|
|
153
|
+
type NumberVectorOrNumber =
|
|
154
|
+
| FloatVectorOrNumber
|
|
155
|
+
| Node<"int">
|
|
156
|
+
| Node<"uint">
|
|
157
|
+
| Node<"ivec2">
|
|
158
|
+
| Node<"ivec3">
|
|
159
|
+
| Node<"ivec4">
|
|
160
|
+
| Node<"uvec2">
|
|
161
|
+
| Node<"uvec3">
|
|
162
|
+
| Node<"uvec4">;
|
|
151
163
|
|
|
152
|
-
type
|
|
164
|
+
type Vec2 = Node<"vec2"> | Vector2;
|
|
165
|
+
type Vec3 = Node<"vec3"> | Vector3 | Node<"color"> | Color;
|
|
166
|
+
type Vec4 = Node<"vec4"> | Vector4;
|
|
153
167
|
|
|
154
|
-
type
|
|
155
|
-
type
|
|
156
|
-
type
|
|
168
|
+
type Vec2OrFloat = Vec2 | FloatOrNumber;
|
|
169
|
+
type Vec3OrFloat = Vec3 | FloatOrNumber;
|
|
170
|
+
type Vec4OrFloat = Vec4 | FloatOrNumber;
|
|
171
|
+
|
|
172
|
+
type Mat2 = Node<"mat2"> | Matrix2;
|
|
173
|
+
type Mat3 = Node<"mat3"> | Matrix3;
|
|
174
|
+
type Mat4 = Node<"mat4"> | Matrix4;
|
|
175
|
+
|
|
176
|
+
type Matrix = Mat2 | Mat3 | Mat4;
|
|
157
177
|
|
|
158
178
|
export const EPSILON: Node<"float">;
|
|
159
179
|
export const INFINITY: Node<"float">;
|
|
@@ -168,62 +188,52 @@ export const TWO_PI: Node<"float">;
|
|
|
168
188
|
|
|
169
189
|
export const HALF_PI: Node<"float">;
|
|
170
190
|
|
|
171
|
-
|
|
172
|
-
|
|
191
|
+
type BoolOrVector = Node<"bool"> | boolean | Node<"bvec2"> | Node<"bvec3"> | Node<"bvec4">;
|
|
192
|
+
|
|
193
|
+
export const all: (x: BoolOrVector) => Node<"bool">;
|
|
194
|
+
export const any: (x: BoolOrVector) => Node<"bool">;
|
|
173
195
|
declare module "../core/Node.js" {
|
|
174
|
-
interface
|
|
196
|
+
interface BoolOrVecExtensions<TNodeType> {
|
|
175
197
|
all: () => Node<"bool">;
|
|
176
198
|
any: () => Node<"bool">;
|
|
177
199
|
}
|
|
178
200
|
}
|
|
179
201
|
|
|
180
|
-
interface
|
|
202
|
+
interface UnaryFloatVecFunction {
|
|
181
203
|
(x: FloatOrNumber): Node<"float">;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
export const
|
|
187
|
-
export const
|
|
188
|
-
export const
|
|
189
|
-
export const
|
|
190
|
-
export const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
(x: Node<"vec4">): Node<"vec4">;
|
|
209
|
-
}
|
|
210
|
-
export const floor: FloorCeil;
|
|
211
|
-
export const ceil: FloorCeil;
|
|
212
|
-
declare module "../core/Node.js" {
|
|
213
|
-
interface FloatExtensions {
|
|
214
|
-
floor: () => Node<"float">;
|
|
215
|
-
ceil: () => Node<"float">;
|
|
216
|
-
}
|
|
217
|
-
interface FloatVecExtensions<TVec extends FloatVecType> {
|
|
218
|
-
floor: () => Node<TVec>;
|
|
219
|
-
ceil: () => Node<TVec>;
|
|
204
|
+
(x: Vec2): Node<"vec2">;
|
|
205
|
+
(x: Vec3): Node<"vec3">;
|
|
206
|
+
(x: Vec4): Node<"vec4">;
|
|
207
|
+
}
|
|
208
|
+
export const radians: UnaryFloatVecFunction;
|
|
209
|
+
export const degrees: UnaryFloatVecFunction;
|
|
210
|
+
export const exp: UnaryFloatVecFunction;
|
|
211
|
+
export const exp2: UnaryFloatVecFunction;
|
|
212
|
+
export const log: UnaryFloatVecFunction;
|
|
213
|
+
export const log2: UnaryFloatVecFunction;
|
|
214
|
+
export const sqrt: UnaryFloatVecFunction;
|
|
215
|
+
export const inverseSqrt: UnaryFloatVecFunction;
|
|
216
|
+
export const floor: UnaryFloatVecFunction;
|
|
217
|
+
export const ceil: UnaryFloatVecFunction;
|
|
218
|
+
declare module "../core/Node.js" {
|
|
219
|
+
interface FloatOrVecExtensions<TNodeType> {
|
|
220
|
+
radians: () => Node<TNodeType>;
|
|
221
|
+
degrees: () => Node<TNodeType>;
|
|
222
|
+
exp: () => Node<TNodeType>;
|
|
223
|
+
exp2: () => Node<TNodeType>;
|
|
224
|
+
log: () => Node<TNodeType>;
|
|
225
|
+
log2: () => Node<TNodeType>;
|
|
226
|
+
sqrt: () => Node<TNodeType>;
|
|
227
|
+
inverseSqrt: () => Node<TNodeType>;
|
|
228
|
+
floor: () => Node<TNodeType>;
|
|
229
|
+
ceil: () => Node<TNodeType>;
|
|
220
230
|
}
|
|
221
231
|
}
|
|
222
232
|
|
|
223
233
|
interface Normalize {
|
|
224
|
-
(x:
|
|
225
|
-
(x:
|
|
226
|
-
(x:
|
|
234
|
+
(x: Vec2): Node<"vec2">;
|
|
235
|
+
(x: Vec3): Node<"vec3">;
|
|
236
|
+
(x: Vec4): Node<"vec4">;
|
|
227
237
|
}
|
|
228
238
|
export const normalize: Normalize;
|
|
229
239
|
declare module "../core/Node.js" {
|
|
@@ -232,205 +242,181 @@ declare module "../core/Node.js" {
|
|
|
232
242
|
}
|
|
233
243
|
}
|
|
234
244
|
|
|
235
|
-
interface
|
|
236
|
-
(
|
|
237
|
-
(
|
|
238
|
-
(
|
|
239
|
-
(
|
|
240
|
-
}
|
|
241
|
-
|
|
245
|
+
interface ArcTanFunction {
|
|
246
|
+
(y: FloatOrNumber, x?: FloatOrNumber): Node<"float">;
|
|
247
|
+
(y: Vec2OrFloat, x?: Vec2OrFloat): Node<"vec2">;
|
|
248
|
+
(y: Vec3OrFloat, x?: Vec3OrFloat): Node<"vec3">;
|
|
249
|
+
(y: Vec4OrFloat, x?: Vec4OrFloat): Node<"vec4">;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export const fract: UnaryFloatVecFunction;
|
|
253
|
+
export const sin: UnaryFloatVecFunction;
|
|
254
|
+
export const sinh: UnaryFloatVecFunction;
|
|
255
|
+
export const cos: UnaryFloatVecFunction;
|
|
256
|
+
export const cosh: UnaryFloatVecFunction;
|
|
257
|
+
export const tan: UnaryFloatVecFunction;
|
|
258
|
+
export const tanh: UnaryFloatVecFunction;
|
|
259
|
+
export const asin: UnaryFloatVecFunction;
|
|
260
|
+
export const asinh: UnaryFloatVecFunction;
|
|
261
|
+
export const acos: UnaryFloatVecFunction;
|
|
262
|
+
export const acosh: UnaryFloatVecFunction;
|
|
263
|
+
export const atan: ArcTanFunction;
|
|
264
|
+
export const atanh: UnaryFloatVecFunction;
|
|
265
|
+
|
|
242
266
|
declare module "../core/Node.js" {
|
|
243
|
-
interface
|
|
244
|
-
fract: () => Node<
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
267
|
+
interface FloatOrVecExtensions<TNodeType> {
|
|
268
|
+
fract: () => Node<TNodeType>;
|
|
269
|
+
sin: () => Node<TNodeType>;
|
|
270
|
+
sinh: () => Node<TNodeType>;
|
|
271
|
+
cos: () => Node<TNodeType>;
|
|
272
|
+
cosh: () => Node<TNodeType>;
|
|
273
|
+
tan: () => Node<TNodeType>;
|
|
274
|
+
tanh: () => Node<TNodeType>;
|
|
275
|
+
asin: () => Node<TNodeType>;
|
|
276
|
+
asinh: () => Node<TNodeType>;
|
|
277
|
+
acos: () => Node<TNodeType>;
|
|
278
|
+
acosh: () => Node<TNodeType>;
|
|
279
|
+
atanh: () => Node<TNodeType>;
|
|
248
280
|
}
|
|
249
281
|
}
|
|
250
282
|
|
|
251
|
-
interface TrigonometricFunction {
|
|
252
|
-
(x: FloatOrNumber): Node<"float">;
|
|
253
|
-
(x: Node<"vec2">): Node<"vec2">;
|
|
254
|
-
(x: Node<"vec3">): Node<"vec3">;
|
|
255
|
-
(x: Node<"vec4">): Node<"vec4">;
|
|
256
|
-
}
|
|
257
|
-
interface ArcTanFunction {
|
|
258
|
-
(y: FloatOrNumber, x?: FloatOrNumber): Node<"float">;
|
|
259
|
-
(y: Node<"vec2">, x?: Vec2OrLessOrFloat): Node<"vec2">;
|
|
260
|
-
(y: Node<"vec3">, x?: Vec3OrLessOrFloat): Node<"vec3">;
|
|
261
|
-
(y: Node<"vec4">, x?: Vec4OrLessOrFloat): Node<"vec4">;
|
|
262
|
-
}
|
|
263
|
-
export const sin: TrigonometricFunction;
|
|
264
|
-
export const sinh: TrigonometricFunction;
|
|
265
|
-
export const cos: TrigonometricFunction;
|
|
266
|
-
export const cosh: TrigonometricFunction;
|
|
267
|
-
export const tan: TrigonometricFunction;
|
|
268
|
-
export const tanh: TrigonometricFunction;
|
|
269
|
-
export const asin: TrigonometricFunction;
|
|
270
|
-
export const asinh: TrigonometricFunction;
|
|
271
|
-
export const acos: TrigonometricFunction;
|
|
272
|
-
export const acosh: TrigonometricFunction;
|
|
273
|
-
export const atan: ArcTanFunction;
|
|
274
|
-
export const atanh: TrigonometricFunction;
|
|
275
283
|
declare module "../core/Node.js" {
|
|
276
284
|
interface FloatExtensions {
|
|
277
|
-
sin: () => Node<"float">;
|
|
278
|
-
sinh: () => Node<"float">;
|
|
279
|
-
cos: () => Node<"float">;
|
|
280
|
-
cosh: () => Node<"float">;
|
|
281
|
-
tan: () => Node<"float">;
|
|
282
|
-
tanh: () => Node<"float">;
|
|
283
|
-
asin: () => Node<"float">;
|
|
284
|
-
asinh: () => Node<"float">;
|
|
285
|
-
acos: () => Node<"float">;
|
|
286
|
-
acosh: () => Node<"float">;
|
|
287
285
|
atan: (x?: FloatOrNumber) => Node<"float">;
|
|
288
|
-
atanh: () => Node<"float">;
|
|
289
|
-
}
|
|
290
|
-
interface FloatVecExtensions<TVec extends FloatVecType> {
|
|
291
|
-
sin: () => Node<TVec>;
|
|
292
|
-
sinh: () => Node<TVec>;
|
|
293
|
-
cos: () => Node<TVec>;
|
|
294
|
-
cosh: () => Node<TVec>;
|
|
295
|
-
tan: () => Node<TVec>;
|
|
296
|
-
tanh: () => Node<TVec>;
|
|
297
|
-
asin: () => Node<TVec>;
|
|
298
|
-
asinh: () => Node<TVec>;
|
|
299
|
-
acos: () => Node<TVec>;
|
|
300
|
-
acosh: () => Node<TVec>;
|
|
301
|
-
atanh: () => Node<TVec>;
|
|
302
286
|
}
|
|
303
287
|
interface Vec2Extensions {
|
|
304
|
-
atan: (x?:
|
|
288
|
+
atan: (x?: Vec2OrFloat) => Node<"vec2">;
|
|
305
289
|
}
|
|
306
290
|
interface Vec3Extensions {
|
|
307
|
-
atan: (x?:
|
|
291
|
+
atan: (x?: Vec3OrFloat) => Node<"vec3">;
|
|
308
292
|
}
|
|
309
293
|
interface Vec4Extensions {
|
|
310
|
-
atan: (x?:
|
|
294
|
+
atan: (x?: Vec4OrFloat) => Node<"vec4">;
|
|
311
295
|
}
|
|
312
296
|
}
|
|
313
297
|
|
|
314
|
-
interface
|
|
298
|
+
interface UnaryNumVecFunction {
|
|
315
299
|
(x: FloatOrNumber): Node<"float">;
|
|
316
|
-
(x: Node<"
|
|
317
|
-
(x: Node<"
|
|
318
|
-
(x:
|
|
319
|
-
(x:
|
|
300
|
+
(x: Node<"int">): Node<"int">;
|
|
301
|
+
(x: Node<"uint">): Node<"uint">;
|
|
302
|
+
(x: Vec2): Node<"vec2">;
|
|
303
|
+
(x: Node<"ivec2">): Node<"ivec2">;
|
|
304
|
+
(x: Node<"uvec2">): Node<"uvec2">;
|
|
305
|
+
(x: Vec3): Node<"vec3">;
|
|
306
|
+
(x: Node<"ivec3">): Node<"ivec3">;
|
|
307
|
+
(x: Node<"uvec3">): Node<"uvec3">;
|
|
308
|
+
(x: Vec4): Node<"vec4">;
|
|
309
|
+
(x: Node<"ivec4">): Node<"ivec4">;
|
|
310
|
+
(x: Node<"uvec4">): Node<"uvec4">;
|
|
320
311
|
}
|
|
321
|
-
|
|
312
|
+
|
|
313
|
+
export const abs: UnaryNumVecFunction;
|
|
322
314
|
declare module "../core/Node.js" {
|
|
323
|
-
interface
|
|
324
|
-
abs: () => Node<
|
|
315
|
+
interface FloatOrVecExtensions<TNodeType> {
|
|
316
|
+
abs: () => Node<TNodeType>;
|
|
325
317
|
}
|
|
326
|
-
interface
|
|
327
|
-
abs: () => Node<
|
|
318
|
+
interface IntOrVecExtensions<TNodeType> {
|
|
319
|
+
abs: () => Node<TNodeType>;
|
|
328
320
|
}
|
|
329
|
-
interface
|
|
330
|
-
abs: () => Node<
|
|
321
|
+
interface UintOrVecExtensions<TNodeType> {
|
|
322
|
+
abs: () => Node<TNodeType>;
|
|
331
323
|
}
|
|
332
324
|
}
|
|
333
325
|
|
|
334
|
-
interface
|
|
326
|
+
interface SignFunction {
|
|
335
327
|
(x: FloatOrNumber): Node<"float">;
|
|
336
|
-
(x: Node<"
|
|
337
|
-
(x:
|
|
338
|
-
(x: Node<"
|
|
328
|
+
(x: Node<"int">): Node<"int">;
|
|
329
|
+
(x: Vec2): Node<"vec2">;
|
|
330
|
+
(x: Node<"ivec2">): Node<"ivec2">;
|
|
331
|
+
(x: Vec3): Node<"vec3">;
|
|
332
|
+
(x: Node<"ivec3">): Node<"ivec3">;
|
|
333
|
+
(x: Vec4): Node<"vec4">;
|
|
334
|
+
(x: Node<"ivec4">): Node<"ivec4">;
|
|
339
335
|
}
|
|
340
|
-
export const sign:
|
|
336
|
+
export const sign: SignFunction;
|
|
341
337
|
declare module "../core/Node.js" {
|
|
342
|
-
interface
|
|
343
|
-
sign: () => Node<
|
|
338
|
+
interface FloatOrVecExtensions<TNodeType> {
|
|
339
|
+
sign: () => Node<TNodeType>;
|
|
344
340
|
}
|
|
345
|
-
interface
|
|
346
|
-
sign: () => Node<
|
|
341
|
+
interface IntOrVecExtensions<TNodeType> {
|
|
342
|
+
sign: () => Node<TNodeType>;
|
|
347
343
|
}
|
|
348
344
|
}
|
|
349
345
|
|
|
350
|
-
export const length: (x:
|
|
346
|
+
export const length: (x: NumberVectorOrNumber) => Node<"float">;
|
|
351
347
|
declare module "../core/Node.js" {
|
|
352
|
-
interface
|
|
348
|
+
interface FloatOrVecExtensions<TNodeType> {
|
|
349
|
+
length: () => Node<"float">;
|
|
350
|
+
}
|
|
351
|
+
interface IntOrVecExtensions<TNodeType> {
|
|
353
352
|
length: () => Node<"float">;
|
|
354
353
|
}
|
|
355
354
|
}
|
|
356
355
|
|
|
357
|
-
interface
|
|
356
|
+
interface NegateFunction {
|
|
358
357
|
(x: FloatOrNumber): Node<"float">;
|
|
359
|
-
(x: Node<"
|
|
360
|
-
(x:
|
|
361
|
-
(x: Node<"
|
|
358
|
+
(x: Node<"int">): Node<"int">;
|
|
359
|
+
(x: Vec2): Node<"vec2">;
|
|
360
|
+
(x: Node<"ivec2">): Node<"ivec2">;
|
|
361
|
+
(x: Vec3): Node<"vec3">;
|
|
362
|
+
(x: Node<"ivec3">): Node<"ivec3">;
|
|
363
|
+
(x: Vec4): Node<"vec4">;
|
|
364
|
+
(x: Node<"ivec4">): Node<"ivec4">;
|
|
362
365
|
}
|
|
363
|
-
export const negate:
|
|
366
|
+
export const negate: NegateFunction;
|
|
364
367
|
declare module "../core/Node.js" {
|
|
365
|
-
interface
|
|
366
|
-
negate: () => Node<
|
|
368
|
+
interface FloatOrVecExtensions<TNodeType> {
|
|
369
|
+
negate: () => Node<TNodeType>;
|
|
367
370
|
}
|
|
368
|
-
interface
|
|
369
|
-
negate: () => Node<
|
|
371
|
+
interface IntOrVecExtensions<TNodeType> {
|
|
372
|
+
negate: () => Node<TNodeType>;
|
|
370
373
|
}
|
|
371
374
|
}
|
|
372
375
|
|
|
373
|
-
|
|
374
|
-
(x: FloatOrNumber): Node<"float">;
|
|
375
|
-
(x: Node<"vec2">): Node<"vec2">;
|
|
376
|
-
(x: Node<"vec3">): Node<"vec3">;
|
|
377
|
-
(x: Node<"vec4">): Node<"vec4">;
|
|
378
|
-
}
|
|
379
|
-
export const oneMinus: OneMinus;
|
|
376
|
+
export const oneMinus: UnaryFloatVecFunction;
|
|
380
377
|
declare module "../core/Node.js" {
|
|
381
|
-
interface
|
|
382
|
-
oneMinus: () => Node<
|
|
383
|
-
}
|
|
384
|
-
interface FloatVecExtensions<TVec extends FloatVecType> {
|
|
385
|
-
oneMinus: () => Node<TVec>;
|
|
378
|
+
interface FloatOrVecExtensions<TNodeType> {
|
|
379
|
+
oneMinus: () => Node<TNodeType>;
|
|
386
380
|
}
|
|
387
381
|
}
|
|
388
382
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
(x: Node<"vec3">): Node<"vec3">;
|
|
392
|
-
(x: Node<"vec4">): Node<"vec4">;
|
|
393
|
-
}
|
|
394
|
-
export const dFdx: Derivative;
|
|
395
|
-
export const dFdy: Derivative;
|
|
383
|
+
export const dFdx: UnaryFloatVecFunction;
|
|
384
|
+
export const dFdy: UnaryFloatVecFunction;
|
|
396
385
|
declare module "../core/Node.js" {
|
|
397
|
-
interface
|
|
398
|
-
dFdx: () => Node<
|
|
399
|
-
dFdy: () => Node<
|
|
386
|
+
interface FloatOrVecExtensions<TNodeType> {
|
|
387
|
+
dFdx: () => Node<TNodeType>;
|
|
388
|
+
dFdy: () => Node<TNodeType>;
|
|
400
389
|
}
|
|
401
390
|
}
|
|
402
391
|
|
|
403
|
-
export const round:
|
|
404
|
-
export const reciprocal: (x: FloatOrNumber) => Node<"float">;
|
|
405
|
-
export const trunc: (x: FloatOrNumber) => Node<"float">;
|
|
392
|
+
export const round: UnaryNumVecFunction;
|
|
406
393
|
declare module "../core/Node.js" {
|
|
407
|
-
interface
|
|
408
|
-
round: () => Node<
|
|
409
|
-
|
|
410
|
-
|
|
394
|
+
interface FloatOrVecExtensions<TNodeType> {
|
|
395
|
+
round: () => Node<TNodeType>;
|
|
396
|
+
}
|
|
397
|
+
interface IntOrVecExtensions<TNodeType> {
|
|
398
|
+
round: () => Node<TNodeType>;
|
|
399
|
+
}
|
|
400
|
+
interface UintOrVecExtensions<TNodeType> {
|
|
401
|
+
round: () => Node<TNodeType>;
|
|
411
402
|
}
|
|
412
403
|
}
|
|
413
404
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
(x: Node<"vec3">): Node<"vec3">;
|
|
418
|
-
(x: Node<"vec4">): Node<"vec4">;
|
|
419
|
-
}
|
|
420
|
-
export const fwidth: Fwidth;
|
|
405
|
+
export const reciprocal: UnaryFloatVecFunction;
|
|
406
|
+
export const trunc: UnaryFloatVecFunction;
|
|
407
|
+
export const fwidth: UnaryFloatVecFunction;
|
|
421
408
|
declare module "../core/Node.js" {
|
|
422
|
-
interface
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
fwidth: () => Node<TVec>;
|
|
409
|
+
interface FloatOrVecExtensions<TNodeType> {
|
|
410
|
+
reciprocal: () => Node<TNodeType>;
|
|
411
|
+
trunc: () => Node<TNodeType>;
|
|
412
|
+
fwidth: () => Node<TNodeType>;
|
|
427
413
|
}
|
|
428
414
|
}
|
|
429
415
|
|
|
430
416
|
interface Transpose {
|
|
431
|
-
(x:
|
|
432
|
-
(x:
|
|
433
|
-
(x:
|
|
417
|
+
(x: Mat2): Node<"mat2">;
|
|
418
|
+
(x: Mat3): Node<"mat3">;
|
|
419
|
+
(x: Mat4): Node<"mat4">;
|
|
434
420
|
}
|
|
435
421
|
export const transpose: Transpose;
|
|
436
422
|
declare module "../core/Node.js" {
|
|
@@ -447,9 +433,9 @@ declare module "../core/Node.js" {
|
|
|
447
433
|
}
|
|
448
434
|
|
|
449
435
|
interface Inverse {
|
|
450
|
-
(x:
|
|
451
|
-
(x:
|
|
452
|
-
(x:
|
|
436
|
+
(x: Mat2): Node<"mat2">;
|
|
437
|
+
(x: Mat3): Node<"mat3">;
|
|
438
|
+
(x: Mat4): Node<"mat4">;
|
|
453
439
|
}
|
|
454
440
|
export const inverse: Inverse;
|
|
455
441
|
declare module "../core/Node.js" {
|
|
@@ -458,31 +444,32 @@ declare module "../core/Node.js" {
|
|
|
458
444
|
}
|
|
459
445
|
}
|
|
460
446
|
|
|
447
|
+
// TODO Allow int/uint
|
|
461
448
|
interface MinMax {
|
|
462
449
|
(x: FloatOrNumber, y: FloatOrNumber, ...params: FloatOrNumber[]): Node<"float">;
|
|
463
|
-
(x:
|
|
464
|
-
(x:
|
|
465
|
-
(x:
|
|
450
|
+
(x: Vec2OrFloat, y: Vec2OrFloat, ...params: Vec2OrFloat[]): Node<"vec2">;
|
|
451
|
+
(x: Vec3OrFloat, y: Vec3OrFloat, ...params: Vec3OrFloat[]): Node<"vec3">;
|
|
452
|
+
(x: Vec4OrFloat, y: Vec4OrFloat, ...params: Vec4OrFloat[]): Node<"vec4">;
|
|
466
453
|
}
|
|
467
454
|
export const min: MinMax;
|
|
468
455
|
export const max: MinMax;
|
|
469
456
|
interface MinMaxFloatExtension {
|
|
470
457
|
(y: FloatOrNumber, ...params: FloatOrNumber[]): Node<"float">;
|
|
471
|
-
(y:
|
|
472
|
-
(y:
|
|
473
|
-
(y:
|
|
458
|
+
(y: Vec2OrFloat, ...params: Vec2OrFloat[]): Node<"vec2">;
|
|
459
|
+
(y: Vec3OrFloat, ...params: Vec3OrFloat[]): Node<"vec3">;
|
|
460
|
+
(y: Vec4OrFloat, ...params: Vec4OrFloat[]): Node<"vec4">;
|
|
474
461
|
}
|
|
475
462
|
interface MinMaxVec2Extension {
|
|
476
|
-
(y:
|
|
477
|
-
(y:
|
|
478
|
-
(y:
|
|
463
|
+
(y: Vec2OrFloat, ...params: Vec2OrFloat[]): Node<"vec2">;
|
|
464
|
+
(y: Vec3OrFloat, ...params: Vec3OrFloat[]): Node<"vec3">;
|
|
465
|
+
(y: Vec4OrFloat, ...params: Vec4OrFloat[]): Node<"vec4">;
|
|
479
466
|
}
|
|
480
467
|
interface MinMaxVec3Extension {
|
|
481
|
-
(y:
|
|
482
|
-
(y:
|
|
468
|
+
(y: Vec3OrFloat, ...params: Vec3OrFloat[]): Node<"vec3">;
|
|
469
|
+
(y: Vec4OrFloat, ...params: Vec4OrFloat[]): Node<"vec4">;
|
|
483
470
|
}
|
|
484
471
|
interface MinMaxVec4Extension {
|
|
485
|
-
(y:
|
|
472
|
+
(y: Vec4OrFloat, ...params: Vec4OrFloat[]): Node<"vec4">;
|
|
486
473
|
}
|
|
487
474
|
declare module "../core/Node.js" {
|
|
488
475
|
interface FloatExtensions {
|
|
@@ -503,25 +490,28 @@ declare module "../core/Node.js" {
|
|
|
503
490
|
}
|
|
504
491
|
}
|
|
505
492
|
|
|
506
|
-
|
|
493
|
+
interface Step {
|
|
494
|
+
(edge: FloatOrNumber, x: FloatOrNumber): Node<"float">;
|
|
495
|
+
(edge: Vec2OrFloat, x: Vec2OrFloat): Node<"vec2">;
|
|
496
|
+
(edge: Vec3OrFloat, x: Vec3OrFloat): Node<"vec3">;
|
|
497
|
+
(edge: Vec4OrFloat, x: Vec4OrFloat): Node<"vec4">;
|
|
498
|
+
}
|
|
499
|
+
export const step: Step;
|
|
507
500
|
|
|
508
501
|
interface Reflect {
|
|
509
|
-
(I:
|
|
510
|
-
(I:
|
|
511
|
-
(I:
|
|
502
|
+
(I: Vec2OrFloat, N: Vec2OrFloat): Node<"vec2">;
|
|
503
|
+
(I: Vec3OrFloat, N: Vec3OrFloat): Node<"vec3">;
|
|
504
|
+
(I: Vec4OrFloat, N: Vec4OrFloat): Node<"vec4">;
|
|
512
505
|
}
|
|
513
506
|
export const reflect: Reflect;
|
|
514
507
|
interface ReflectVec2Extension {
|
|
515
|
-
(N:
|
|
516
|
-
(N: Vec3OrLessOrFloat): Node<"vec3">;
|
|
517
|
-
(N: Vec4OrLessOrFloat): Node<"vec4">;
|
|
508
|
+
(N: Vec2OrFloat): Node<"vec2">;
|
|
518
509
|
}
|
|
519
510
|
interface ReflectVec3Extension {
|
|
520
|
-
(N:
|
|
521
|
-
(N: Vec4OrLessOrFloat): Node<"vec4">;
|
|
511
|
+
(N: Vec3OrFloat): Node<"vec3">;
|
|
522
512
|
}
|
|
523
513
|
interface ReflectVec4Extension {
|
|
524
|
-
(N:
|
|
514
|
+
(N: Vec4OrFloat): Node<"vec4">;
|
|
525
515
|
}
|
|
526
516
|
declare module "../core/Node.js" {
|
|
527
517
|
interface Vec2Extensions {
|
|
@@ -537,38 +527,33 @@ declare module "../core/Node.js" {
|
|
|
537
527
|
|
|
538
528
|
export const distance: (x: FloatVectorOrNumber, y: FloatVectorOrNumber) => Node<"float">;
|
|
539
529
|
declare module "../core/Node.js" {
|
|
540
|
-
interface
|
|
541
|
-
distance: (y: FloatVectorOrNumber) => Node<"float">;
|
|
542
|
-
}
|
|
543
|
-
interface FloatVecExtensions<TVec extends FloatVecType> {
|
|
530
|
+
interface FloatOrVecExtensions<TNodeType> {
|
|
544
531
|
distance: (y: FloatVectorOrNumber) => Node<"float">;
|
|
545
532
|
}
|
|
546
533
|
}
|
|
547
534
|
|
|
535
|
+
// TODO Allow int/uint
|
|
548
536
|
interface Difference {
|
|
549
537
|
(x: FloatOrNumber, y: FloatOrNumber): Node<"float">;
|
|
550
|
-
(x:
|
|
551
|
-
(x:
|
|
552
|
-
(x:
|
|
538
|
+
(x: Vec2OrFloat, y: Vec2OrFloat): Node<"vec2">;
|
|
539
|
+
(x: Vec3OrFloat, y: Vec3OrFloat): Node<"vec3">;
|
|
540
|
+
(x: Vec4OrFloat, y: Vec4OrFloat): Node<"vec4">;
|
|
553
541
|
}
|
|
554
542
|
export const difference: Difference;
|
|
555
543
|
interface DifferenceFloatExtension {
|
|
556
544
|
(y: FloatOrNumber): Node<"float">;
|
|
557
|
-
(y:
|
|
558
|
-
(y:
|
|
559
|
-
(y:
|
|
545
|
+
(y: Vec2OrFloat): Node<"vec2">;
|
|
546
|
+
(y: Vec3OrFloat): Node<"vec3">;
|
|
547
|
+
(y: Vec4OrFloat): Node<"vec4">;
|
|
560
548
|
}
|
|
561
549
|
interface DifferenceVec2Extension {
|
|
562
|
-
(y:
|
|
563
|
-
(y: Vec3OrLessOrFloat): Node<"vec3">;
|
|
564
|
-
(y: Vec4OrLessOrFloat): Node<"vec4">;
|
|
550
|
+
(y: Vec2OrFloat): Node<"vec2">;
|
|
565
551
|
}
|
|
566
552
|
interface DifferenceVec3Extension {
|
|
567
|
-
(y:
|
|
568
|
-
(y: Vec4OrLessOrFloat): Node<"vec4">;
|
|
553
|
+
(y: Vec3OrFloat): Node<"vec3">;
|
|
569
554
|
}
|
|
570
555
|
interface DifferenceVec4Extension {
|
|
571
|
-
(y:
|
|
556
|
+
(y: Vec4OrFloat): Node<"vec4">;
|
|
572
557
|
}
|
|
573
558
|
declare module "../core/Node.js" {
|
|
574
559
|
interface FloatExtensions {
|
|
@@ -585,6 +570,7 @@ declare module "../core/Node.js" {
|
|
|
585
570
|
}
|
|
586
571
|
}
|
|
587
572
|
|
|
573
|
+
// TODO Allow int/uint
|
|
588
574
|
export const dot: (x: FloatVector, y: FloatVector) => Node<"float">;
|
|
589
575
|
declare module "../core/Node.js" {
|
|
590
576
|
interface FloatVecExtensions<TVec extends FloatVecType> {
|
|
@@ -592,55 +578,95 @@ declare module "../core/Node.js" {
|
|
|
592
578
|
}
|
|
593
579
|
}
|
|
594
580
|
|
|
595
|
-
export const cross: (x:
|
|
581
|
+
export const cross: (x: Vec3, y: Vec3) => Node<"vec3">;
|
|
596
582
|
declare module "../core/Node.js" {
|
|
597
583
|
interface Vec3Extensions {
|
|
598
|
-
cross: (y:
|
|
584
|
+
cross: (y: Vec3) => Node<"vec3">;
|
|
599
585
|
}
|
|
600
586
|
}
|
|
601
587
|
|
|
602
588
|
interface Pow {
|
|
603
589
|
(x: FloatOrNumber, y: FloatOrNumber): Node<"float">;
|
|
604
|
-
(x:
|
|
605
|
-
(x:
|
|
606
|
-
(x:
|
|
590
|
+
(x: Vec2OrFloat, y: Vec2OrFloat): Node<"vec2">;
|
|
591
|
+
(x: Vec3OrFloat, y: Vec3OrFloat): Node<"vec3">;
|
|
592
|
+
(x: Vec4OrFloat, y: Vec4OrFloat): Node<"vec4">;
|
|
593
|
+
}
|
|
594
|
+
export const pow: Pow;
|
|
595
|
+
interface PowFloatExtension {
|
|
596
|
+
(y: FloatOrNumber): Node<"float">;
|
|
597
|
+
(y: Vec2OrFloat): Node<"vec2">;
|
|
598
|
+
(y: Vec3OrFloat): Node<"vec3">;
|
|
599
|
+
(y: Vec4OrFloat): Node<"vec4">;
|
|
600
|
+
}
|
|
601
|
+
interface PowVec2Extension {
|
|
602
|
+
(y: Vec2OrFloat): Node<"vec2">;
|
|
603
|
+
}
|
|
604
|
+
interface PowVec3Extension {
|
|
605
|
+
(y: Vec3OrFloat): Node<"vec3">;
|
|
606
|
+
}
|
|
607
|
+
interface PowVec4Extension {
|
|
608
|
+
(y: Vec4OrFloat): Node<"vec4">;
|
|
607
609
|
}
|
|
608
|
-
export const pow: (x: FloatOrNumber, y: FloatOrNumber) => Node<"float">;
|
|
609
610
|
declare module "../core/Node.js" {
|
|
610
611
|
interface FloatExtensions {
|
|
611
|
-
pow:
|
|
612
|
+
pow: PowFloatExtension;
|
|
612
613
|
}
|
|
613
|
-
interface
|
|
614
|
-
pow:
|
|
614
|
+
interface Vec2Extensions {
|
|
615
|
+
pow: PowVec2Extension;
|
|
616
|
+
}
|
|
617
|
+
interface Vec3Extensions {
|
|
618
|
+
pow: PowVec3Extension;
|
|
619
|
+
}
|
|
620
|
+
interface Vec4Extensions {
|
|
621
|
+
pow: PowVec4Extension;
|
|
615
622
|
}
|
|
616
623
|
}
|
|
617
624
|
|
|
618
625
|
interface PowConstant {
|
|
619
626
|
(x: FloatOrNumber): Node<"float">;
|
|
620
|
-
(x:
|
|
621
|
-
(x:
|
|
622
|
-
(x:
|
|
627
|
+
(x: Vec2): Node<"vec2">;
|
|
628
|
+
(x: Vec3): Node<"vec3">;
|
|
629
|
+
(x: Vec4): Node<"vec4">;
|
|
623
630
|
}
|
|
624
631
|
export const pow2: PowConstant;
|
|
625
632
|
export const pow3: PowConstant;
|
|
626
633
|
export const pow4: PowConstant;
|
|
627
634
|
declare module "../core/Node.js" {
|
|
628
|
-
interface
|
|
629
|
-
pow2: () => Node<
|
|
630
|
-
pow3: () => Node<
|
|
631
|
-
pow4: () => Node<
|
|
635
|
+
interface FloatOrVecExtensions<TNodeType> {
|
|
636
|
+
pow2: () => Node<TNodeType>;
|
|
637
|
+
pow3: () => Node<TNodeType>;
|
|
638
|
+
pow4: () => Node<TNodeType>;
|
|
632
639
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
interface TransformDirection {
|
|
643
|
+
(direction: Vec3, matrix: Mat3 | Mat4): Node<"vec3">;
|
|
644
|
+
(matrix: Mat3 | Mat4, direction: Vec3): Node<"vec3">;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
export const transformDirection: TransformDirection;
|
|
648
|
+
declare module "../core/Node.js" {
|
|
649
|
+
interface Vec3Extensions {
|
|
650
|
+
transformDirection: (matrix: Mat3 | Mat4) => Node<"vec3">;
|
|
651
|
+
}
|
|
652
|
+
interface Mat3Extensions {
|
|
653
|
+
transformDirection: (direction: Vec3) => Node<"vec3">;
|
|
654
|
+
}
|
|
655
|
+
interface Mat4Extensions {
|
|
656
|
+
transformDirection: (direction: Vec3) => Node<"vec3">;
|
|
637
657
|
}
|
|
638
658
|
}
|
|
639
659
|
|
|
640
|
-
|
|
660
|
+
interface TransformNormalByViewMatrix {
|
|
661
|
+
(normal: Vec3, viewMatrix: Mat3 | Mat4): Node<"vec3">;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
export const transformNormalByViewMatrix: TransformNormalByViewMatrix;
|
|
665
|
+
export const transformNormalByInverseViewMatrix: TransformNormalByViewMatrix;
|
|
641
666
|
declare module "../core/Node.js" {
|
|
642
667
|
interface Vec3Extensions {
|
|
643
|
-
|
|
668
|
+
transformNormalByViewMatrix: (matrix: Mat3 | Mat4) => Node<"vec3">;
|
|
669
|
+
transformNormalByInverseViewMatrix: (matrix: Mat3 | Mat4) => Node<"vec3">;
|
|
644
670
|
}
|
|
645
671
|
}
|
|
646
672
|
|
|
@@ -660,36 +686,34 @@ declare module "../core/Node.js" {
|
|
|
660
686
|
|
|
661
687
|
interface Mix {
|
|
662
688
|
(a: FloatOrNumber, b: FloatOrNumber, t: FloatOrNumber): Node<"float">;
|
|
663
|
-
(a:
|
|
664
|
-
(a:
|
|
665
|
-
(a:
|
|
689
|
+
(a: Vec2OrFloat, b: Vec2OrFloat, t: FloatOrNumber): Node<"vec2">;
|
|
690
|
+
(a: Vec3OrFloat, b: Vec3OrFloat, t: FloatOrNumber): Node<"vec3">;
|
|
691
|
+
(a: Vec4OrFloat | Vec3, b: Vec4OrFloat | Vec3, t: FloatOrNumber): Node<"vec4">;
|
|
666
692
|
}
|
|
667
693
|
export const mix: Mix;
|
|
668
694
|
|
|
695
|
+
// TODO Allow int/uint
|
|
669
696
|
interface Clamp {
|
|
670
697
|
(value: FloatOrNumber, low?: FloatOrNumber, high?: FloatOrNumber): Node<"float">;
|
|
671
|
-
(value:
|
|
672
|
-
(value:
|
|
673
|
-
(value:
|
|
698
|
+
(value: Vec2OrFloat, low?: Vec2OrFloat, high?: Vec2OrFloat): Node<"vec2">;
|
|
699
|
+
(value: Vec3OrFloat, low?: Vec3OrFloat, high?: Vec3OrFloat): Node<"vec3">;
|
|
700
|
+
(value: Vec4OrFloat, low?: Vec4OrFloat, high?: Vec4OrFloat): Node<"vec4">;
|
|
674
701
|
}
|
|
675
702
|
export const clamp: Clamp;
|
|
676
703
|
interface ClampFloatExtension {
|
|
677
704
|
(low?: FloatOrNumber, high?: FloatOrNumber): Node<"float">;
|
|
678
|
-
(low?:
|
|
679
|
-
(low?:
|
|
680
|
-
(low?:
|
|
705
|
+
(low?: Vec2OrFloat, high?: Vec2OrFloat): Node<"vec2">;
|
|
706
|
+
(low?: Vec3OrFloat, high?: Vec3OrFloat): Node<"vec3">;
|
|
707
|
+
(low?: Vec4OrFloat, high?: Vec4OrFloat): Node<"vec4">;
|
|
681
708
|
}
|
|
682
709
|
interface ClampVec2Extension {
|
|
683
|
-
(low?:
|
|
684
|
-
(low?: Vec3OrLessOrFloat, high?: Vec3OrLessOrFloat): Node<"vec3">;
|
|
685
|
-
(low?: Vec4OrLessOrFloat, high?: Vec4OrLessOrFloat): Node<"vec4">;
|
|
710
|
+
(low?: Vec2OrFloat, high?: Vec2OrFloat): Node<"vec2">;
|
|
686
711
|
}
|
|
687
712
|
interface ClampVec3Extension {
|
|
688
|
-
(low?:
|
|
689
|
-
(low?: Vec4OrLessOrFloat, high?: Vec4OrLessOrFloat): Node<"vec4">;
|
|
713
|
+
(low?: Vec3OrFloat, high?: Vec3OrFloat): Node<"vec3">;
|
|
690
714
|
}
|
|
691
715
|
interface ClampVec4Extension {
|
|
692
|
-
(low?:
|
|
716
|
+
(low?: Vec4OrFloat, high?: Vec4OrFloat): Node<"vec4">;
|
|
693
717
|
}
|
|
694
718
|
declare module "../core/Node.js" {
|
|
695
719
|
interface FloatExtensions {
|
|
@@ -708,37 +732,31 @@ declare module "../core/Node.js" {
|
|
|
708
732
|
|
|
709
733
|
interface Saturate {
|
|
710
734
|
(value: FloatOrNumber): Node<"float">;
|
|
711
|
-
(value:
|
|
712
|
-
(value:
|
|
713
|
-
(value:
|
|
735
|
+
(value: Vec2): Node<"vec2">;
|
|
736
|
+
(value: Vec3): Node<"vec3">;
|
|
737
|
+
(value: Vec4): Node<"vec4">;
|
|
714
738
|
}
|
|
715
739
|
export const saturate: Saturate;
|
|
716
740
|
declare module "../core/Node.js" {
|
|
717
|
-
interface
|
|
718
|
-
saturate: () => Node<
|
|
719
|
-
}
|
|
720
|
-
interface FloatVecExtensions<TVec extends FloatVecType> {
|
|
721
|
-
saturate: () => Node<TVec>;
|
|
741
|
+
interface FloatOrVecExtensions<TNodeType> {
|
|
742
|
+
saturate: () => Node<TNodeType>;
|
|
722
743
|
}
|
|
723
744
|
}
|
|
724
745
|
|
|
725
746
|
interface Refract {
|
|
726
|
-
(I:
|
|
727
|
-
(I:
|
|
728
|
-
(I:
|
|
747
|
+
(I: Vec2OrFloat, N: Vec2OrFloat, ratio: FloatOrNumber): Node<"vec2">;
|
|
748
|
+
(I: Vec3OrFloat, N: Vec3OrFloat, ratio: FloatOrNumber): Node<"vec3">;
|
|
749
|
+
(I: Vec4OrFloat, N: Vec4OrFloat, ratio: FloatOrNumber): Node<"vec4">;
|
|
729
750
|
}
|
|
730
751
|
export const refract: Refract;
|
|
731
752
|
interface RefractVec2Extension {
|
|
732
|
-
(N:
|
|
733
|
-
(N: Vec3OrLessOrFloat, ratio: FloatOrNumber): Node<"vec3">;
|
|
734
|
-
(N: Vec4OrLessOrFloat, ratio: FloatOrNumber): Node<"vec4">;
|
|
753
|
+
(N: Vec2OrFloat, ratio: FloatOrNumber): Node<"vec2">;
|
|
735
754
|
}
|
|
736
755
|
interface RefractVec3Extension {
|
|
737
|
-
(N:
|
|
738
|
-
(N: Vec4OrLessOrFloat, ratio: FloatOrNumber): Node<"vec4">;
|
|
756
|
+
(N: Vec3OrFloat, ratio: FloatOrNumber): Node<"vec3">;
|
|
739
757
|
}
|
|
740
758
|
interface RefractVec4Extension {
|
|
741
|
-
(N:
|
|
759
|
+
(N: Vec4OrFloat, ratio: FloatOrNumber): Node<"vec4">;
|
|
742
760
|
}
|
|
743
761
|
declare module "../core/Node.js" {
|
|
744
762
|
interface Vec2Extensions {
|
|
@@ -754,26 +772,26 @@ declare module "../core/Node.js" {
|
|
|
754
772
|
|
|
755
773
|
interface Smoothstep {
|
|
756
774
|
(low: FloatOrNumber, high: FloatOrNumber, x: FloatOrNumber): Node<"float">;
|
|
775
|
+
(low: Vec2OrFloat, high: Vec2OrFloat, x: Vec2OrFloat): Node<"vec2">;
|
|
776
|
+
(low: Vec3OrFloat, high: Vec3OrFloat, x: Vec3OrFloat): Node<"vec3">;
|
|
777
|
+
(low: Vec4OrFloat, high: Vec4OrFloat, x: Vec4OrFloat): Node<"vec4">;
|
|
757
778
|
}
|
|
758
779
|
export const smoothstep: Smoothstep;
|
|
759
780
|
|
|
760
781
|
interface FaceForward {
|
|
761
|
-
(N:
|
|
762
|
-
(N:
|
|
763
|
-
(N:
|
|
782
|
+
(N: Vec2OrFloat, I: Vec2OrFloat, Nref: Vec2OrFloat): Node<"vec2">;
|
|
783
|
+
(N: Vec3OrFloat, I: Vec3OrFloat, Nref: Vec3OrFloat): Node<"vec3">;
|
|
784
|
+
(N: Vec4OrFloat, I: Vec4OrFloat, Nref: Vec4OrFloat): Node<"vec4">;
|
|
764
785
|
}
|
|
765
786
|
export const faceForward: FaceForward;
|
|
766
787
|
interface FaceForwardVec2Extension {
|
|
767
|
-
(I:
|
|
768
|
-
(I: Vec3OrLessOrFloat, Nref: Vec3OrLessOrFloat): Node<"vec3">;
|
|
769
|
-
(I: Vec4OrLessOrFloat, Nref: Vec4OrLessOrFloat): Node<"vec4">;
|
|
788
|
+
(I: Vec2OrFloat, Nref: Vec2OrFloat): Node<"vec2">;
|
|
770
789
|
}
|
|
771
790
|
interface FaceForwardVec3Extension {
|
|
772
|
-
(N:
|
|
773
|
-
(N: Vec4OrLessOrFloat, ratio: Vec4OrLessOrFloat): Node<"vec4">;
|
|
791
|
+
(N: Vec3OrFloat, ratio: Vec3OrFloat): Node<"vec3">;
|
|
774
792
|
}
|
|
775
793
|
interface FaceForwardVec4Extension {
|
|
776
|
-
(N:
|
|
794
|
+
(N: Vec4OrFloat, ratio: Vec4OrFloat): Node<"vec4">;
|
|
777
795
|
}
|
|
778
796
|
declare module "../core/Node.js" {
|
|
779
797
|
interface Vec2Extensions {
|
|
@@ -787,7 +805,7 @@ declare module "../core/Node.js" {
|
|
|
787
805
|
}
|
|
788
806
|
}
|
|
789
807
|
|
|
790
|
-
export const rand: (uv:
|
|
808
|
+
export const rand: (uv: Vec2) => Node<"float">;
|
|
791
809
|
declare module "../core/Node.js" {
|
|
792
810
|
interface Vec2Extensions {
|
|
793
811
|
rand: () => Node<"float">;
|
|
@@ -796,16 +814,16 @@ declare module "../core/Node.js" {
|
|
|
796
814
|
|
|
797
815
|
interface MixElement {
|
|
798
816
|
(t: FloatOrNumber, e1: FloatOrNumber, e2: FloatOrNumber): Node<"float">;
|
|
799
|
-
(t: FloatOrNumber, e1:
|
|
800
|
-
(t: FloatOrNumber, e1:
|
|
801
|
-
(t: FloatOrNumber, e1:
|
|
817
|
+
(t: FloatOrNumber, e1: Vec2OrFloat, e2: Vec2OrFloat): Node<"vec2">;
|
|
818
|
+
(t: FloatOrNumber, e1: Vec3OrFloat, e2: Vec3OrFloat): Node<"vec3">;
|
|
819
|
+
(t: FloatOrNumber, e1: Vec4OrFloat | Vec3, e2: Vec4OrFloat | Vec3): Node<"vec4">;
|
|
802
820
|
}
|
|
803
821
|
export const mixElement: MixElement;
|
|
804
822
|
interface MixExtension {
|
|
805
823
|
(e1: FloatOrNumber, e2: FloatOrNumber): Node<"float">;
|
|
806
|
-
(e1:
|
|
807
|
-
(e1:
|
|
808
|
-
(e1:
|
|
824
|
+
(e1: Vec2OrFloat, e2: Vec2OrFloat): Node<"vec2">;
|
|
825
|
+
(e1: Vec3OrFloat, e2: Vec3OrFloat): Node<"vec3">;
|
|
826
|
+
(e1: Vec4OrFloat | Vec3, e2: Vec4OrFloat | Vec3): Node<"vec4">;
|
|
809
827
|
}
|
|
810
828
|
declare module "../core/Node.js" {
|
|
811
829
|
interface FloatExtensions {
|
|
@@ -815,22 +833,58 @@ declare module "../core/Node.js" {
|
|
|
815
833
|
|
|
816
834
|
interface SmoothstepElement {
|
|
817
835
|
(x: FloatOrNumber, low: FloatOrNumber, high: FloatOrNumber): Node<"float">;
|
|
836
|
+
(x: Vec2OrFloat, low: Vec2OrFloat, high: Vec2OrFloat): Node<"vec2">;
|
|
837
|
+
(x: Vec3OrFloat, low: Vec3OrFloat, high: Vec3OrFloat): Node<"vec3">;
|
|
838
|
+
(x: Vec4OrFloat, low: Vec4OrFloat, high: Vec4OrFloat): Node<"vec4">;
|
|
818
839
|
}
|
|
819
840
|
export const smoothstepElement: SmoothstepElement;
|
|
820
|
-
interface
|
|
841
|
+
interface SmoothstepFloatExtension {
|
|
821
842
|
(low: FloatOrNumber, high: FloatOrNumber): Node<"float">;
|
|
822
843
|
}
|
|
844
|
+
interface SmoothstepVec2Extension {
|
|
845
|
+
(low: Vec2OrFloat, high: Vec2OrFloat): Node<"vec2">;
|
|
846
|
+
}
|
|
847
|
+
interface SmoothstepVec3Extension {
|
|
848
|
+
(low: Vec3OrFloat, high: Vec3OrFloat): Node<"vec3">;
|
|
849
|
+
}
|
|
850
|
+
interface SmoothstepVec4Extension {
|
|
851
|
+
(low: Vec4OrFloat, high: Vec4OrFloat): Node<"vec4">;
|
|
852
|
+
}
|
|
823
853
|
declare module "../core/Node.js" {
|
|
824
854
|
interface FloatExtensions {
|
|
825
|
-
smoothstep:
|
|
855
|
+
smoothstep: SmoothstepFloatExtension;
|
|
856
|
+
}
|
|
857
|
+
interface Vec2Extensions {
|
|
858
|
+
smoothstep: SmoothstepVec2Extension;
|
|
859
|
+
}
|
|
860
|
+
interface Vec3Extensions {
|
|
861
|
+
smoothstep: SmoothstepVec3Extension;
|
|
862
|
+
}
|
|
863
|
+
interface Vec4Extensions {
|
|
864
|
+
smoothstep: SmoothstepVec4Extension;
|
|
826
865
|
}
|
|
827
866
|
}
|
|
828
867
|
|
|
829
|
-
|
|
868
|
+
interface StepElement {
|
|
869
|
+
(x: FloatOrNumber, edge: FloatOrNumber): Node<"float">;
|
|
870
|
+
(x: Vec2OrFloat, edge: Vec2OrFloat): Node<"vec2">;
|
|
871
|
+
(x: Vec3OrFloat, edge: Vec3OrFloat): Node<"vec3">;
|
|
872
|
+
(x: Vec4OrFloat, edge: Vec4OrFloat): Node<"vec4">;
|
|
873
|
+
}
|
|
874
|
+
export const stepElement: StepElement;
|
|
830
875
|
declare module "../core/Node.js" {
|
|
831
876
|
interface FloatExtensions {
|
|
832
877
|
step: (edge: FloatOrNumber) => Node<"float">;
|
|
833
878
|
}
|
|
879
|
+
interface Vec2Extensions {
|
|
880
|
+
step: (edge: Vec2OrFloat) => Node<"vec2">;
|
|
881
|
+
}
|
|
882
|
+
interface Vec3Extensions {
|
|
883
|
+
step: (edge: Vec3OrFloat) => Node<"vec3">;
|
|
884
|
+
}
|
|
885
|
+
interface Vec4Extensions {
|
|
886
|
+
step: (edge: Vec4OrFloat) => Node<"vec4">;
|
|
887
|
+
}
|
|
834
888
|
}
|
|
835
889
|
|
|
836
890
|
// GLSL alias function
|