-
Notifications
You must be signed in to change notification settings - Fork 1
/
Line3.d.ts
96 lines (96 loc) · 3.45 KB
/
Line3.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
import { Vector3 } from './Vector3';
import type { Matrix4 } from './Matrix4';
import { Base } from './Base';
/**
* A geometric line segment represented by a start and end point.
*/
export declare class Line3 extends Base {
start: Vector3;
end: Vector3;
/**
* Create a new instance.
* @param start - Start of the line segment. Default is (0, 0, 0).
* @param end - End of the line segment. Default is (0, 0, 0).
*/
constructor(start?: Vector3, end?: Vector3);
get isLine3(): boolean;
/**
* Update the start and end values by copying the provided vectors.
* @param start - set the start point of the line.
* @param end - set the end point of the line.
* @returns This instance.
*/
set(start: Vector3, end: Vector3): this;
/**
* Copies the passed line's start and end vectors to this line.
* @param line - The line.
* @returns This instance.
*/
copy(line: Line3): this;
/**
* Compute the center of the line segment.
* @param target - The result will be copied into this Vector3.
* @returns The center point
*/
getCenter(target?: Vector3): Vector3;
/**
* Compute the delta vector of the line segment (end vector minus the start vector).
* @param target - The result will be copied into this Vector3.
* @returns The resulting vector.
*/
delta(target?: Vector3): Vector3;
/**
* Compute the square of the Euclidean distance (straight-line distance)
* between the line's start and end vectors.
* @returns The distance squared.
*/
distanceSq(): number;
/**
* Compute the Euclidean distance (straight-line distance) between the line's start and end points.
* @returns The Euclidean distance.
*/
distance(): number;
/**
* Compute the scaled position along the line.
* When t = 0, it returns the start vector.
* When t = 1 it returns the end vector.
* @param t - Use values 0-1 to return a position along the line segment.
* @param target — the result will be copied into this Vector3.
* @returns The position on the line.
*/
at(t: number, target?: Vector3): Vector3;
/**
* Compute a point parameter based on the closest point as projected on the line segment.
* If clampToLine is true, then the returned value will be between 0 and 1.
* @param point - the point for which to return a point parameter.
* @param clampToLine - Whether to clamp the result to the range [0, 1].
* @returns The scaled proportion.
*/
closestPointToPointParameter(point: Vector3, clampToLine?: boolean): number;
/**
* Find the closest point on the line.
* If clampToLine is true, then the returned value will be clamped to the line segment.
* @param point - return the closest point on the line to this point.
* @param clampToLine - whether to clamp the returned value to the line segment.
* @param target - The result will be copied into this Vector3.
* @returns The closest point.
*/
closestPointToPoint(point: Vector3, clampToLine?: boolean, target?: Vector3): Vector3;
/**
* Applies a matrix transform to the line segment.
* @param matrix - The transform.
* @returns This instance.
*/
applyMatrix4(matrix: Matrix4): this;
/**
* Test for value equality.
* @param line - Line3 to compare with this one.
* @returns True if both line's start and end points are equal.
*/
equals(line: Line3): boolean;
/**
* Create a new Line3 with the same start and end vectors as this one.
* @returns The new instance.
*/
clone(): Line3;
}