mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-04-14 01:24:26 +00:00
Merge pull request #26766 from Astrak/r93-updates-vector
ThreeJS: Update Vector classes to r93.
This commit is contained in:
422
types/three/three-core.d.ts
vendored
422
types/three/three-core.d.ts
vendored
@@ -1843,43 +1843,43 @@ export class Raycaster {
|
||||
* @param origin The origin vector where the ray casts from.
|
||||
* @param direction The direction vector that gives direction to the ray. Should be normalized.
|
||||
* @param near All results returned are further away than near. Near can't be negative. Default value is 0.
|
||||
* @param far All results returned are closer then far. Far can't be lower then near . Default value is Infinity.
|
||||
* @param far All results returned are closer then far. Far can't be lower then near . Default value is Infinity.
|
||||
*/
|
||||
constructor(origin?: Vector3, direction?: Vector3, near?: number, far?: number);
|
||||
|
||||
/** The Ray used for the raycasting. */
|
||||
ray: Ray;
|
||||
|
||||
|
||||
/**
|
||||
* The near factor of the raycaster. This value indicates which objects can be discarded based on the
|
||||
* distance. This value shouldn't be negative and should be smaller than the far property.
|
||||
* The near factor of the raycaster. This value indicates which objects can be discarded based on the
|
||||
* distance. This value shouldn't be negative and should be smaller than the far property.
|
||||
*/
|
||||
near: number;
|
||||
|
||||
|
||||
/**
|
||||
* The far factor of the raycaster. This value indicates which objects can be discarded based on the
|
||||
* distance. This value shouldn't be negative and should be larger than the near property.
|
||||
* The far factor of the raycaster. This value indicates which objects can be discarded based on the
|
||||
* distance. This value shouldn't be negative and should be larger than the near property.
|
||||
*/
|
||||
far: number;
|
||||
|
||||
|
||||
params: RaycasterParameters;
|
||||
|
||||
/**
|
||||
* The precision factor of the raycaster when intersecting Line objects.
|
||||
* The precision factor of the raycaster when intersecting Line objects.
|
||||
*/
|
||||
linePrecision: number;
|
||||
|
||||
/**
|
||||
* Updates the ray with a new origin and direction.
|
||||
* Updates the ray with a new origin and direction.
|
||||
* @param origin The origin vector where the ray casts from.
|
||||
* @param direction The normalized direction vector that gives direction to the ray.
|
||||
* @param direction The normalized direction vector that gives direction to the ray.
|
||||
*/
|
||||
set(origin: Vector3, direction: Vector3): void;
|
||||
|
||||
/**
|
||||
* Updates the ray with a new origin and direction.
|
||||
* Updates the ray with a new origin and direction.
|
||||
* @param coords 2D coordinates of the mouse, in normalized device coordinates (NDC)---X and Y components should be between -1 and 1.
|
||||
* @param camera camera from which the ray should originate
|
||||
* @param camera camera from which the ray should originate
|
||||
*/
|
||||
setFromCamera(coords: { x: number; y: number; }, camera: Camera ): void;
|
||||
|
||||
@@ -1887,15 +1887,15 @@ export class Raycaster {
|
||||
* Checks all intersection between the ray and the object with or without the descendants. Intersections are returned sorted by distance, closest first.
|
||||
* @param object The object to check for intersection with the ray.
|
||||
* @param recursive If true, it also checks all descendants. Otherwise it only checks intersecton with the object. Default is false.
|
||||
* @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).
|
||||
* @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).
|
||||
*/
|
||||
intersectObject(object: Object3D, recursive?: boolean, optionalTarget?: Intersection[]): Intersection[];
|
||||
|
||||
/**
|
||||
* Checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first. Intersections are of the same form as those returned by .intersectObject.
|
||||
* Checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first. Intersections are of the same form as those returned by .intersectObject.
|
||||
* @param objects The objects to check for intersection with the ray.
|
||||
* @param recursive If true, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects. Default is false.
|
||||
* @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).
|
||||
* @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).
|
||||
*/
|
||||
intersectObjects(objects: Object3D[], recursive?: boolean, optionalTarget?: Intersection[]): Intersection[];
|
||||
}
|
||||
@@ -4261,49 +4261,62 @@ export class Triangle {
|
||||
* v.addVectors(new THREE.Vector2(0, 1), new THREE.Vector2(2, 3)); // invalid but compiled successfully
|
||||
*/
|
||||
export interface Vector {
|
||||
setComponent(index: number, value: number): void;
|
||||
setComponent(index: number, value: number): this;
|
||||
|
||||
getComponent(index: number): number;
|
||||
|
||||
set(...args: number[]): this;
|
||||
|
||||
setScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* copy(v:T):T;
|
||||
*/
|
||||
copy(v: this): this;
|
||||
copy(v: Vector): this;
|
||||
|
||||
/**
|
||||
* NOTE: The second argument is deprecated.
|
||||
*
|
||||
* add(v:T):T;
|
||||
*/
|
||||
add(v: Vector): Vector;
|
||||
add(v: Vector, w?: Vector): this;
|
||||
|
||||
/**
|
||||
* addVectors(a:T, b:T):T;
|
||||
*/
|
||||
addVectors(a: Vector, b: Vector): Vector;
|
||||
addVectors(a: Vector, b: Vector): this;
|
||||
|
||||
addScaledVector(vector: Vector, scale: number): this;
|
||||
|
||||
/**
|
||||
* Adds the scalar value s to this vector's values.
|
||||
*/
|
||||
addScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* sub(v:T):T;
|
||||
*/
|
||||
sub(v: Vector): Vector;
|
||||
sub(v: Vector): this;
|
||||
|
||||
/**
|
||||
* subVectors(a:T, b:T):T;
|
||||
*/
|
||||
subVectors(a: Vector, b: Vector): Vector;
|
||||
subVectors(a: Vector, b: Vector): this;
|
||||
|
||||
/**
|
||||
* multiplyScalar(s:number):T;
|
||||
*/
|
||||
multiplyScalar(s: number): Vector;
|
||||
multiplyScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* divideScalar(s:number):T;
|
||||
*/
|
||||
divideScalar(s: number): Vector;
|
||||
divideScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* negate():T;
|
||||
*/
|
||||
negate(): Vector;
|
||||
negate(): this;
|
||||
|
||||
/**
|
||||
* dot(v:T):T;
|
||||
@@ -4323,7 +4336,7 @@ export interface Vector {
|
||||
/**
|
||||
* normalize():T;
|
||||
*/
|
||||
normalize(): Vector;
|
||||
normalize(): this;
|
||||
|
||||
/**
|
||||
* NOTE: Vector4 doesn't have the property.
|
||||
@@ -4342,12 +4355,12 @@ export interface Vector {
|
||||
/**
|
||||
* setLength(l:number):T;
|
||||
*/
|
||||
setLength(l: number): Vector;
|
||||
setLength(l: number): this;
|
||||
|
||||
/**
|
||||
* lerp(v:T, alpha:number):T;
|
||||
*/
|
||||
lerp(v: Vector, alpha: number): Vector;
|
||||
lerp(v: Vector, alpha: number): this;
|
||||
|
||||
/**
|
||||
* equals(v:T):boolean;
|
||||
@@ -4357,7 +4370,7 @@ export interface Vector {
|
||||
/**
|
||||
* clone():T;
|
||||
*/
|
||||
clone(): this;
|
||||
clone(): Vector;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4372,40 +4385,43 @@ export class Vector2 implements Vector {
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
isVector2: true;
|
||||
|
||||
/**
|
||||
* Sets value of this vector.
|
||||
*/
|
||||
set(x: number, y: number): Vector2;
|
||||
set(x: number, y: number): this;
|
||||
|
||||
/**
|
||||
* Sets the x and y values of this vector both equal to scalar.
|
||||
*/
|
||||
setScalar(scalar: number): Vector2;
|
||||
setScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* Sets X component of this vector.
|
||||
*/
|
||||
setX(x: number): Vector2;
|
||||
setX(x: number): this;
|
||||
|
||||
/**
|
||||
* Sets Y component of this vector.
|
||||
*/
|
||||
setY(y: number): Vector2;
|
||||
setY(y: number): this;
|
||||
|
||||
/**
|
||||
* Sets a component of this vector.
|
||||
*/
|
||||
setComponent(index: number, value: number): void;
|
||||
setComponent(index: number, value: number): this;
|
||||
|
||||
/**
|
||||
* Gets a component of this vector.
|
||||
*/
|
||||
getComponent(index: number): number;
|
||||
|
||||
/**
|
||||
* Clones this vector.
|
||||
* Returns a new Vector2 instance with the same `x` and `y` values.
|
||||
*/
|
||||
clone(): this;
|
||||
clone(): Vector2;
|
||||
|
||||
/**
|
||||
* Copies value of v to this vector.
|
||||
*/
|
||||
@@ -4414,65 +4430,73 @@ export class Vector2 implements Vector {
|
||||
/**
|
||||
* Adds v to this vector.
|
||||
*/
|
||||
add(v: Vector2): Vector2;
|
||||
add(v: Vector2, w?: Vector2): this;
|
||||
|
||||
/**
|
||||
* Adds the scalar value s to this vector's x and y values.
|
||||
*/
|
||||
addScalar(s: number): Vector2;
|
||||
addScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to a + b.
|
||||
*/
|
||||
addVectors(a: Vector2, b: Vector2): Vector2;
|
||||
addVectors(a: Vector2, b: Vector2): this;
|
||||
|
||||
/**
|
||||
* Adds the multiple of v and s to this vector.
|
||||
*/
|
||||
addScaledVector(v: Vector2, s: number): Vector2;
|
||||
addScaledVector(v: Vector2, s: number): this;
|
||||
|
||||
/**
|
||||
* Subtracts v from this vector.
|
||||
*/
|
||||
sub(v: Vector2): Vector2;
|
||||
sub(v: Vector2): this;
|
||||
|
||||
/**
|
||||
* Subtracts s from this vector's x and y components.
|
||||
*/
|
||||
subScalar(s: number): Vector2;
|
||||
subScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to a - b.
|
||||
*/
|
||||
subVectors(a: Vector2, b: Vector2): Vector2;
|
||||
subVectors(a: Vector2, b: Vector2): this;
|
||||
|
||||
/**
|
||||
* Multiplies this vector by v.
|
||||
*/
|
||||
multiply(v: Vector2): Vector2;
|
||||
multiply(v: Vector2): this;
|
||||
|
||||
/**
|
||||
* Multiplies this vector by scalar s.
|
||||
*/
|
||||
multiplyScalar(scalar: number): Vector2;
|
||||
multiplyScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* Divides this vector by v.
|
||||
*/
|
||||
divide(v: Vector2): Vector2;
|
||||
divide(v: Vector2): this;
|
||||
|
||||
/**
|
||||
* Divides this vector by scalar s.
|
||||
* Set vector to ( 0, 0 ) if s == 0.
|
||||
*/
|
||||
divideScalar(s: number): Vector2;
|
||||
divideScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* Multiplies this vector (with an implicit 1 as the 3rd component) by m.
|
||||
*/
|
||||
applyMatrix3(m: Matrix3): Vector2;
|
||||
applyMatrix3(m: Matrix3): this;
|
||||
|
||||
/**
|
||||
* If this vector's x or y value is greater than v's x or y value, replace that value with the corresponding min value.
|
||||
*/
|
||||
min(v: Vector2): Vector2;
|
||||
min(v: Vector2): this;
|
||||
|
||||
/**
|
||||
* If this vector's x or y value is less than v's x or y value, replace that value with the corresponding max value.
|
||||
*/
|
||||
max(v: Vector2): Vector2;
|
||||
max(v: Vector2): this;
|
||||
|
||||
/**
|
||||
* If this vector's x or y value is greater than the max vector's x or y value, it is replaced by the corresponding value.
|
||||
@@ -4480,43 +4504,48 @@ export class Vector2 implements Vector {
|
||||
* @param min the minimum x and y values.
|
||||
* @param max the maximum x and y values in the desired range.
|
||||
*/
|
||||
clamp(min: Vector2, max: Vector2): Vector2;
|
||||
clamp(min: Vector2, max: Vector2): this;
|
||||
|
||||
/**
|
||||
* If this vector's x or y values are greater than the max value, they are replaced by the max value.
|
||||
* If this vector's x or y values are less than the min value, they are replaced by the min value.
|
||||
* @param min the minimum value the components will be clamped to.
|
||||
* @param max the maximum value the components will be clamped to.
|
||||
*/
|
||||
clampScalar(min: number, max: number): Vector2;
|
||||
clampScalar(min: number, max: number): this;
|
||||
|
||||
/**
|
||||
* If this vector's length is greater than the max value, it is replaced by the max value.
|
||||
* If this vector's length is less than the min value, it is replaced by the min value.
|
||||
* @param min the minimum value the length will be clamped to.
|
||||
* @param max the maximum value the length will be clamped to.
|
||||
*/
|
||||
clampLength(min: number, max: number): Vector2;
|
||||
clampLength(min: number, max: number): this;
|
||||
|
||||
/**
|
||||
* The components of the vector are rounded down to the nearest integer value.
|
||||
*/
|
||||
floor(): Vector2;
|
||||
floor(): this;
|
||||
|
||||
/**
|
||||
* The x and y components of the vector are rounded up to the nearest integer value.
|
||||
*/
|
||||
ceil(): Vector2;
|
||||
ceil(): this;
|
||||
|
||||
/**
|
||||
* The components of the vector are rounded to the nearest integer value.
|
||||
*/
|
||||
round(): Vector2;
|
||||
round(): this;
|
||||
|
||||
/**
|
||||
* The components of the vector are rounded towards zero (up if negative, down if positive) to an integer value.
|
||||
*/
|
||||
roundToZero(): Vector2;
|
||||
roundToZero(): this;
|
||||
|
||||
/**
|
||||
* Inverts this vector.
|
||||
*/
|
||||
negate(): Vector2;
|
||||
negate(): this;
|
||||
|
||||
/**
|
||||
* Computes dot product of this vector and v.
|
||||
@@ -4538,10 +4567,19 @@ export class Vector2 implements Vector {
|
||||
*/
|
||||
lengthManhattan(): number;
|
||||
|
||||
/**
|
||||
* Computes the Manhattan length of this vector.
|
||||
*
|
||||
* @return {number}
|
||||
*
|
||||
* @see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry}
|
||||
*/
|
||||
manhattanLength(): number;
|
||||
|
||||
/**
|
||||
* Normalizes this vector.
|
||||
*/
|
||||
normalize(): Vector2;
|
||||
normalize(): this;
|
||||
|
||||
/**
|
||||
* computes the angle in radians with respect to the positive x-axis
|
||||
@@ -4552,33 +4590,47 @@ export class Vector2 implements Vector {
|
||||
* Computes distance of this vector to v.
|
||||
*/
|
||||
distanceTo(v: Vector2): number;
|
||||
|
||||
/**
|
||||
* Computes squared distance of this vector to v.
|
||||
*/
|
||||
distanceToSquared(v: Vector2): number;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Vector2#manhattanDistanceTo .manhattanDistanceTo()} instead.
|
||||
*/
|
||||
distanceToManhattan(v: Vector2): number;
|
||||
|
||||
/**
|
||||
* Computes the Manhattan length (distance) from this vector to the given vector v
|
||||
*
|
||||
* @param {Vector2} v
|
||||
*
|
||||
* @return {number}
|
||||
*
|
||||
* @see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry}
|
||||
*/
|
||||
manhattanDistanceTo(v: Vector2): number;
|
||||
|
||||
/**
|
||||
* Normalizes this vector and multiplies it by l.
|
||||
*/
|
||||
setLength(length: number): Vector2;
|
||||
setLength(length: number): this;
|
||||
|
||||
/**
|
||||
* Linearly interpolates between this vector and v, where alpha is the distance along the line - alpha = 0 will be this vector, and alpha = 1 will be v.
|
||||
* @param v vector to interpolate towards.
|
||||
* @param alpha interpolation factor in the closed interval [0, 1].
|
||||
*/
|
||||
lerp(v: Vector2, alpha: number): Vector2;
|
||||
lerp(v: Vector2, alpha: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to be the vector linearly interpolated between v1 and v2 where alpha is the distance along the line connecting the two vectors - alpha = 0 will be v1, and alpha = 1 will be v2.
|
||||
* @param v1 the starting vector.
|
||||
* @param v2 vector to interpolate towards.
|
||||
* @param alpha interpolation factor in the closed interval [0, 1].
|
||||
*/
|
||||
lerpVectors(v1: Vector2, v2: Vector2, alpha: number): Vector2;
|
||||
lerpVectors(v1: Vector2, v2: Vector2, alpha: number): this;
|
||||
|
||||
/**
|
||||
* Checks for strict equality of this vector and v.
|
||||
@@ -4590,7 +4642,8 @@ export class Vector2 implements Vector {
|
||||
* @param array the source array.
|
||||
* @param offset (optional) offset into the array. Default is 0.
|
||||
*/
|
||||
fromArray(array: number[], offset?: number): Vector2;
|
||||
fromArray(array: number[], offset?: number): this;
|
||||
|
||||
/**
|
||||
* Returns an array [x, y], or copies x and y into the provided array.
|
||||
* @param array (optional) array to store the vector to. If this is not provided, a new array will be created.
|
||||
@@ -4603,14 +4656,14 @@ export class Vector2 implements Vector {
|
||||
* @param attribute the source attribute.
|
||||
* @param index index in the attribute.
|
||||
*/
|
||||
fromBufferAttribute(attribute: BufferAttribute, index: number): Vector2;
|
||||
fromBufferAttribute(attribute: BufferAttribute, index: number): this;
|
||||
|
||||
/**
|
||||
* Rotates the vector around center by angle radians.
|
||||
* @param center the point around which to rotate.
|
||||
* @param angle the angle to rotate, in radians.
|
||||
*/
|
||||
rotateAround(center: Vector2, angle: number): Vector2;
|
||||
rotateAround(center: Vector2, angle: number): this;
|
||||
|
||||
/**
|
||||
* Computes the Manhattan length of this vector.
|
||||
@@ -4652,16 +4705,17 @@ export class Vector3 implements Vector {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
isVector3: true;
|
||||
|
||||
/**
|
||||
* Sets value of this vector.
|
||||
*/
|
||||
set(x: number, y: number, z: number): Vector3;
|
||||
set(x: number, y: number, z: number): this;
|
||||
|
||||
/**
|
||||
* Sets all values of this vector.
|
||||
*/
|
||||
setScalar(scalar: number): Vector3;
|
||||
setScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* Sets x value of this vector.
|
||||
@@ -4678,76 +4732,102 @@ export class Vector3 implements Vector {
|
||||
*/
|
||||
setZ(z: number): Vector3;
|
||||
|
||||
setComponent(index: number, value: number): void;
|
||||
setComponent(index: number, value: number): this;
|
||||
|
||||
getComponent(index: number): number;
|
||||
|
||||
/**
|
||||
* Clones this vector.
|
||||
*/
|
||||
clone(): this;
|
||||
clone(): Vector3;
|
||||
|
||||
/**
|
||||
* Copies value of v to this vector.
|
||||
*/
|
||||
copy(v: this): this;
|
||||
copy(v: Vector3): this;
|
||||
|
||||
/**
|
||||
* Adds v to this vector.
|
||||
*/
|
||||
add(a: Vector3): Vector3;
|
||||
addScalar(s: number): Vector3;
|
||||
addScaledVector(v: Vector3, s: number): Vector3;
|
||||
add(a: Vector3, b?: Vector3): this;
|
||||
|
||||
addScalar(s: number): this;
|
||||
|
||||
addScaledVector(v: Vector3, s: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to a + b.
|
||||
*/
|
||||
addVectors(a: Vector3, b: Vector3): Vector3;
|
||||
addVectors(a: Vector3, b: Vector3): this;
|
||||
|
||||
/**
|
||||
* Subtracts v from this vector.
|
||||
*/
|
||||
sub(a: Vector3): Vector3;
|
||||
sub(a: Vector3): this;
|
||||
|
||||
subScalar( s: number ): Vector3;
|
||||
subScalar( s: number ): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to a - b.
|
||||
*/
|
||||
subVectors(a: Vector3, b: Vector3): Vector3;
|
||||
subVectors(a: Vector3, b: Vector3): this;
|
||||
|
||||
multiply(v: Vector3): this;
|
||||
|
||||
multiply(v: Vector3): Vector3;
|
||||
/**
|
||||
* Multiplies this vector by scalar s.
|
||||
*/
|
||||
multiplyScalar(s: number): Vector3;
|
||||
multiplyVectors(a: Vector3, b: Vector3): Vector3;
|
||||
applyEuler(euler: Euler): Vector3;
|
||||
applyAxisAngle(axis: Vector3, angle: number): Vector3;
|
||||
applyMatrix3(m: Matrix3): Vector3;
|
||||
applyMatrix4(m: Matrix4): Vector3;
|
||||
applyQuaternion(q: Quaternion): Vector3;
|
||||
project(camrea: Camera): Vector3;
|
||||
unproject(camera: Camera): Vector3;
|
||||
transformDirection(m: Matrix4): Vector3;
|
||||
divide(v: Vector3): Vector3;
|
||||
multiplyScalar(s: number): this;
|
||||
|
||||
multiplyVectors(a: Vector3, b: Vector3): this;
|
||||
|
||||
applyEuler(euler: Euler): this;
|
||||
|
||||
applyAxisAngle(axis: Vector3, angle: number): this;
|
||||
|
||||
applyMatrix3(m: Matrix3): this;
|
||||
|
||||
applyMatrix4(m: Matrix4): this;
|
||||
|
||||
applyQuaternion(q: Quaternion): this;
|
||||
|
||||
project(camrea: Camera): this;
|
||||
|
||||
unproject(camera: Camera): this;
|
||||
|
||||
transformDirection(m: Matrix4): this;
|
||||
|
||||
divide(v: Vector3): this;
|
||||
|
||||
|
||||
/**
|
||||
* Divides this vector by scalar s.
|
||||
* Set vector to ( 0, 0, 0 ) if s == 0.
|
||||
*/
|
||||
divideScalar(s: number): Vector3;
|
||||
min(v: Vector3): Vector3;
|
||||
max(v: Vector3): Vector3;
|
||||
clamp(min: Vector3, max: Vector3): Vector3;
|
||||
clampScalar(min: number, max: number): Vector3;
|
||||
clampLength(min: number, max: number): Vector3;
|
||||
floor(): Vector3;
|
||||
ceil(): Vector3;
|
||||
round(): Vector3;
|
||||
roundToZero(): Vector3;
|
||||
divideScalar(s: number): this;
|
||||
|
||||
min(v: Vector3): this;
|
||||
|
||||
max(v: Vector3): this;
|
||||
|
||||
clamp(min: Vector3, max: Vector3): this;
|
||||
|
||||
clampScalar(min: number, max: number): this;
|
||||
|
||||
clampLength(min: number, max: number): this;
|
||||
|
||||
floor(): this;
|
||||
|
||||
ceil(): this;
|
||||
|
||||
round(): this;
|
||||
|
||||
roundToZero(): this;
|
||||
|
||||
/**
|
||||
* Inverts this vector.
|
||||
*/
|
||||
negate(): Vector3;
|
||||
negate(): this;
|
||||
|
||||
/**
|
||||
* Computes dot product of this vector and v.
|
||||
@@ -4795,28 +4875,28 @@ export class Vector3 implements Vector {
|
||||
/**
|
||||
* Normalizes this vector.
|
||||
*/
|
||||
normalize(): Vector3;
|
||||
normalize(): this;
|
||||
|
||||
/**
|
||||
* Normalizes this vector and multiplies it by l.
|
||||
*/
|
||||
setLength(l: number): Vector3;
|
||||
lerp(v: Vector3, alpha: number): Vector3;
|
||||
setLength(l: number): this;
|
||||
lerp(v: Vector3, alpha: number): this;
|
||||
|
||||
lerpVectors(v1: Vector3, v2: Vector3, alpha: number): Vector3;
|
||||
lerpVectors(v1: Vector3, v2: Vector3, alpha: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to cross product of itself and v.
|
||||
*/
|
||||
cross(a: Vector3): Vector3;
|
||||
cross(a: Vector3, w?: Vector3): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to cross product of a and b.
|
||||
*/
|
||||
crossVectors(a: Vector3, b: Vector3): Vector3;
|
||||
projectOnVector(v: Vector3): Vector3;
|
||||
projectOnPlane(planeNormal: Vector3): Vector3;
|
||||
reflect(vector: Vector3): Vector3;
|
||||
crossVectors(a: Vector3, b: Vector3): this;
|
||||
projectOnVector(v: Vector3): this;
|
||||
projectOnPlane(planeNormal: Vector3): this;
|
||||
reflect(vector: Vector3): this;
|
||||
angleTo(v: Vector3): number;
|
||||
|
||||
/**
|
||||
@@ -4834,10 +4914,11 @@ export class Vector3 implements Vector {
|
||||
*/
|
||||
distanceToManhattan(v: Vector3): number;
|
||||
|
||||
setFromSpherical(s: Spherical): Vector3;
|
||||
setFromMatrixPosition(m: Matrix4): Vector3;
|
||||
setFromMatrixScale(m: Matrix4): Vector3;
|
||||
setFromMatrixColumn(matrix: Matrix4, index: number): Vector3;
|
||||
setFromSpherical(s: Spherical): this;
|
||||
setFromCylindrical(s: Cylindrical): this;
|
||||
setFromMatrixPosition(m: Matrix4): this;
|
||||
setFromMatrixScale(m: Matrix4): this;
|
||||
setFromMatrixColumn(matrix: Matrix4, index: number): this;
|
||||
|
||||
/**
|
||||
* Checks for strict equality of this vector and v.
|
||||
@@ -4846,22 +4927,7 @@ export class Vector3 implements Vector {
|
||||
|
||||
fromArray(xyz: number[], offset?: number): Vector3;
|
||||
toArray(xyz?: number[], offset?: number): number[];
|
||||
fromBufferAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector3;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Vector3#setFromMatrixPosition .setFromMatrixPosition()} instead.
|
||||
*/
|
||||
getPositionFromMatrix(m: Matrix4): Vector3;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Vector3#setFromMatrixScale .setFromMatrixScale()} instead.
|
||||
*/
|
||||
getScaleFromMatrix(m: Matrix4): Vector3;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Vector3#setFromMatrixColumn .setFromMatrixColumn()} instead.
|
||||
*/
|
||||
getColumnFromMatrix(index: number, matrix: Matrix4): Vector3;
|
||||
fromBufferAttribute( attribute: BufferAttribute, index: number, offset?: number): this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4881,43 +4947,47 @@ export class Vector4 implements Vector {
|
||||
y: number;
|
||||
z: number;
|
||||
w: number;
|
||||
isVector4: true;
|
||||
|
||||
/**
|
||||
* Sets value of this vector.
|
||||
*/
|
||||
set(x: number, y: number, z: number, w: number): Vector4;
|
||||
set(x: number, y: number, z: number, w: number): this;
|
||||
|
||||
/**
|
||||
* Sets all values of this vector.
|
||||
*/
|
||||
setScalar(scalar: number): Vector4;
|
||||
setScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* Sets X component of this vector.
|
||||
*/
|
||||
setX(x: number): Vector4;
|
||||
setX(x: number): this;
|
||||
|
||||
/**
|
||||
* Sets Y component of this vector.
|
||||
*/
|
||||
setY(y: number): Vector4;
|
||||
setY(y: number): this;
|
||||
|
||||
/**
|
||||
* Sets Z component of this vector.
|
||||
*/
|
||||
setZ(z: number): Vector4;
|
||||
setZ(z: number): this;
|
||||
|
||||
/**
|
||||
* Sets w component of this vector.
|
||||
*/
|
||||
setW(w: number): Vector4;
|
||||
setW(w: number): this;
|
||||
|
||||
setComponent(index: number, value: number): this;
|
||||
|
||||
setComponent(index: number, value: number): void;
|
||||
getComponent(index: number): number;
|
||||
|
||||
/**
|
||||
* Clones this vector.
|
||||
*/
|
||||
clone(): this;
|
||||
clone(): Vector4;
|
||||
|
||||
/**
|
||||
* Copies value of v to this vector.
|
||||
*/
|
||||
@@ -4926,63 +4996,66 @@ export class Vector4 implements Vector {
|
||||
/**
|
||||
* Adds v to this vector.
|
||||
*/
|
||||
add(v: Vector4): Vector4;
|
||||
addScalar(s: number): Vector4;
|
||||
add(v: Vector4, w?: Vector4): this;
|
||||
|
||||
addScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to a + b.
|
||||
*/
|
||||
addVectors(a: Vector4, b: Vector4): Vector4;
|
||||
addScaledVector( v: Vector4, s: number ): Vector4;
|
||||
addVectors(a: Vector4, b: Vector4): this;
|
||||
|
||||
addScaledVector( v: Vector4, s: number ): this;
|
||||
/**
|
||||
* Subtracts v from this vector.
|
||||
*/
|
||||
sub(v: Vector4): Vector4;
|
||||
sub(v: Vector4): this;
|
||||
|
||||
subScalar(s: number): Vector4;
|
||||
subScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to a - b.
|
||||
*/
|
||||
subVectors(a: Vector4, b: Vector4): Vector4;
|
||||
subVectors(a: Vector4, b: Vector4): this;
|
||||
|
||||
/**
|
||||
* Multiplies this vector by scalar s.
|
||||
*/
|
||||
multiplyScalar(s: number): Vector4;
|
||||
applyMatrix4(m: Matrix4): Vector4;
|
||||
multiplyScalar(s: number): this;
|
||||
|
||||
applyMatrix4(m: Matrix4): this;
|
||||
|
||||
/**
|
||||
* Divides this vector by scalar s.
|
||||
* Set vector to ( 0, 0, 0 ) if s == 0.
|
||||
*/
|
||||
divideScalar(s: number): Vector4;
|
||||
divideScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm
|
||||
* @param q is assumed to be normalized
|
||||
*/
|
||||
setAxisAngleFromQuaternion(q: Quaternion): Vector4;
|
||||
setAxisAngleFromQuaternion(q: Quaternion): this;
|
||||
|
||||
/**
|
||||
* http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm
|
||||
* @param m assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
|
||||
*/
|
||||
setAxisAngleFromRotationMatrix(m: Matrix3): Vector4;
|
||||
setAxisAngleFromRotationMatrix(m: Matrix3): this;
|
||||
|
||||
min(v: Vector4): Vector4;
|
||||
max(v: Vector4): Vector4;
|
||||
clamp(min: Vector4, max: Vector4): Vector4;
|
||||
clampScalar(min: number, max: number): Vector4;
|
||||
floor(): Vector4;
|
||||
ceil(): Vector4;
|
||||
round(): Vector4;
|
||||
roundToZero(): Vector4;
|
||||
min(v: Vector4): this;
|
||||
max(v: Vector4): this;
|
||||
clamp(min: Vector4, max: Vector4): this;
|
||||
clampScalar(min: number, max: number): this;
|
||||
floor(): this;
|
||||
ceil(): this;
|
||||
round(): this;
|
||||
roundToZero(): this;
|
||||
|
||||
/**
|
||||
* Inverts this vector.
|
||||
*/
|
||||
negate(): Vector4;
|
||||
negate(): this;
|
||||
|
||||
/**
|
||||
* Computes dot product of this vector and v.
|
||||
@@ -4999,11 +5072,6 @@ export class Vector4 implements Vector {
|
||||
*/
|
||||
length(): number;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Vector4#manhattanLength .manhattanLength()} instead.
|
||||
*/
|
||||
lengthManhattan(): number;
|
||||
|
||||
/**
|
||||
* Computes the Manhattan length of this vector.
|
||||
*
|
||||
@@ -5016,29 +5084,29 @@ export class Vector4 implements Vector {
|
||||
/**
|
||||
* Normalizes this vector.
|
||||
*/
|
||||
normalize(): Vector4;
|
||||
normalize(): this;
|
||||
/**
|
||||
* Normalizes this vector and multiplies it by l.
|
||||
*/
|
||||
setLength(length: number): Vector4;
|
||||
setLength(length: number): this;
|
||||
|
||||
/**
|
||||
* Linearly interpolate between this vector and v with alpha factor.
|
||||
*/
|
||||
lerp(v: Vector4, alpha: number): Vector4;
|
||||
lerp(v: Vector4, alpha: number): this;
|
||||
|
||||
lerpVectors(v1: Vector4, v2: Vector4, alpha: number): Vector4;
|
||||
lerpVectors(v1: Vector4, v2: Vector4, alpha: number): this;
|
||||
|
||||
/**
|
||||
* Checks for strict equality of this vector and v.
|
||||
*/
|
||||
equals(v: Vector4): boolean;
|
||||
|
||||
fromArray(xyzw: number[], offset?: number): Vector4;
|
||||
fromArray(xyzw: number[], offset?: number): this;
|
||||
|
||||
toArray(xyzw?: number[], offset?: number): number[];
|
||||
|
||||
fromBufferAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector4;
|
||||
fromBufferAttribute( attribute: BufferAttribute, index: number, offset?: number): this;
|
||||
}
|
||||
|
||||
export abstract class Interpolant {
|
||||
@@ -6092,12 +6160,12 @@ export class WebGLLights {
|
||||
get(light: any): any;
|
||||
}
|
||||
|
||||
/**
|
||||
* An object with a series of statistical information about the graphics board memory and the rendering process.
|
||||
*/
|
||||
/**
|
||||
* An object with a series of statistical information about the graphics board memory and the rendering process.
|
||||
*/
|
||||
export class WebGLInfo {
|
||||
autoReset: boolean;
|
||||
memory: {
|
||||
memory: {
|
||||
geometries: number;
|
||||
textures: number;
|
||||
};
|
||||
@@ -6678,14 +6746,14 @@ export class AudioListener extends Object3D {
|
||||
* class Curve<T extends Vector>
|
||||
*/
|
||||
export class Curve<T extends Vector> {
|
||||
|
||||
|
||||
/**
|
||||
* This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
|
||||
* To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large.
|
||||
* This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
|
||||
* To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large.
|
||||
* Default is 200.
|
||||
*/
|
||||
arcLengthDivisions:number;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a vector for point t of the curve where t is between 0 and 1
|
||||
* getPoint(t: number): T;
|
||||
|
||||
Reference in New Issue
Block a user