forked from Orillusion/orillusion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PickResult.ts
69 lines (59 loc) · 1.47 KB
/
PickResult.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
import { Color } from '../math/Color';
import { Triangle } from '../math/Triangle';
import { Vector2 } from '../math/Vector2';
import { Vector3 } from '../math/Vector3';
/**
* Pick up result information, including target Object3D, position, UV
* @internal
* @group IO
*/
export class PickResult {
/**
* the intersection point (local coordinates) on the model.
*/
public localPosition: Vector3 = new Vector3();
/**
* the intersection point (world coordinates) on the model.
*/
public worldPosition: Vector3 = new Vector3();
/**
* the uv on the model.
* Only when the PickType of the object is UVPick and the model has UV will it be valid
* @see PickType
*/
public uv: Vector2 = new Vector2();
/**
* the triangle index at the intersection position of mesh
*/
public faceIndex: number;
public isIn: boolean = false;
public t: number = 0;
public u: number = 0;
public v: number = 0;
/**
* the triangle at the intersection position of mesh
*/
public triangle: Triangle;
/**
* @internal
* the uv0 at the intersection position of mesh
*/
public v0: number;
/**
* @internal
* the uv1 at the intersection position of mesh
*/
public v1: number;
/**
* @internal
*/
public v2: number;
/**
* @internal
*/
public pickList: any;
/**
* @internal
*/
public color: Color; //= new Color();
}