Plane.html 5.6 KB
Newer Older
1 2 3
<!DOCTYPE html>
<html lang="en">
	<head>
M
Mr.doob 已提交
4 5 6 7 8
		<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" />
9 10 11
	</head>
	<body>
		<h1>[name]</h1>
M
Mr.doob 已提交
12

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


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

C
cjshannon 已提交
18

G
Greg Tatum 已提交
19
		<h3>[name]([page:Vector3 normal], [page:Float constant])</h3>
C
cjshannon 已提交
20
		<div>
21 22
		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 已提交
23
		</div>
M
Mr.doob 已提交
24 25


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

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

30
		<h3>[property:Float constant]</h3>
31

32
		<h2>Methods</h2>
M
Mr.doob 已提交
33 34 35



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

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

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

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

G
Greg Tatum 已提交
66
		<code>
67
		var optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix )
G
Greg Tatum 已提交
68
		</code>
C
cjshannon 已提交
69 70
		</div>

71
		<h3>[method:Vector3 orthoPoint]([page:Vector3 point], [page:Vector3 optionalTarget])</h3>
C
cjshannon 已提交
72
		<div>
73 74
		point -- [page:Vector3] <br />
		optionalTarget -- [page:Vector3]
C
cjshannon 已提交
75 76
		</div>
		<div>
77
		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 已提交
78 79
		</div>

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

88
		<h3>[method:Vector3 intersectLine]([page:Line3 line], [page:Vector3 optionalTarget]) or [page:undefined]</h3>
C
cjshannon 已提交
89
		<div>
90 91
		line -- [page:Line3] <br />
		optionalTarget -- [page:Vector3]
C
cjshannon 已提交
92 93
		</div>
		<div>
94
		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 已提交
95 96
		</div>

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

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

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

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

127
		<h3>[method:Plane setComponents]([page:Float x], [page:Float y], [page:Float z], [page:Float w]) [page:Plane this]</h3>
C
cjshannon 已提交
128
		<div>
129 130 131 132
		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 已提交
133 134
		</div>
		<div>
135
		Set the individual components that make up the plane.
C
cjshannon 已提交
136 137
		</div>

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

146
		<h3>[method:Plane setFromCoplanarPoints]([page:Vector3 a], [page:Vector3 b], [page:Vector3 c]) [page:Plane this]</h3>
C
cjshannon 已提交
147
		<div>
148 149 150
		a -- [page:Vector3] <br />
		b -- [page:Vector3] <br />
		c -- [page:Vector3]
C
cjshannon 已提交
151 152
		</div>
		<div>
153
		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 已提交
154 155
		</div>

156
		<h3>[method:Vector3 projectPoint]([page:Vector3 point], [page:Vector3 optionalTarget])</h3>
C
cjshannon 已提交
157
		<div>
158 159
		point -- [page:Vector3] <br />
		optionalTarget -- [page:Vector3]
C
cjshannon 已提交
160 161
		</div>
		<div>
162
		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 已提交
163 164
		</div>

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

170
		<h3>[method:Plane translate]([page:Vector3 offset]) [page:Plane this]</h3>
C
cjshannon 已提交
171
		<div>
172
		offset -- [page:Vector3]
C
cjshannon 已提交
173 174
		</div>
		<div>
175
		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 已提交
176 177
		</div>

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

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

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