|
@@ -2,7 +2,7 @@
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
interface RayTriangleIntersection {
|
|
interface RayTriangleIntersection {
|
|
- hit: bool;
|
|
|
|
|
|
+ hit: boolean;
|
|
distance: number;
|
|
distance: number;
|
|
bu: number;
|
|
bu: number;
|
|
bv: number;
|
|
bv: number;
|
|
@@ -31,7 +31,8 @@ declare module BABYLON {
|
|
|
|
|
|
constructor(origin: Vector3, direction: Vector3);
|
|
constructor(origin: Vector3, direction: Vector3);
|
|
|
|
|
|
- intersectsSphere(sphere: Sphere): bool;
|
|
|
|
|
|
+ intersectsBox(box: BoundingBox): boolean;
|
|
|
|
+ intersectsSphere(sphere: Sphere): boolean;
|
|
intersectsTriangle(vertex0: Vector3,
|
|
intersectsTriangle(vertex0: Vector3,
|
|
vertex1: Vector3,
|
|
vertex1: Vector3,
|
|
vertex2: Vector3): RayTriangleIntersection;
|
|
vertex2: Vector3): RayTriangleIntersection;
|
|
@@ -53,15 +54,19 @@ declare module BABYLON {
|
|
|
|
|
|
constructor(intialR: number, initialG: number, initialB: number);
|
|
constructor(intialR: number, initialG: number, initialB: number);
|
|
|
|
|
|
- equals(otherColor: Color3): bool;
|
|
|
|
- equals(otherColor: Color4): bool;
|
|
|
|
|
|
+ equals(otherColor: Color3): boolean;
|
|
|
|
+ equals(otherColor: Color4): boolean;
|
|
toString(): string;
|
|
toString(): string;
|
|
clone(): Color3;
|
|
clone(): Color3;
|
|
|
|
|
|
multiply(otherColor: Color3): Color3;
|
|
multiply(otherColor: Color3): Color3;
|
|
|
|
+ mutilplyToRef(otherColor: Color3, result: Color3): void;
|
|
scale(scale: number): Color3;
|
|
scale(scale: number): Color3;
|
|
|
|
+ scaleToRef(scale: number, result: Color3): void;
|
|
|
|
+ copyFrom(source: Color3): void;
|
|
|
|
+ copyFromFloats(r: number, g: number, b: number): void;
|
|
|
|
|
|
- static FromArray(number[]): Color3;
|
|
|
|
|
|
+ static FromArray(array: number[]): Color3;
|
|
}
|
|
}
|
|
|
|
|
|
class Color4 implements IColor3 {
|
|
class Color4 implements IColor3 {
|
|
@@ -72,15 +77,18 @@ declare module BABYLON {
|
|
|
|
|
|
constructor(initialR: number, initialG: number, initialB: number, initialA: number);
|
|
constructor(initialR: number, initialG: number, initialB: number, initialA: number);
|
|
|
|
|
|
|
|
+ addInPlace(right: Color4): void;
|
|
add(right: Color4): Color4;
|
|
add(right: Color4): Color4;
|
|
subtract(right: Color4): Color4;
|
|
subtract(right: Color4): Color4;
|
|
|
|
+ subtractToRef(right: Color4, result: Color4): void;
|
|
scale(factor: number): Color4;
|
|
scale(factor: number): Color4;
|
|
|
|
+ scale(factor: number, result: Color4): void;
|
|
|
|
|
|
toString(): string;
|
|
toString(): string;
|
|
clone(): Color4;
|
|
clone(): Color4;
|
|
|
|
|
|
static Lerp(left: number, right: number, amount: number): Color4;
|
|
static Lerp(left: number, right: number, amount: number): Color4;
|
|
- static FromArray(number[]): Color4;
|
|
|
|
|
|
+ static FromArray(array: number[]): Color4;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -95,8 +103,9 @@ declare module BABYLON {
|
|
add(other: Vector2): Vector2;
|
|
add(other: Vector2): Vector2;
|
|
subtract(other: Vector2): Vector2;
|
|
subtract(other: Vector2): Vector2;
|
|
negate(): Vector2;
|
|
negate(): Vector2;
|
|
- scale(factor: number): Vector2;
|
|
|
|
- equals(other: Vector2): bool;
|
|
|
|
|
|
+ scaleInPlace(scale: number): void;
|
|
|
|
+ scale(scale: number): Vector2;
|
|
|
|
+ equals(other: Vector2): boolean;
|
|
length(): number;
|
|
length(): number;
|
|
lengthSquared(): number;
|
|
lengthSquared(): number;
|
|
normalize();
|
|
normalize();
|
|
@@ -125,30 +134,54 @@ declare module BABYLON {
|
|
|
|
|
|
toString(): string;
|
|
toString(): string;
|
|
|
|
|
|
|
|
+ addInPlace(otherVector: Vector3): void;
|
|
add(other: Vector3): Vector3;
|
|
add(other: Vector3): Vector3;
|
|
|
|
+ addToRef(otherVector: Vector3, result: Vector3): void;
|
|
|
|
+ suntractInPlace(otherVector: Vector3): void;
|
|
subtract(other: Vector3): Vector3;
|
|
subtract(other: Vector3): Vector3;
|
|
|
|
+ subtractToRef(otherVector: Vector3, result: Vector3): void;
|
|
|
|
+ subtractFromFloatsTo(x: number, y: number, z: number): Vector3;
|
|
|
|
+ subtractFromFloatsToRef(x: number, y: number, z: number, result: Vector3): void;
|
|
negate(): Vector3;
|
|
negate(): Vector3;
|
|
- scale(factor: number): Vector3;
|
|
|
|
- equals(other: Vector3): bool;
|
|
|
|
|
|
+ scaleInPlace(scale: number): void;
|
|
|
|
+ scale(scale: number): Vector3;
|
|
|
|
+ scaleToRef(scale: number, result: Vector3): void;
|
|
|
|
+ equals(other: Vector3): boolean;
|
|
|
|
+ equalsToFloats(x: number, y: number, z: number): boolean;
|
|
|
|
+ multiplyInPlace(other: Vector3): void;
|
|
multiply(other: Vector3): Vector3;
|
|
multiply(other: Vector3): Vector3;
|
|
|
|
+ multiplyToRef(otherVector: Vector3, result: Vector3): void
|
|
|
|
+ multiplyByFloats(x: number, y: number, z: number): Vector3;
|
|
divide(other: Vector3): Vector3;
|
|
divide(other: Vector3): Vector3;
|
|
|
|
+ divideToRef(otherVector: Vector3, result: Vector3): void;
|
|
length(): number;
|
|
length(): number;
|
|
lengthSquared(): number;
|
|
lengthSquared(): number;
|
|
normalize();
|
|
normalize();
|
|
clone(): Vector3;
|
|
clone(): Vector3;
|
|
|
|
+ copyFrom(source: Vector3): void;
|
|
|
|
+ copyFromFloats(x: number, y: number, z: number): void;
|
|
|
|
|
|
- static FromArray(array: number[], offset?: number = 0);
|
|
|
|
|
|
+ static FromArray(array: number[], offset: number);
|
|
|
|
+ static FromArrayToRef(array: number[], offset: number, result: Vector3): void;
|
|
|
|
+ static FromFloatsToRef(x: number, y: number, z: number, result: Vector3): void;
|
|
static Zero(): Vector3;
|
|
static Zero(): Vector3;
|
|
static Up(): Vector3;
|
|
static Up(): Vector3;
|
|
- static TransformCoordinates(vector: Vector3, transformation: Matrix);
|
|
|
|
- static TransformNormal(vector: Vector3, transformation: Matrix);
|
|
|
|
|
|
+ static TransformCoordinates(vector: Vector3, transformation: Matrix): Vector3;
|
|
|
|
+ static TransformCoordinatesToRef(vector: Vector3, transformation: Matrix, result: Vector3): void;
|
|
|
|
+ static TransformCoordinatesFromFloatsToRef(x: number, y: number, z: number, transformation: Matrix, result: Vector3): void;
|
|
|
|
+ static TransformNormal(vector: Vector3, transformation: Matrix): Vector3;
|
|
|
|
+ static TransformNormalToRef(vector: Vector3, transformation: Matrix, result: Vector3): void;
|
|
|
|
+ static TransformNormalFromFloatsToRef(x: number, y: number, z: number, transformation: Matrix, result: Vector3): void;
|
|
|
|
|
|
static CatmullRom(value1: Vector3, value2: Vector3, value3: Vector3, value4: Vector3, amount: number): Vector3;
|
|
static CatmullRom(value1: Vector3, value2: Vector3, value3: Vector3, value4: Vector3, amount: number): Vector3;
|
|
static Clamp(value: Vector3, min: Vector3, max: Vector3): Vector3;
|
|
static Clamp(value: Vector3, min: Vector3, max: Vector3): Vector3;
|
|
static Hermite(value1: Vector3, tangent1: Vector3, value2: Vector3, tangent2: Vector3, amount: number): Vector3;
|
|
static Hermite(value1: Vector3, tangent1: Vector3, value2: Vector3, tangent2: Vector3, amount: number): Vector3;
|
|
static Lerp(start: Vector3, end: Vector3, amount: number): Vector3;
|
|
static Lerp(start: Vector3, end: Vector3, amount: number): Vector3;
|
|
static Dot(left: Vector3, right: Vector3): number;
|
|
static Dot(left: Vector3, right: Vector3): number;
|
|
|
|
+ static Cross(left: Vector3, right: Vector3): Vector3;
|
|
|
|
+ static CrossToRef(left: Vector3, right: Vector3, result: Vector3): void;
|
|
static Normalize(vector: Vector3): Vector3;
|
|
static Normalize(vector: Vector3): Vector3;
|
|
|
|
+ static NormalizeToRef(vector: Vector3, result: Vector3): void;
|
|
static Unproject(source: Vector3,
|
|
static Unproject(source: Vector3,
|
|
viewportWidth: number,
|
|
viewportWidth: number,
|
|
viewportHeight: number,
|
|
viewportHeight: number,
|
|
@@ -168,14 +201,25 @@ declare module BABYLON {
|
|
z: number;
|
|
z: number;
|
|
w: number;
|
|
w: number;
|
|
|
|
|
|
|
|
+ toString(): string;
|
|
|
|
+
|
|
constructor(x: number, y: number, z: number, w: number);
|
|
constructor(x: number, y: number, z: number, w: number);
|
|
|
|
|
|
|
|
+ equals(otherQuaternion: Quaternion): boolean;
|
|
clone(): Quaternion;
|
|
clone(): Quaternion;
|
|
|
|
+ copyFrom(other: Quaternion): void;
|
|
add(other: Quaternion): Quaternion;
|
|
add(other: Quaternion): Quaternion;
|
|
scale(factor: number): Quaternion;
|
|
scale(factor: number): Quaternion;
|
|
|
|
+ multiply(q1: Quaternion): Quaternion;
|
|
|
|
+ multiplyToRef(q1: Quaternion, result: Quaternion): void;
|
|
|
|
+ length(): number;
|
|
|
|
+ normalize(): void;
|
|
toEulerAngles(): Vector3;
|
|
toEulerAngles(): Vector3;
|
|
|
|
+ toRotationMatrix(result: Quaternion): void;
|
|
|
|
|
|
- static FromArray(array: number[], offset?: number = 0): Quaternion;
|
|
|
|
|
|
+ static FromArray(array: number[], offset: number): Quaternion;
|
|
|
|
+ static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Quaternion;
|
|
|
|
+ static RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: Quaternion): void;
|
|
static Slerp(left: Quaternion, right: Quaternion, amount: number): Quaternion;
|
|
static Slerp(left: Quaternion, right: Quaternion, amount: number): Quaternion;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -184,51 +228,83 @@ declare module BABYLON {
|
|
|
|
|
|
constructor();
|
|
constructor();
|
|
|
|
|
|
- isIdentity(): bool;
|
|
|
|
|
|
+ isIdentity(): boolean;
|
|
determinant(): number;
|
|
determinant(): number;
|
|
toArray(): number[];
|
|
toArray(): number[];
|
|
invert(): void;
|
|
invert(): void;
|
|
|
|
+ invertToRef(other: Matrix): void;
|
|
|
|
+ setTranslations(vector3: Vector3): void;
|
|
multiply(other: Matrix): Matrix;
|
|
multiply(other: Matrix): Matrix;
|
|
- equals(other: Matrix): Matrix;
|
|
|
|
|
|
+ copyFrom(other: Matrix): void;
|
|
|
|
+ multiplyToRef(other: Matrix, result: Matrix): void;
|
|
|
|
+ multiplyToArray(other: Matrix, result: number[], offset: number): void;
|
|
|
|
+ equals(other: Matrix): boolean;
|
|
clone(): Matrix;
|
|
clone(): Matrix;
|
|
|
|
|
|
|
|
+ static FromArray(array: number[], offset: number): Matrix;
|
|
|
|
+ static FromArrayToRef(array: number[], offset: number, result: Matrix): void;
|
|
static FromValues(m11: number, m12: number, m13: number, m14: number,
|
|
static FromValues(m11: number, m12: number, m13: number, m14: number,
|
|
m21: number, m22: number, m23: number, m24: number,
|
|
m21: number, m22: number, m23: number, m24: number,
|
|
m31: number, m32: number, m33: number, m34: number,
|
|
m31: number, m32: number, m33: number, m34: number,
|
|
m41: number, m42: number, m43: number, m44: number): Matrix;
|
|
m41: number, m42: number, m43: number, m44: number): Matrix;
|
|
|
|
+ static FromValuesToRef(m11: number, m12: number, m13: number, m14: number,
|
|
|
|
+ m21: number, m22: number, m23: number, m24: number,
|
|
|
|
+ m31: number, m32: number, m33: number, m34: number,
|
|
|
|
+ m41: number, m42: number, m43: number, m44: number, result: Matrix): void;
|
|
static Identity(): Matrix;
|
|
static Identity(): Matrix;
|
|
|
|
+ static IdentityToRef(result: Matrix): void;
|
|
static Zero(): Matrix;
|
|
static Zero(): Matrix;
|
|
static RotationX(angle: number): Matrix;
|
|
static RotationX(angle: number): Matrix;
|
|
|
|
+ static RotationXToRef(angle: number, result: Matrix): void;
|
|
static RotationY(angle: number): Matrix;
|
|
static RotationY(angle: number): Matrix;
|
|
|
|
+ static RotationYToRef(angle: number, result: Matrix): void;
|
|
static RotationZ(angle: number): Matrix;
|
|
static RotationZ(angle: number): Matrix;
|
|
|
|
+ static RotationZToRef(angle: number, result: Matrix): void;
|
|
static RotationAxis(axis: Vector3, angle: number): Matrix;
|
|
static RotationAxis(axis: Vector3, angle: number): Matrix;
|
|
static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Matrix;
|
|
static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Matrix;
|
|
static Scaling(scaleX: number, scaleY: number, scaleZ: number): Matrix;
|
|
static Scaling(scaleX: number, scaleY: number, scaleZ: number): Matrix;
|
|
|
|
+ static ScalingToRef(scaleX: number, scaleY: number, scaleZ: number, result: Matrix): void;
|
|
static Translation(x: number, y: number, z: number): Matrix;
|
|
static Translation(x: number, y: number, z: number): Matrix;
|
|
|
|
+ static TranslationToRef(x: number, y: number, z: number, result: Matrix): void;
|
|
static LookAtLH(eye: Vector3, target: Vector3, up: Vector3): Matrix;
|
|
static LookAtLH(eye: Vector3, target: Vector3, up: Vector3): Matrix;
|
|
|
|
+ static LookAtLHToRef(eye: Vector3, target: Vector3, up: Vector3, result: Matrix): void;
|
|
static OrthoLH(width: number, height: number, znear: number, zfar: number): Matrix;
|
|
static OrthoLH(width: number, height: number, znear: number, zfar: number): Matrix;
|
|
static OrthoOffCenterLH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number): Matrix;
|
|
static OrthoOffCenterLH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number): Matrix;
|
|
|
|
+ static OrthoOffCenterLHToRef(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result: Matrix): void;
|
|
static PerspectiveLH(width: number, height: number, znear: number, zfar: number): Matrix;
|
|
static PerspectiveLH(width: number, height: number, znear: number, zfar: number): Matrix;
|
|
static PerspectiveFovLH(fov: number, aspect: number, znear: number, zfar: number): Matrix;
|
|
static PerspectiveFovLH(fov: number, aspect: number, znear: number, zfar: number): Matrix;
|
|
|
|
+ static PerspectiveFovLHToRef(fov: number, aspect: number, znear: number, zfar: number, result: Matrix): void;
|
|
static AffineTransformation(scaling: number, rotationCenter: Vector3, rotation: Quaternion, translation: Vector3): Matrix;
|
|
static AffineTransformation(scaling: number, rotationCenter: Vector3, rotation: Quaternion, translation: Vector3): Matrix;
|
|
static GetFinalMatrix(viewport: Size2D, world: Matrix, view: Matrix, projection: Matrix): Matrix;
|
|
static GetFinalMatrix(viewport: Size2D, world: Matrix, view: Matrix, projection: Matrix): Matrix;
|
|
static Transpose(matrix: Matrix): Matrix;
|
|
static Transpose(matrix: Matrix): Matrix;
|
|
static Reflection(plane: Plane): Matrix;
|
|
static Reflection(plane: Plane): Matrix;
|
|
|
|
+ static ReflectionToRef(plane: Plane, result: Matrix): void;
|
|
}
|
|
}
|
|
|
|
|
|
class Plane {
|
|
class Plane {
|
|
normal: Vector3;
|
|
normal: Vector3;
|
|
d: number;
|
|
d: number;
|
|
|
|
|
|
|
|
+ constructor(a: number, b: number, c: number, d: number);
|
|
|
|
+
|
|
normalize(): void;
|
|
normalize(): void;
|
|
transform(transformation: Matrix): Plane;
|
|
transform(transformation: Matrix): Plane;
|
|
dotCoordinate(point: Vector3): number;
|
|
dotCoordinate(point: Vector3): number;
|
|
|
|
+ copyFromPoints(point1: Vector3, point2: Vector3, point3: Vector3): void;
|
|
|
|
+ isFrontFacingTo(direction: Vector3, epsilon: Vector3): boolean;
|
|
|
|
+ signedDistanceTo(point: Vector3): number;
|
|
|
|
|
|
static FromArray(array: number[]): Plane;
|
|
static FromArray(array: number[]): Plane;
|
|
static FromPoints(point1: Vector3, point2: Vector3, point3: Vector3): Plane;
|
|
static FromPoints(point1: Vector3, point2: Vector3, point3: Vector3): Plane;
|
|
|
|
+ static FromPositionAndNormal(origin: Vector3, normal: Vector2): Plane;
|
|
|
|
+ static SignedDistanceToPlaneFromPositionAndNormal(origin: Vector3, normal: Vector3, point): number;
|
|
}
|
|
}
|
|
|
|
|
|
class Frustum {
|
|
class Frustum {
|
|
|
|
+ frustrumPlanes: Plane[];
|
|
|
|
+
|
|
|
|
+ constructor(transform: Matrix);
|
|
|
|
+
|
|
static GetPlanes(transform: Matrix): Plane[];
|
|
static GetPlanes(transform: Matrix): Plane[];
|
|
}
|
|
}
|
|
}
|
|
}
|