mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
updated three.d.ts for three.js r56
This commit is contained in:
parent
2ee5e475e0
commit
08ff7d4dbb
5381
threejs/three-r55.d.ts
vendored
Normal file
5381
threejs/three-r55.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
120
threejs/three.d.ts
vendored
120
threejs/three.d.ts
vendored
@ -1,13 +1,13 @@
|
||||
/**
|
||||
* three.d.ts (https://github.com/kontan/three.d.ts)
|
||||
*
|
||||
* Type definitions for three.js r55 (http://mrdoob.github.com/three.js/)
|
||||
* Type definitions for three.js r56 (http://mrdoob.github.com/three.js/)
|
||||
*
|
||||
* Copyright (c) 2012- Kon (http://phyzkit.net/)
|
||||
*
|
||||
*/
|
||||
|
||||
interface WebGLRenderingContext {};
|
||||
interface WebGLRenderingContext {}
|
||||
|
||||
module THREE {
|
||||
export var REVISION: string;
|
||||
@ -328,10 +328,10 @@ module THREE {
|
||||
getDelta(): number;
|
||||
}
|
||||
|
||||
export interface HSV {
|
||||
export interface HSL {
|
||||
h: number;
|
||||
s: number;
|
||||
v: number;
|
||||
l: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -377,14 +377,14 @@ module THREE {
|
||||
setRGB(r: number, g: number, b: number): Color;
|
||||
|
||||
/**
|
||||
* Sets this color from HSV values.
|
||||
* Sets this color from HSL values.
|
||||
* Based on MochiKit implementation by Bob Ippolito.
|
||||
*
|
||||
* @param h Hue channel value between 0 and 1.
|
||||
* @param s Saturation value channel between 0 and 1.
|
||||
* @param v Value channel value between 0 and 1.
|
||||
* @param l Value channel value between 0 and 1.
|
||||
*/
|
||||
setHSV(h: number, s: number, v: number): Color;
|
||||
setHSL(h: number, s: number, l: number): Color;
|
||||
|
||||
/**
|
||||
* Sets this color from a CSS context style string.
|
||||
@ -430,13 +430,16 @@ module THREE {
|
||||
*/
|
||||
getHexString(): string;
|
||||
|
||||
getHSL(): HSL;
|
||||
|
||||
/**
|
||||
* Returns the value of this color in CSS context style.
|
||||
* Example: rgb(r, g, b)
|
||||
*/
|
||||
getStyle(): string;
|
||||
|
||||
getHSV(hsv?: HSV): HSV;
|
||||
offsetHSL(h:number, s:number, l:number): Color;
|
||||
|
||||
add(color: Color): Color;
|
||||
addColors(color1: Color, color2: Color): Color;
|
||||
addScalar(s: number): Color;
|
||||
@ -838,6 +841,22 @@ module THREE {
|
||||
clone(): Frustum;
|
||||
}
|
||||
|
||||
export class Line3{
|
||||
constructor(start?:Vector3, end?:Vector3);
|
||||
set(start?:Vector3, end?:Vector3):Line3;
|
||||
copy(line:Line3):Line3;
|
||||
center(optionalTarget?:Vector3):Vector3;
|
||||
delta(optionalTarget?:Vector3):Vector3;
|
||||
distanceSq():number;
|
||||
distance():number;
|
||||
at(t:number, optionalTarget:Vector3):Vector3;
|
||||
closestPointToPointParameter(point:Vector3, clampToLine?:bool):number;
|
||||
closestPointToPoint(point:Vector3, clampToLine?:bool, optionalTarget?:Vector3):Vector3;
|
||||
applyMatrix4(matrix:Matrix4):Line3;
|
||||
equals(line:Line3):bool;
|
||||
clone():Line3;
|
||||
}
|
||||
|
||||
export class Plane {
|
||||
constructor(normal?: Vector3, constant?: number);
|
||||
normal: Vector3;
|
||||
@ -855,7 +874,7 @@ module THREE {
|
||||
orthoPoint(point: Vector3, optionalTarget?: Vector3): Vector3;
|
||||
isIntersectionLine(startPoint: Vector3, endPoint: Vector3): bool;
|
||||
coplanarPoint(optionalTarget?: bool): Vector3;
|
||||
transform(matrix: Matrix3, optionalNormalMatrix?: Matrix3): Plane;
|
||||
applyMatrix4(matrix: Matrix3, optionalNormalMatrix?: Matrix3): Plane;
|
||||
translate(offset: Vector3): Plane;
|
||||
equals(plane: Plane): bool;
|
||||
clone(): Plane;
|
||||
@ -874,7 +893,7 @@ module THREE {
|
||||
intersectsSphere(sphere: Sphere): bool;
|
||||
clampPoint(point: Vector3, optionalTarget?: Vector3): Sphere;
|
||||
getBoundingBox(optionalTarget: Box3): Box3;
|
||||
transform(matrix: Matrix): Sphere;
|
||||
applyMatrix4(matrix: Matrix): Sphere;
|
||||
translate(offset: Vector3): Sphere;
|
||||
equals(sphere: Sphere): bool;
|
||||
clone(): Sphere;
|
||||
@ -999,11 +1018,7 @@ module THREE {
|
||||
var GeometryIdCount: number;
|
||||
var GeometryLibrary: Geometry[];
|
||||
|
||||
/**
|
||||
*
|
||||
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/math/Math.js">src/math/Math.js</a>
|
||||
*/
|
||||
export var Math: {
|
||||
interface Math {
|
||||
/**
|
||||
* Clamps the x to be between a and b.
|
||||
*
|
||||
@ -1032,6 +1047,10 @@ module THREE {
|
||||
*/
|
||||
mapLinear(x: number, a1: number, a2: number, b1: number, b2: number): number;
|
||||
|
||||
smoothstep(x:number, min:number, max:number):number;
|
||||
|
||||
smootherstep(x:number, min:number, max:number):number;
|
||||
|
||||
/**
|
||||
* Random float from 0 to 1 with 16 bits of randomness.
|
||||
* Standard Math.random() creates repetitive patterns when applied over larger space.
|
||||
@ -1060,9 +1079,13 @@ module THREE {
|
||||
};
|
||||
|
||||
/**
|
||||
* A 3x3 matrix.
|
||||
*
|
||||
* ( interface Matrix<T> )
|
||||
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/math/Math.js">src/math/Math.js</a>
|
||||
*/
|
||||
export var Math: Math;
|
||||
|
||||
/**
|
||||
* ( interface Matrix<T> )
|
||||
*/
|
||||
export interface Matrix {
|
||||
/**
|
||||
@ -1106,7 +1129,7 @@ module THREE {
|
||||
}
|
||||
|
||||
/**
|
||||
* ( class Matrix3 implements Matrix<Matrix3> )
|
||||
* ( class Matrix3 implements Matrix<Matrix3> )
|
||||
*/
|
||||
export class Matrix3 implements Matrix {
|
||||
constructor(n11?: number, n12?: number, n13?: number, n21?: number, n22?: number, n23?: number, n31?: number, n32?: number, n33?: number);
|
||||
@ -1129,6 +1152,8 @@ module THREE {
|
||||
*/
|
||||
transpose(): Matrix3;
|
||||
|
||||
getNormalMatrix(m:Matrix4): Matrix3;
|
||||
|
||||
/**
|
||||
* Transposes this matrix into the supplied array r, and returns itself.
|
||||
*/
|
||||
@ -1251,35 +1276,11 @@ module THREE {
|
||||
*/
|
||||
flattenToArrayOffset(flat: number[], offset: number): number[];
|
||||
|
||||
/**
|
||||
* Returns position component from this matrix.
|
||||
* Note: this method returns a reference to the internal class vector, make a copy or clone it if you don't use it right away.
|
||||
*/
|
||||
getPosition(): Vector3;
|
||||
|
||||
/**
|
||||
* Sets the position component for this matrix from vector v.
|
||||
*/
|
||||
setPosition(v: Vector3): Vector3;
|
||||
|
||||
/**
|
||||
* Returns x column component from this matrix.
|
||||
* Note: this method returns a reference to the internal class vector, make a copy or clone it if you don't use it right away.
|
||||
*/
|
||||
getColumnX(): Vector3;
|
||||
|
||||
/**
|
||||
* Returns y column component from this matrix.
|
||||
* Note: this method returns a reference to the internal class vector, make a copy or clone it if you don't use it right away.
|
||||
*/
|
||||
getColumnY(): Vector3;
|
||||
|
||||
/**
|
||||
* Returns z column component from this matrix.
|
||||
* Note: this method returns a reference to the internal class vector, make a copy or clone it if you don't use it right away.
|
||||
*/
|
||||
getColumnZ(): Vector3;
|
||||
|
||||
/**
|
||||
* Sets this matrix to the inverse of matrix m.
|
||||
* Based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm.
|
||||
@ -1414,7 +1415,7 @@ module THREE {
|
||||
isIntersectionPlane(plane: Plane): bool;
|
||||
distanceToPlane(plane: Plane): number;
|
||||
intersectPlane(plane: Plane, optionalTarget?: Vector3): Vector3;
|
||||
transform(matrix4: Matrix4): Ray;
|
||||
applyMatrix4(matrix4: Matrix4): Ray;
|
||||
equals(ray: Ray): bool;
|
||||
clone(): Ray;
|
||||
}
|
||||
@ -1787,11 +1788,11 @@ module THREE {
|
||||
|
||||
|
||||
/**
|
||||
* ( interface Vector<T> )
|
||||
* ( interface Vector<T> )
|
||||
*
|
||||
* Abstruct interface of Vector2, Vector3 and Vector4.
|
||||
* Currently the members of Vector is NOT type safe because it accepts different typed vectors.
|
||||
* Those definitions will be changed when TypeScript innovocates Generics to be type safe.
|
||||
* Those definitions will be changed when TypeScript innovates Generics to be type safe.
|
||||
*
|
||||
* @example
|
||||
* var v:THREE.Vector = new THREE.Vector3();
|
||||
@ -1994,6 +1995,8 @@ module THREE {
|
||||
*/
|
||||
equals(v: Vector2): bool;
|
||||
|
||||
toArray(): number[];
|
||||
|
||||
/**
|
||||
* Clones this vector.
|
||||
*/
|
||||
@ -2091,7 +2094,7 @@ module THREE {
|
||||
applyEuler(v: Vector3, eulerOrder: string): Vector3;
|
||||
|
||||
applyAxisAngle(axis: Vector3, angle: number): Vector3;
|
||||
projectPoint(m: Matrix4): Vector3;
|
||||
transformDirection(m:Matrix4):Vector3;
|
||||
divide(v: Vector3): Vector3;
|
||||
|
||||
/**
|
||||
@ -2153,6 +2156,12 @@ module THREE {
|
||||
*/
|
||||
crossVectors(a: Vector3, b: Vector3): Vector3;
|
||||
|
||||
projectOnVector(v:Vector3): Vector3;
|
||||
|
||||
projectOnPlane(planeNormal:Vector3): Vector3;
|
||||
|
||||
reflect(vector:Vector3):Vector3;
|
||||
|
||||
angleTo(v: Vector3): number;
|
||||
|
||||
/**
|
||||
@ -2184,6 +2193,8 @@ module THREE {
|
||||
*/
|
||||
equals(v: Vector3): bool;
|
||||
|
||||
toArray(): number[];
|
||||
|
||||
/**
|
||||
* Clones this vector.
|
||||
*/
|
||||
@ -2303,6 +2314,8 @@ module THREE {
|
||||
*/
|
||||
equals(v: Vector4): bool;
|
||||
|
||||
toArray(): number[];
|
||||
|
||||
/**
|
||||
* Clones this vector.
|
||||
*/
|
||||
@ -2368,7 +2381,7 @@ module THREE {
|
||||
distanceToPoint(point: Vector3): Vector3;
|
||||
intersect(box: Box3): Box3;
|
||||
union(box: Box3): Box3;
|
||||
transform(matrix: Matrix4): Box3;
|
||||
applyMatrix4(matrix: Matrix4): Box3;
|
||||
translate(offset: Vector3): Box3;
|
||||
equals(box: Box3): bool;
|
||||
clone(): Box3;
|
||||
@ -4382,17 +4395,6 @@ module THREE {
|
||||
}
|
||||
|
||||
// Extras /////////////////////////////////////////////////////////////////////
|
||||
export var ColorUtils: {
|
||||
/**
|
||||
* Taking a color as input, converts it to HSV, and applies the h, s, v parameters in place, i.e. no new color is returned but the original object is modified.
|
||||
*
|
||||
* @param color source color to be adjusted
|
||||
* @param h hue change amount
|
||||
* @param s saturation change amount
|
||||
* @param v value change amount
|
||||
*/
|
||||
adjustHSV(color: Color, h: number, s: number, v: number): void;
|
||||
};
|
||||
|
||||
export interface TypefaceData {
|
||||
familyName: string;
|
||||
@ -4592,7 +4594,7 @@ module THREE {
|
||||
|
||||
/**
|
||||
* An extensible curve object which contains methods for interpolation
|
||||
* class Curve<T extends Vector>
|
||||
* class Curve<T extends Vector>
|
||||
*/
|
||||
export class Curve {
|
||||
constructor();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user