Plane.html 5.6 KB
Newer Older
1 2 3
<!DOCTYPE html>
<html lang="en">
	<head>
4
		<meta charset="utf-8" />
5 6 7 8 9 10
		<script src="../../list.js"></script>
		<script src="../../page.js"></script>
		<link type="text/css" rel="stylesheet" href="../../page.css" />
	</head>
	<body>
		<h1>[name]</h1>
M
Mr.doob 已提交
11

G
Greg Tatum 已提交
12
		<div class="desc">A two dimensional surface that extends infinitely in 3d space.</div>
M
Mr.doob 已提交
13 14


15
		<h2>Constructor</h2>
M
Mr.doob 已提交
16

C
cjshannon 已提交
17

G
Greg Tatum 已提交
18
		<h3>[name]([page:Vector3 normal], [page:Float constant])</h3>
C
cjshannon 已提交
19
		<div>
20 21
		normal -- ([Page:Vector3]) normal vector defining the plane pointing towards the origin <br />
		constant -- ([Page:Float]) the negative distance from the origin to the plane along the normal vector
C
cjshannon 已提交
22
		</div>
M
Mr.doob 已提交
23 24


25
		<h2>Properties</h2>
M
Mr.doob 已提交
26

27
		<h3>[property:Vector3 normal]</h3>
G
Greg Tatum 已提交
28

29
		<h3>[property:Float constant]</h3>
G
Greg Tatum 已提交
30
		
31
		<h2>Methods</h2>
M
Mr.doob 已提交
32 33 34



35
		<h3>[method:Plane normalize]() [page:Plane this]</h3>
C
cjshannon 已提交
36
		<div>
G
Greg Tatum 已提交
37
		Normalizes the normal vector, and adjusts the constant value accordingly.
C
cjshannon 已提交
38 39
		</div>

40
		<h3>[method:Plane set]([page:Vector3 normal], [page:Float constant]) [page:Plane this]</h3>
C
cjshannon 已提交
41
		<div>
G
Greg Tatum 已提交
42
		normal -- [Page:Vector3] <br />
43
		constant -- [Page:Float]
C
cjshannon 已提交
44 45
		</div>
		<div>
G
Greg Tatum 已提交
46
		Sets the plane's values.
C
cjshannon 已提交
47 48
		</div>

49
		<h3>[method:Plane copy]([page:Plane plane]) [page:Plane this]</h3>
C
cjshannon 已提交
50
		<div>
G
Greg Tatum 已提交
51
		plane -- [page:Plane] to copy
C
cjshannon 已提交
52 53
		</div>
		<div>
G
Greg Tatum 已提交
54
		Copies the values of the passed plane to this plane.
C
cjshannon 已提交
55 56
		</div>

57
		<h3>[method:Plane applyMatrix4]([page:Matrix4 matrix], [page:Matrix3 optionalNormalMatrix]) [page:Plane this]</h3>
C
cjshannon 已提交
58
		<div>
G
Greg Tatum 已提交
59
		matrix -- [Page:Matrix4] to apply <br />
60
		optionalNormalMatrix -- (optional) pre-computed normal [Page:Matrix3] of the Matrix4 to apply
C
cjshannon 已提交
61 62
		</div>
		<div>
63
		Apply a Matrix4 to the plane. The second parameter is optional.
G
Greg Tatum 已提交
64 65 66 67
		
		<code>
		var optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix ) 
		</code>
C
cjshannon 已提交
68 69
		</div>

70
		<h3>[method:Vector3 orthoPoint]([page:Vector3 point], [page:Vector3 optionalTarget])</h3>
C
cjshannon 已提交
71
		<div>
72 73
		point -- [page:Vector3] <br />
		optionalTarget -- [page:Vector3]
C
cjshannon 已提交
74 75
		</div>
		<div>
76
		Returns a vector in the same direction as the Plane's normal, but the magnitude is passed point's original distance to the plane.
C
cjshannon 已提交
77 78
		</div>

79
		<h3>[method:Boolean isIntersectionLine]([page:Line3 line])</h3>
C
cjshannon 已提交
80
		<div>
81
		line -- [page:Line3]
C
cjshannon 已提交
82 83
		</div>
		<div>
84
		Tests whether a line segment intersects with the plane. (Do not mistake this for a collinear check.)
C
cjshannon 已提交
85 86
		</div>

87
		<h3>[method:Vector3 intersectLine]([page:Line3 line], [page:Vector3 optionalTarget]) or [page:undefined]</h3>
C
cjshannon 已提交
88
		<div>
89 90
		line -- [page:Line3] <br />
		optionalTarget -- [page:Vector3]
C
cjshannon 已提交
91 92
		</div>
		<div>
93
		Returns the intersection point of the passed line and the plane. Returns undefined if the line does not intersect. Returns the line's starting point if the line is coplanar with the plane.
C
cjshannon 已提交
94 95
		</div>

96
		<h3>[method:Vector3 setFromNormalAndCoplanarPoint]([page:Vector3 normal], [page:Vector3 point]) [page:Vector3 this]</h3>
C
cjshannon 已提交
97
		<div>
98 99
		normal -- [page:Vector3] <br />
		point -- [page:Vector3]
C
cjshannon 已提交
100 101
		</div>
		<div>
102
		Sets the plane's values as defined by a normal and arbitrary coplanar point.
C
cjshannon 已提交
103 104
		</div>

105
		<h3>[method:Plane clone]()</h3>
C
cjshannon 已提交
106
		<div>
107
		Returns a new copy of this plane.
C
cjshannon 已提交
108 109
		</div>

110
		<h3>[method:Float distanceToPoint]([page:Vector3 point])</h3>
C
cjshannon 已提交
111
		<div>
112
		point -- [page:Vector3]
C
cjshannon 已提交
113 114
		</div>
		<div>
115
		Returns the smallest distance from the point to the plane.
C
cjshannon 已提交
116 117
		</div>

118
		<h3>[method:Boolean equals]([page:Plane plane])</h3>
C
cjshannon 已提交
119
		<div>
120
		plane -- [page:Planen]
C
cjshannon 已提交
121 122
		</div>
		<div>
123
		Checks to see if two planes are equal (their normals and constants match)
C
cjshannon 已提交
124 125
		</div>

126
		<h3>[method:Plane setComponents]([page:Float x], [page:Float y], [page:Float z], [page:Float w]) [page:Plane this]</h3>
C
cjshannon 已提交
127
		<div>
128 129 130 131
		x -- [page:Float] x of the normal vector <br />
		y -- [page:Float] y of the normal vector<br />
		z -- [page:Float] z of the normal vector<br />
		w -- [page:Float] distance of the plane from the origin along the normal vector
C
cjshannon 已提交
132 133
		</div>
		<div>
134
		Set the individual components that make up the plane.
C
cjshannon 已提交
135 136
		</div>

137
		<h3>[method:Float distanceToSphere]([page:Sphere sphere])</h3>
C
cjshannon 已提交
138
		<div>
139
		sphere -- [Page:Sphere]
C
cjshannon 已提交
140 141
		</div>
		<div>
142
		Returns the smallest distance from an edge of the sphere to the plane.
C
cjshannon 已提交
143 144
		</div>

145
		<h3>[method:Plane setFromCoplanarPoints]([page:Vector3 a], [page:Vector3 b], [page:Vector3 c]) [page:Plane this]</h3>
C
cjshannon 已提交
146
		<div>
147 148 149
		a -- [page:Vector3] <br />
		b -- [page:Vector3] <br />
		c -- [page:Vector3]
C
cjshannon 已提交
150 151
		</div>
		<div>
152
		Defines the plane based on the 3 provided points. The winding order is counter clockwise, and determines which direction the normal will point.
C
cjshannon 已提交
153 154
		</div>

155
		<h3>[method:Vector3 projectPoint]([page:Vector3 point], [page:Vector3 optionalTarget])</h3>
C
cjshannon 已提交
156
		<div>
157 158
		point -- [page:Vector3] <br />
		optionalTarget -- [page:Vector3]
C
cjshannon 已提交
159 160
		</div>
		<div>
161
		Projects a point onto the plane. The projected point is the closest point on the plane to the passed point, so a line drawn from the projected point and the passed point would be orthogonal to the plane.
C
cjshannon 已提交
162 163
		</div>

164
		<h3>[method:Plane negate]() [page:Plane this]</h3>
C
cjshannon 已提交
165
		<div>
166
		Negates both the normal vector and constant, effectively mirroring the plane across the origin.
C
cjshannon 已提交
167 168
		</div>

169
		<h3>[method:Plane translate]([page:Vector3 offset]) [page:Plane this]</h3>
C
cjshannon 已提交
170
		<div>
171
		offset -- [page:Vector3]
C
cjshannon 已提交
172 173
		</div>
		<div>
174
		Translates the plane the distance defined by the vector. Note that this only affects the constant (distance from origin) and will not affect the normal vector.
C
cjshannon 已提交
175 176
		</div>

177
		<h3>[method:Vector3 coplanarPoint]([page:Vector3 optionalTarget])</h3>
C
cjshannon 已提交
178
		<div>
179
		optionalTarget -- [page:Vector3]
C
cjshannon 已提交
180 181
		</div>
		<div>
182
		Returns a coplanar point. (The projection of the normal vector at the origin onto the plane.)
C
cjshannon 已提交
183 184
		</div>

185
		<h2>Source</h2>
M
Mr.doob 已提交
186

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