File: Line3.html

package info (click to toggle)
three.js 111%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 15,184 kB
  • sloc: javascript: 133,174; makefile: 24; sh: 1
file content (125 lines) | stat: -rw-r--r-- 4,404 bytes parent folder | download | duplicates (2)
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<base href="../../../" />
		<script src="list.js"></script>
		<script src="page.js"></script>
		<link type="text/css" rel="stylesheet" href="page.css" />
	</head>
	<body>
		<h1>[name]</h1>

		<p class="desc">A geometric line segment represented by a start and end point.</p>


		<h2>Constructor</h2>


		<h3>[name]( [param:Vector3 start], [param:Vector3 end] )</h3>
		<p>
		[page:Vector3 start] - Start of the line segment. Default is (0, 0, 0).<br />
		[page:Vector3 end] - End of the line segment. Default is (0, 0, 0).<br /><br />

		Creates a new [name].
		</p>


		<h2>Properties</h2>

		<h3>[property:Vector3 start]</h3>
		<p>[page:Vector3] representing the start point of the line.</p>

		<h3>[property:Vector3 end]</h3>
		<p>[page:Vector3] representing the end point of the line.</p>





		<h2>Methods</h2>

		<h3>[method:Line3 applyMatrix4]( [param:Matrix4 matrix] )</h3>
		<p>Applies a matrix transform to the line segment.</p>

		<h3>[method:Vector3 at]( [param:Float t], [param:Vector3 target] )</h3>
		<p>
		[page:Float t] - Use values 0-1 to return a position along the line segment. <br />
		[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />

		Returns a vector at a certain position along the line. When [page:Float t] = 0, it returns the start vector,
		and when [page:Float t] = 1 it returns the end vector.<br />
		</p>

		<h3>[method:Line3 clone]()</h3>
		<p>Returns a new [page:Line3] with the same [page:.start start] and [page:.end end] vectors as this one.</p>

		<h3>[method:Vector3 closestPointToPoint]( [param:Vector3 point], [param:Boolean clampToLine], [param:Vector3 target] )</h3>
		<p>
		[page:Vector3 point] - return the closest point on the line to this point.<br />
		[page:Boolean clampToLine] - whether to clamp the returned value to the line segment.<br />
		[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />

		Returns the closets point on the line. If [page:Boolean clampToLine] is true, then the returned value will be
		clamped to the line segment.
		</p>

		<h3>[method:Float closestPointToPointParameter]( [param:Vector3 point], [param:Boolean clampToLine] )</h3>
		<p>
		[page:Vector3 point] - the point for which to return a point parameter. <br />
		[page:Boolean clampToLine] - Whether to clamp the result to the range [0, 1].<br /><br />

		Returns a point parameter based on the closest point as projected on the line segement.
		If [page:Boolean clampToLine] is true, then the returned value will be between 0 and 1.
		</p>

		<h3>[method:Line3 copy]( [param:Line3 line] )</h3>
		<p>Copies the passed line's [page:.start start] and [page:.end end] vectors to this line.</p>

		<h3>[method:Vector3 delta]( [param:Vector3 target] )</h3>
		<p>
		[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />

			Returns the delta vector of the line segment ( [page:.end end] vector minus the [page:.start start] vector).
		</p>

		<h3>[method:Float distance]()</h3>
		<p>Returns the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]
		(straight-line distance) between the line's [page:.start start] and [page:.end end] points.</p>

		<h3>[method:Float distanceSq]()</h3>
		<p>
			Returns the square of the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]
			(straight-line distance) between the line's [page:.start start]
			and [page:.end end] vectors.
		</p>

		<h3>[method:Boolean equals]( [param:Line3 line] )</h3>
		<p>
		[page:Line3 line]  - [page:Line3] to compare with this one.<br /><br />

		Returns true if both line's [page:.start start] and [page:.end en] points are equal.
		</p>

		<h3>[method:Vector3 getCenter]( [param:Vector3 target] )</h3>
		<p>
		[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />

		Returns the center of the line segment.
		</p>

		<h3>[method:Line3 set]( [param:Vector3 start], [param:Vector3 end] )</h3>
		<p>
		[page:Vector3 start] - set the [page:.start start point] of the line.<br />
		[page:Vector3 end] - set the [page:.end end point] of the line.<br /><br />

		Sets the start and end values by copying the provided vectors.
		</p>

		<h2>Source</h2>

		<p>
			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
		</p>
	</body>
</html>