forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vec3.d.ts
34 lines (32 loc) · 1.14 KB
/
vec3.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Type definitions for Vec3 Librairy
// Project: https://www.npmjs.com/package/vec3
// Definitions by: Xavier Stouder <https://github.com/xstoudi/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "vec3" {
class Vec3 {
constructor(x: number, y: number, z: number);
constructor(location: number[]);
constructor(location: {x: number; y: number; z: number});
constructor(locationStr: string);
set(x: number, y: number, z: number): Vec3;
update(other: Vec3): Vec3;
floored(): Vec3;
floor(): Vec3;
offset(dx: number, dy: number, dz: number): Vec3;
translate(dx: number, dy: number, dz: number): Vec3;
add(other: Vec3): Vec3;
substract(other: Vec3): Vec3;
plus(other: Vec3): Vec3;
minus(other: Vec3): Vec3;
scaled(scalar: number): Vec3;
abs(): Vec3
volume(): number;
modulus(): Vec3;
distanceTo(other: Vec3): number;
equals(other: Vec3): boolean;
toString(): string;
clone(): Vec3;
min(other: Vec3): Vec3;
max(other: Vec3): Vec3;
}
}