forked from jbaroudi/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
three-projector.d.ts
97 lines (80 loc) · 2.8 KB
/
three-projector.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// Type definitions for three.js (Projector.js)
// Project: https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/Projector.js
// Definitions by: Satoru Kimura <https://github.com/gyohk>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="./three.d.ts" />
declare module THREE {
// Renderers / Renderables /////////////////////////////////////////////////////////////////////
export class RenderableObject {
constructor();
id: number;
object: Object;
z: number;
}
export class RenderableFace {
constructor();
id: number;
v1: RenderableVertex;
v2: RenderableVertex;
v3: RenderableVertex;
normalModel: Vector3;
vertexNormalsModel: Vector3[];
vertexNormalsLength: number;
color: Color;
material: Material;
uvs: Vector2[][];
z: number;
}
export class RenderableVertex {
constructor();
position: Vector3;
positionWorld: Vector3;
positionScreen: Vector4;
visible: boolean;
copy(vertex: RenderableVertex): void;
}
export class RenderableLine {
constructor();
id: number;
v1: RenderableVertex;
v2: RenderableVertex;
vertexColors: Color[];
material: Material;
z: number;
}
export class RenderableSprite {
constructor();
id: number;
object: Object;
x: number;
y: number;
z: number;
rotation: number;
scale: Vector2;
material: Material;
}
/**
* Projects points between spaces.
*/
export class Projector {
constructor();
// deprecated.
projectVector(vector: Vector3, camera: Camera): Vector3;
// deprecated.
unprojectVector(vector: Vector3, camera: Camera): Vector3;
/**
* Transforms a 3D scene object into 2D render data that can be rendered in a screen with your renderer of choice, projecting and clipping things out according to the used camera.
* If the scene were a real scene, this method would be the equivalent of taking a picture with the camera (and developing the film would be the next step, using a Renderer).
*
* @param scene scene to project.
* @param camera camera to use in the projection.
* @param sort select whether to sort elements using the Painter's algorithm.
*/
projectScene(scene: Scene, camera: Camera, sortObjects: boolean, sortElements?: boolean): {
objects: Object3D[]; // Mesh, Line or other object
sprites: Object3D[]; // Sprite or Particle
lights: Light[];
elements: Face3[]; // Line, Particle, Face3 or Face4
};
}
}