1 | <!DOCTYPE html>
|
---|
2 | <html lang="en">
|
---|
3 | <head>
|
---|
4 | <meta charset="utf-8" />
|
---|
5 | <script src="../../list.js"></script>
|
---|
6 | <script src="../../page.js"></script>
|
---|
7 | <link type="text/css" rel="stylesheet" href="../../page.css" />
|
---|
8 | </head>
|
---|
9 | <body>
|
---|
10 | <h1>[name]</h1>
|
---|
11 |
|
---|
12 | <div class="desc">A geometric line segment represented by a start and end point.</div>
|
---|
13 |
|
---|
14 |
|
---|
15 | <h2>Constructor</h2>
|
---|
16 |
|
---|
17 |
|
---|
18 | <h3>[name]([page:Vector3 start], [page:Vector3 end])</h3>
|
---|
19 | <div>
|
---|
20 | start -- [page:Vector3] Start of the line segment<br />
|
---|
21 | end -- [page:Vector3] End of the line segment
|
---|
22 | </div>
|
---|
23 | <div>
|
---|
24 | The start and end vectors default to origin vectors if none are set.
|
---|
25 | </div>
|
---|
26 |
|
---|
27 |
|
---|
28 | <h2>Properties</h2>
|
---|
29 |
|
---|
30 |
|
---|
31 |
|
---|
32 | <h3>.[page:Vector3 start]</h3>
|
---|
33 |
|
---|
34 | <h3>.[page:Vector3 end]</h3>
|
---|
35 |
|
---|
36 | <h2>Methods</h2>
|
---|
37 |
|
---|
38 |
|
---|
39 |
|
---|
40 | <h3>.set([page:Vector3 start], [page:Vector3 end]) [page:Line3]</h3>
|
---|
41 | <div>
|
---|
42 | start -- [page:Vector3] <br />
|
---|
43 | end -- [page:Vector3]
|
---|
44 | </div>
|
---|
45 | <div>
|
---|
46 | Sets the start and end values by copying the provided vectors.
|
---|
47 | </div>
|
---|
48 |
|
---|
49 | <h3>.copy([page:Line3 line]) [page:Line3]</h3>
|
---|
50 | <div>
|
---|
51 | line -- [page:Line3]
|
---|
52 | </div>
|
---|
53 | <div>
|
---|
54 | Copies the passed line's start and end vectors to this line.
|
---|
55 | </div>
|
---|
56 |
|
---|
57 | <h3>.clone() [page:Line3]</h3>
|
---|
58 | <div>
|
---|
59 | Return a new copy of this [page:Line3].
|
---|
60 | </div>
|
---|
61 |
|
---|
62 | <h3>.equals([page:Line3 line]) [page:Boolean]</h3>
|
---|
63 | <div>
|
---|
64 | line -- [page:Line3]
|
---|
65 | </div>
|
---|
66 | <div>
|
---|
67 |
|
---|
68 | <h3>.distance() [page:Float]</h3>
|
---|
69 | <div>
|
---|
70 | Returns the length of the line segment.
|
---|
71 | </div>
|
---|
72 | Returns true if both line's start and end points are equal.
|
---|
73 | </div>
|
---|
74 |
|
---|
75 | <h3>.distanceSq() [page:Float]</h3>
|
---|
76 | <div>
|
---|
77 | Returns the line segment's length squared.
|
---|
78 | </div>
|
---|
79 |
|
---|
80 | <h3>.applyMatrix4([page:Matrix4 matrix]) [page:Line3 this]</h3>
|
---|
81 | <div>
|
---|
82 | matrix -- [page:Matrix4]
|
---|
83 | </div>
|
---|
84 | <div>
|
---|
85 | Apply a matrix transform to the line segment.
|
---|
86 | </div>
|
---|
87 |
|
---|
88 | <h3>.at([page:Float t], [page:Vector3 optionalTarget]) [page:Vector]</h3>
|
---|
89 | <div>
|
---|
90 | t -- [page:Float] Use values 0-1 to return a result on the line segment. <br />
|
---|
91 | optionalTarget -- [page:Vector] Optional target to set the result.
|
---|
92 | </div>
|
---|
93 | <div>
|
---|
94 | Return a vector at a certain position along the line. When t = 0, it returns the start vector, and when t=1 it returns the end vector.
|
---|
95 | </div>
|
---|
96 |
|
---|
97 | <h3>.center([page:Vector3 optionalTarget]) [page:Vector3]</h3>
|
---|
98 | <div>
|
---|
99 | optionalTarget -- [page:Vector3] Optional target to set the result.
|
---|
100 | </div>
|
---|
101 | <div>
|
---|
102 | Return the center of the line segment.
|
---|
103 | </div>
|
---|
104 |
|
---|
105 | <h3>.delta([page:Vector3 optionalTarget]) [page:Vector3]</h3>
|
---|
106 | <div>
|
---|
107 | optionalTarget -- [page:Vector3] Optional target to set the result.
|
---|
108 | </div>
|
---|
109 | <div>
|
---|
110 | Returns the delta vector of the line segment, or the end vector minus the start vector.
|
---|
111 | </div>
|
---|
112 |
|
---|
113 | <h3>.closestPointToPoint([page:Vector3 point], [page:Boolean clampToLine], [page:Vector3 optionalTarget]) [page:Vector3]</h3>
|
---|
114 | <div>
|
---|
115 | point -- [page:Vector3] <br />
|
---|
116 | clampToLine -- [page:Boolean] <br />
|
---|
117 | optionalTarget -- [page:Vector3] Optional target to set the result.
|
---|
118 | </div>
|
---|
119 | <div>
|
---|
120 | Returns the closets point on the line. If clamp to line is true, then the returned value will be clamped to the line segment.
|
---|
121 | </div>
|
---|
122 |
|
---|
123 | <h3>.closestPointToPointParameter([page:Vector3 point], [page:Boolean clampToLine]) [page:Float]</h3>
|
---|
124 | <div>
|
---|
125 | point -- [page:Vector3] <br />
|
---|
126 | clampToLine -- [page:Boolean]
|
---|
127 | </div>
|
---|
128 | <div>
|
---|
129 | Returns a point parameter based on the closest point as projected on the line segement. If clamp to line is true, then the returned value will be between 0 and 1.
|
---|
130 | </div>
|
---|
131 |
|
---|
132 | <h2>Source</h2>
|
---|
133 |
|
---|
134 | [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
---|
135 | </body>
|
---|
136 | </html>
|
---|