提交 d2b7172e 编写于 作者: W WestLangley 提交者: GitHub

Merge branch 'dev' into dev-normal_material

此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -59,8 +59,6 @@
<h3>[method:Vector3 getWorldDirection]( [page:Vector3 optionalTarget] )</h3>
<div>
vector — (optional)<br /><br />
Returns a vector representing the direction in which the camera is looking,
in world space. If the [page:Vector3 optionalTarget] is set, returns a vector representing the direction
from the camera's position to the [page:Vector3 optionalTarget].
......
......@@ -217,29 +217,32 @@
<h3>[method:Quaternion getWorldQuaternion]( [page:Quaternion optionalTarget] )</h3>
<div>
optionalTarget — (optional) target to set the result. Otherwise, a new [page:Quaternion] is
instantiated. <br /><br />
optionalTarget — (optional) if specified, the result will be copied into this Quaternion,
otherwise a new Quaternion will be created. <br /><br />
Returns a quaternion representing the rotation of the object in world space.
</div>
<h3>[method:Euler getWorldRotation]( [page:Euler optionalTarget] )</h3>
<div>
optionalTarget — (optional) target to set the result. Otherwise, a new [page:Euler] is instantiated.<br /><br />
optionalTarget — (optional) if specified, the result will be copied into this Euler,
otherwise a new Euler will be created. <br /><br />
Returns the euler angles representing the rotation of the object in world space.
</div>
<h3>[method:Vector3 getWorldScale]( [page:Vector3 optionalTarget] )</h3>
<div>
optionalTarget — (optional) target to set the result. Otherwise, a new [page:Vector3] is instantiated.<br /><br />
[page:Vector3 optionalTarget] — (optional) if specified, the result will be copied into this Vector3,
otherwise a new Vector3 will be created. <br /><br />
Returns a vector of the scaling factors applied to the object for each axis in world space.
</div>
<h3>[method:Vector3 getWorldDirection]( [page:Vector3 optionalTarget] )</h3>
<div>
optionalTarget — (optional) target to set the result. Otherwise, a new [page:Vector3] is instantiated.<br /><br />
[page:Vector3 optionalTarget] — (optional) if specified, the result will be copied into this Vector3,
otherwise a new Vector3 will be created. <br /><br />
Returns a vector representing the direction of object's positive z-axis in world space.
</div>
......
......@@ -542,21 +542,6 @@
<h2>Shaders</h2>
<h3>[page:UniformsUtils]</h3>
<div>
UniformsUtils.merge() has been deprecated. Use Object.assign() instead.<br /><br />
UniformsUtils.clone() has been deprecated.
</div>
<h2>Textures</h2>
<h3>[page:ImageUtils]</h3>
......
......@@ -14,24 +14,6 @@
<div class="desc">This can be used as a helper object to view the edges of a [page:Geometry Geometry] object.</div>
<!-- <iframe id="scene" src="scenes/geometry-browser.html#EdgeGeometry"></iframe>
<script>
// iOS iframe auto-resize workaround
if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
var scene = document.getElementById( 'scene' );
scene.style.width = getComputedStyle( scene ).width;
scene.style.height = getComputedStyle( scene ).height;
scene.setAttribute( 'scrolling', 'no' );
}
</script> -->
<h2>Example</h2>
[example:webgl_helpers helpers]
......@@ -39,15 +21,16 @@
<code>
var geometry = new THREE.BoxBufferGeometry( 100, 100, 100 );
var edges = new THREE.EdgesGeometry( geometry );
var line = new THREE.LineSegments( edges );
var line = new THREE.LineSegments( edges, new THREE.LineBasicMaterial( { color: 0xffffff } ) );
scene.add( line );
</code>
<h2>Constructor</h2>
<h3>[name]( [page:Geometry geometry] )</h3>
<h3>[name]( [page:Geometry geometry], [page:Integer thresholdAngle] )</h3>
<div>
geometry — any geometry object.
geometry — Any geometry object.<br />
thresholdAngle — An edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree.
</div>
<h2>Source</h2>
......
......@@ -58,7 +58,7 @@
</div>
<h3>[property:Object textures]</h3>
<div>Object holding any textures used by the material. See [page.setTextures].</div>
<div>Object holding any textures used by the material. See [page:.setTextures].</div>
<h2>Methods</h2>
......
......@@ -10,7 +10,9 @@
<body>
<h1>[name]</h1>
<div class="desc">Represents a boundary box in 2D space.</div>
<div class="desc">
Represents a box in 2D space.
</div>
<h2>Constructor</h2>
......@@ -18,11 +20,13 @@
<h3>[name]( [page:Vector2 min], [page:Vector2 max] )</h3>
<div>
min -- Lower (x, y) boundary of the box.<br>
max -- Upper (x, y) boundary of the box.
</div>
<div>
Creates a box bounded by min and max.
[page:Vector2 min] - (optional) [page:Vector2] representing the lower (x, y) boundary of the box.
Default is ( + Infinity, + Infinity ).<br>
[page:Vector2 max] - (optional) [page:Vector2] representing the lower upper (x, y) boundary of the box.
Default is ( - Infinity, - Infinity ).<br /><br />
Creates a [name] bounded by min and max.
</div>
......@@ -32,203 +36,186 @@
<h3>[property:Vector2 min]</h3>
<div>
Lower (x, y) boundary of this box.
[page:Vector2] representing the lower (x, y) boundary of the box.<br />
Default is ( + Infinity, + Infinity ).
</div>
<h3>[property:Vector2 max]</h3>
<div>
Upper (x, y) boundary of this box.
[page:Vector2] representing the lower upper (x, y) boundary of the box.<br />
Default is ( - Infinity, - Infinity ).
</div>
<h2>Methods</h2>
<h2>Methods</h2>
<h3>[method:Box2 set]( [page:Vector2 min], [page:Vector2 max] ) [page:Box2 this]</h3>
<h3>[method:Vector2 clampPoint]( [page:Vector2 point], [page:Vector2 optionalTarget] )</h3>
<div>
min -- Lower (x, y) boundary of the box. <br>
max -- Upper (x, y) boundary of the box.
</div>
<div>
Sets the lower and upper (x, y) boundaries of this box.
</div>
[page:Vector2 point] - [page:Vector2] to clamp. <br>
[page:Vector2 optionalTarget] — (optional) if specified, the result will be copied into this Vector2,
otherwise a new Vector2 will be created. <br /><br />
<h3>[method:Box2 expandByPoint]( [page:Vector2 point] ) [page:Box2 this]</h3>
<div>
point -- Point that should be included in the box.
</div>
<div>
Expands the boundaries of this box to include *point*.
[link:https://en.wikipedia.org/wiki/Clamping_(graphics) Clamps] the [page:Vector2 point] within the bounds of this box.<br />
</div>
<h3>[method:Vector2 clampPoint]( [page:Vector2 point], [page:Vector2 optionalTarget] ) [page:Box2 this]</h3>
<div>
point -- Position to clamp. <br>
optionalTarget -- If specified, the clamped result will be copied here.
</div>
<div>
Clamps *point* within the bounds of this box.
</div>
<h3>[method:Box2 clone]()</h3>
<div>Returns a new [page:Box2] with the same [page:.min min] and [page:.max max] as this one.</div>
<h3>[method:Boolean intersectsBox]( [page:Box2 box] ) [page:Box2 this]</h3>
<h3>[method:Boolean containsBox]( [page:Box2 box] )</h3>
<div>
box -- Box to check for intersection against.
[page:Box2 box] - [page:Box2 Box2] to test for inclusion.<br /><br />
Returns true if this box includes the entirety of [page:Box2 box]. If this and [page:Box2 box] are identical, <br>
this function also returns true.
</div>
<h3>[method:Boolean containsPoint]( [page:Vector2 point] )</h3>
<div>
Determines whether or not this box intersects *box*.
[page:Vector2 point] - [page:Vector2] to check for inclusion.<br /><br />
Returns true if the specified [page:Vector2 point] lies within or on the boundaries of this box.
</div>
<h3>[method:Box2 setFromPoints]( [page:Array points] ) [page:Box2 this]</h3>
<h3>[method:Box2 copy]( [page:Box2 box] )</h3>
<div>
points -- Set of points that the resulting box will envelop.
Copies the [page:.min min] and [page:.max max] from [page:Box2 box] to this box.
</div>
<h3>[method:Float distanceToPoint]( [page:Vector2 point] )</h3>
<div>
Sets the upper and lower bounds of this box to include all of the points in *points*.
[page:Vector2 point] - [page:Vector2] to measure distance to.<br /><br />
Returns the distance from any edge of this box to the specified point.
If the [page:Vector2 point] lies inside of this box, the distance will be 0.
</div>
<h3>[method:Vector2 getSize]( [page:Vector2 optionalTarget] ) [page:Box2 this]</h3>
<h3>[method:Boolean equals]( [page:Box2 box] )</h3>
<div>
optionalTarget -- If specified, the result will be copied here.
[page:Box2 box] - Box to compare with this one.<br /><br />
Returns true if this box and [page:Box2 box] share the same lower and upper bounds.
</div>
<h3>[method:Box2 expandByPoint]( [page:Vector2 point] )</h3>
<div>
Returns the width and height of this box.
[page:Vector2 point] - [page:Vector2] that should be included in the box.<br /><br />
Expands the boundaries of this box to include [page:Vector2 point].
</div>
<h3>[method:Box2 union]( [page:Box2 box] ) [page:Box2 this]</h3>
<h3>[method:Box2 expandByScalar]( [page:float scalar] )</h3>
<div>
box -- Box that will be unioned with this box.
[page:float scalar] - Distance to expand the box by.<br /><br />
Expands each dimension of the box by [page:float scalar]. If negative, the dimensions of the box
will be contracted.
</div>
<h3>[method:Box2 expandByVector]( [page:Vector2 vector] )</h3>
<div>
Unions this box with *box* setting the upper bound of this box to the greater of the <br>
two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes' <br>
lower bounds.
[page:Vector2 vector] - [page:Vector2] to expand the box by.<br /><br />
Expands this box equilaterally by [page:Vector2 vector]. The width of this box will be
expanded by the x component of [page:Vector2 vector] in both directions. The height of
this box will be expanded by the y component of [page:Vector2 vector] in both directions.
</div>
<h3>[method:Vector2 getParameter]( [page:Vector2 point], [page:Vector2 optionalTarget] ) [page:Box2 this]</h3>
<h3>[method:Vector2 getCenter]( [page:Vector2 optionalTarget] )</h3>
<div>
point -- [page:Vector2]<br/>
optionalTarget -- [page:Vector2]<br/>
[page:Vector2 optionalTarget] — (optional) if specified, the result will be copied into this Vector2,
otherwise a new Vector2 will be created. <br /><br />
Returns the center point of the box as a [page:Vector2].
</div>
<h3>[method:Vector2 getParameter]( [page:Vector2 point], [page:Vector2 optionalTarget] ) </h3>
<div>
[page:Vector2 point] - [page:Vector2].<br/>
[page:Vector2 optionalTarget] — (optional) if specified, the result will be copied into this Vector2,
otherwise a new Vector2 will be created. <br /><br />
Returns a point as a proportion of this box's width and height.
</div>
<h3>[method:Box2 expandByScalar]( [page:float scalar] ) [page:Box2 this]</h3>
<h3>[method:Vector2 getSize]( [page:Vector2 optionalTarget] )</h3>
<div>
scalar -- Distance to expand.
</div>
<div>
Expands each dimension of the box by *scalar*. If negative, the dimensions of the box <br>
will be contracted.
</div>
[page:Vector2 optionalTarget] — (optional) if specified, the result will be copied into this Vector2,
otherwise a new Vector2 will be created. <br /><br />
<h3>[method:Box2 intersect]( [page:Box2 box] ) [page:Box2 this]</h3>
<div>
box -- Box to intersect with.
Returns the width and height of this box.
</div>
<h3>[method:Box2 intersect]( [page:Box2 box] )</h3>
<div>
Returns the intersection of this and *box*, setting the upper bound of this box to the lesser <br>
of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes' <br>
[page:Box2 box] - Box to intersect with.<br /><br />
Returns the intersection of this and [page:Box2 box], setting the upper bound of this box to the lesser
of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes'
lower bounds.
</div>
<h3>[method:Boolean containsBox]( [page:Box2 box] ) [page:Box2 this]</h3>
<div>
box -- Box to test for inclusion.
</div>
<h3>[method:Boolean intersectsBox]( [page:Box2 box] )</h3>
<div>
Returns true if this box includes the entirety of *box*. If this and *box* overlap exactly, <br>
this function also returns true.
</div>
[page:Box2 box] - Box to check for intersection against.<br /><br />
<h3>[method:Box2 translate]( [page:Vector2 offset] ) [page:Box2 this]</h3>
<div>
offset -- Direction and distance of offset.
</div>
<div>
Adds *offset* to both the upper and lower bounds of this box, effectively moving this box <br>
*offset* units in 2D space.
Determines whether or not this box intersects [page:Box2 box].
</div>
<h3>[method:Boolean isEmpty]() [page:Box2 this]</h3>
<h3>[method:Boolean isEmpty]()</h3>
<div>
Returns true if this box includes zero points within its bounds.<br>
Note that a box with equal lower and upper bounds still includes one point, the <br>
Note that a box with equal lower and upper bounds still includes one point, the
one both bounds share.
</div>
<h3>[method:Box2 clone]() [page:Box2 this]</h3>
<div>
Returns a copy of this box.
</div>
<h3>[method:Box2 makeEmpty]()</h3>
<div>Makes this box empty.</div>
<h3>[method:Boolean equals]( [page:Box2 box] ) [page:Box2 this]</h3>
<div>
box -- Box to compare.
</div>
<div>
Returns true if this box and *box* share the same lower and upper bounds.
</div>
<h3>[method:Box2 expandByVector]( [page:Vector2 vector] ) [page:Box2 this]</h3>
<div>
vector -- Amount to expand this box in each dimension.
</div>
<h3>[method:Box2 set]( [page:Vector2 min], [page:Vector2 max] )</h3>
<div>
Expands this box equilaterally by *vector*. The width of this box will be <br>
expanded by the x component of *vector* in both directions. The height of <br>
this box will be expanded by the y component of *vector* in both directions.
</div>
[page:Vector2 min] - (required ) [page:Vector2] representing the lower (x, y) boundary of the box. <br>
[page:Vector2 max] - (required) [page:Vector2] representing the lower upper (x, y) boundary of the box. <br /><br />
<h3>[method:Box2 copy]( [page:Box2 box] ) [page:Box2 this]</h3>
<div>
box -- Box to copy.
</div>
<div>
Copies the values of *box* to this box.
Sets the lower and upper (x, y) boundaries of this box.
</div>
<h3>[method:Box2 makeEmpty]() [page:Box2 this]</h3>
<h3>[method:Box2 setFromCenterAndSize]( [page:Vector2 center], [page:Vector2 size] )</h3>
<div>
Makes this box empty.
</div>
[page:Vector2 center] - Desired center position of the box ([page:Vector2]). <br>
[page:Vector2 size] - Desired x and y dimensions of the box ([page:Vector2]).<br /><br />
<h3>[method:Vector2 getCenter]( [page:Vector2 optionalTarget] ) [page:Box2 this]</h3>
<div>
optionalTarget -- If specified, the result will be copied here.
</div>
<div>
Returns the center point of this box.
Centers this box on [page:Vector2 center] and sets this box's width and height to the values specified
in [page:Vector2 size].
</div>
<h3>[method:Float distanceToPoint]( [page:Vector2 point] ) [page:Box2 this]</h3>
<h3>[method:Box2 setFromPoints]( [page:Array points] )</h3>
<div>
point -- Point to measure distance to.
</div>
<div>
Returns the distance from any edge of this box to the specified point. <br>
If the point lies inside of this box, the distance will be 0.
</div>
[page:Array points] - Array of [page:Vector2 Vector2s] that the resulting box will contain.<br /><br />
<h3>[method:Boolean containsPoint]( [page:Vector2 point] ) [page:Box2 this]</h3>
<div>
point -- [page:Vector2] to check for inclusion.
</div>
<div>
Returns true if the specified point lies within the boundaries of this box.
Sets the upper and lower bounds of this box to include all of the points in [page:Array points].
</div>
<h3>[method:Box2 setFromCenterAndSize]( [page:Vector2 center], [page:Vector2 size] ) [page:Box2 this]</h3>
<h3>[method:Box2 translate]( [page:Vector2 offset] )</h3>
<div>
center -- Desired center position of the box. <br>
size -- Desired x and y dimensions of the box.
[page:Vector2 offset] - Direction and distance of offset.<br /><br />
Adds [page:Vector2 offset] to both the upper and lower bounds of this box, effectively moving this box
[page:Vector2 offset] units in 2D space.
</div>
<h3>[method:Box2 union]( [page:Box2 box] )</h3>
<div>
Centers this box on *center* and sets this box's width and height to the values specified <br>
in *size*.
[page:Box2 box] - Box that will be unioned with this box.<br /><br />
Unions this box with [page:Box2 box], setting the upper bound of this box to the greater of the
two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes'
lower bounds.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -10,282 +10,276 @@
<body>
<h1>[name]</h1>
<div class="desc">Represents a boundary box in 3d space.</div>
<div class="desc">
Represents a box or cube in 3D space. The main purpose of this is to represent
the [link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Boxes]
for objects.
</div>
<h2>Constructor</h2>
<h3>[name]( [page:Vector3 min], [page:Vector3 max] )</h3>
<div>
min -- Lower (x, y, z) boundary of the box.<br>
max -- Upper (x, y, z) boundary of the box.
</div>
<div>
Creates a box bounded by min and max.
[page:Vector3 min] - (optional) [page:Vector3] representing the lower (x, y, z) boundary of the box.
Default is ( + Infinity, + Infinity, + Infinity ).<br>
[page:Vector3 max] - (optional) [page:Vector3] representing the lower upper (x, y, z) boundary of the box.
Default is ( - Infinity, - Infinity, - Infinity ).<br /><br />
Creates a [name] bounded by min and max.
</div>
<h2>Properties</h2>
<h3>[property:Boolean isBox3]</h3>
<div>
Used to check whether this or derived classes are Box3s. Default is *true*.<br /><br />
You should not change this, as it used internally for optimisation.
</div>
<h3>[property:Vector3 min]</h3>
<div>
Lower (x, y, z) boundary of this box.
[page:Vector3] representing the lower (x, y, z) boundary of the box.<br />
Default is ( + Infinity, + Infinity, + Infinity ).
</div>
<h3>[property:Vector3 max]</h3>
<div>
Upper (x, y, z) boundary of this box.
[page:Vector3] representing the lower upper (x, y, z) boundary of the box.<br />
Default is ( - Infinity, - Infinity, - Infinity ).
</div>
<h2>Methods</h2>
<h2>Methods</h2>
<h3>[method:Box3 set]( [page:Vector3 min], [page:Vector3 max] ) [page:Box3 this]</h3>
<h3>[method:Box3 applyMatrix4]( [page:Matrix4 matrix] )</h3>
<div>
min -- Lower (x, y, z) boundary of the box. <br>
max -- Upper (x, y, z) boundary of the box.
</div>
<div>
Sets the lower and upper (x, y, z) boundaries of this box.
</div>
[page:Matrix4 matrix] - The [page:Matrix4] to apply<br /><br />
<h3>[method:Box3 applyMatrix4]( [page:Matrix4 matrix] ) [page:Box3 this]</h3>
<div>
matrix -- The [page:Matrix4] to apply
</div>
<div>
Transforms this Box3 with the supplied matrix.
</div>
<h3>[method:Vector3 clampPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
<h3>[method:Vector3 clampPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )</h3>
<div>
point -- Position to clamp. <br>
optionalTarget -- If specified, the clamped result will be copied here.
</div>
<div>
Clamps *point* within the bounds of this box.
</div>
[page:Vector3 point] - [page:Vector3] to clamp. <br>
[page:Vector3 optionalTarget] — (optional) if specified, the result will be copied into this Vector3,
otherwise a new Vector3 will be created. <br /><br />
<h3>[method:Boolean intersectsBox]( [page:Box3 box] ) [page:Box3 this]</h3>
<div>
box -- Box to check for intersection against.
</div>
<div>
Determines whether or not this box intersects *box*.
[link:https://en.wikipedia.org/wiki/Clamping_(graphics) Clamps] the [page:Vector3 point] within the bounds of this box.<br />
</div>
<h3>[method:Boolean intersectsSphere]( [page:Sphere sphere] ) [page:Box3 this]</h3>
<div>
sphere -- Sphere to check for intersection against.
</div>
<div>
Determines whether or not this box intersects *sphere*.
</div>
<h3>[method:Box3 clone]()</h3>
<div>Returns a new [page:Box3] with the same [page:.min min] and [page:.max max] as this one.</div>
<h3>[method:Boolean intersectsPlane]( [page:Plane plane] ) [page:Box3 this]</h3>
<div>
plane -- Plane to check for intersection against.
</div>
<h3>[method:Boolean containsBox]( [page:Box3 box] )</h3>
<div>
Determines whether or not this box intersects *plane*.
</div>
[page:Box3 box] - [page:Box3 Box3] to test for inclusion.<br /><br />
<h3>[method:Box3 setFromArray]( [page:Array array] ) [page:Box3 this]</h3>
<div>
array -- An array of position data that the resulting box will envelop.
</div>
<div>
Sets the upper and lower bounds of this box to include all of the data in *array*.
Returns true if this box includes the entirety of [page:Box3 box]. If this and [page:Box3 box] are identical, <br>
this function also returns true.
</div>
<h3>[method:Box3 setFromBufferAttribute]( [page:BufferAttribute attribute] ) [page:Box3 this]</h3>
<div>
buffer -- A buffer attribute of position data that the resulting box will envelop.
</div>
<h3>[method:Boolean containsPoint]( [page:Vector3 point] )</h3>
<div>
Sets the upper and lower bounds of this box to include all of the data in *attribute*.
</div>
[page:Vector3 point] - [page:Vector3] to check for inclusion.<br /><br />
<h3>[method:Box3 setFromPoints]( [page:Array points] ) [page:Box3 this]</h3>
<div>
points -- Set of points that the resulting box will envelop.
</div>
<div>
Sets the upper and lower bounds of this box to include all of the points in *points*.
Returns true if the specified [page:Vector3 point] lies within or on the boundaries of this box.
</div>
<h3>[method:Box3 setFromCenterAndSize]( [page:Vector3 center], [page:Vector3 size] ) [page:Box3 this]</h3>
<div>
center -- Desired center position of the box. <br>
size -- Desired x, y and z dimensions of the box.
</div>
<h3>[method:Box3 copy]( [page:Box3 box] )</h3>
<div>
Centers this box on *center* and sets this box's width, height and depth to the values specified <br>
in *size*.
</div>
[page:Box3 box] - [page:Box3] to copy.<br /><br />
<h3>[method:Box3 setFromObject]( [page:Object3D object] ) [page:Box3 this]</h3>
<div>
object -- [page:Object3D] to compute the bounding box for.
Copies the [page:.min min] and [page:.max max] from [page:Box3 box] to this box.
</div>
<h3>[method:Float distanceToPoint]( [page:Vector3 point] )</h3>
<div>
Computes the world-axis-aligned bounding box of an object (including its children), <br>
accounting for both the object's, and childrens', world transforms
</div>
[page:Vector3 point] - [page:Vector3] to measure distance to.<br /><br />
Returns the distance from any edge of this box to the specified point.
If the [page:Vector3 point] lies inside of this box, the distance will be 0.
</div>
<h3>[method:Vector3 getSize]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
<div>
optionalTarget -- If specified, the result will be copied here.
</div>
<h3>[method:Boolean equals]( [page:Box3 box] )</h3>
<div>
Returns the width, height, and depth of this box.
</div>
[page:Box3 box] - Box to compare with this one.<br /><br />
<h3>[method:Box3 union]( [page:Box3 box] ) [page:Box3 this]</h3>
<div>
box -- Box that will be unioned with this box.
Returns true if this box and [page:Box3 box] share the same lower and upper bounds.
</div>
<h3>[method:Box3 expandByPoint]( [page:Vector3 point] )</h3>
<div>
Unions this box with *box* setting the upper bound of this box to the greater of the <br>
two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes' <br>
lower bounds.
[page:Vector3 point] - [page:Vector3] that should be included in the box.<br /><br />
Expands the boundaries of this box to include [page:Vector3 point].
</div>
<h3>[method:Vector3 getParameter]( [page:Vector3 point], [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
<h3>[method:Box3 expandByScalar]( [page:float scalar] )</h3>
<div>
point -- Point to parametrize.
optionalTarget -- If specified, the result will be copied here.
[page:float scalar] - Distance to expand the box by.<br /><br />
Expands each dimension of the box by [page:float scalar]. If negative, the dimensions of the box
will be contracted.
</div>
<h3>[method:Box3 expandByVector]( [page:Vector3 vector] )</h3>
<div>
Returns point as a proportion of this box's width and height.
[page:Vector3 vector] - [page:Vector3] to expand the box by.<br /><br />
Expands this box equilaterally by [page:Vector3 vector]. The width of this box will be
expanded by the x component of [page:Vector3 vector] in both directions. The height of
this box will be expanded by the y component of [page:Vector3 vector] in both directions.
The depth of this box will be expanded by the z component of *vector* in both directions.
</div>
<h3>[method:Box3 intersect]( [page:Box3 box] ) [page:Box3 this]</h3>
<h3>[method:Sphere getBoundingSphere]( [page:Sphere optionalTarget] )</h3>
<div>
box -- Box to intersect with.
[page:Sphere optionalTarget] — (optional) if specified, the result will be copied into this Sphere,
otherwise a new Sphere will be created. <br /><br />
Gets a [page:Sphere] that bounds the box.
</div>
<h3>[method:Vector3 getCenter]( [page:Vector3 optionalTarget] )</h3>
<div>
Returns the intersection of this and *box*, setting the upper bound of this box to the lesser <br>
of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes' <br>
lower bounds.
[page:Vector3 optionalTarget] — (optional) if specified, the result will be copied into this Vector3,
otherwise a new Vector3 will be created. <br /><br />
Returns the center point of the box as a [page:Vector3].
</div>
<h3>[method:Boolean containsBox]( [page:Box3 box] ) [page:Box3 this]</h3>
<h3>[method:Vector3 getParameter]( [page:Vector3 point], [page:Vector3 optionalTarget] ) </h3>
<div>
box -- Box to test for inclusion.
[page:Vector3 point] - [page:Vector3].<br/>
[page:Vector3 optionalTarget] — (optional) if specified, the result will be copied into this Vector3,
otherwise a new Vector3 will be created. <br /><br />
Returns a point as a proportion of this box's width and height.
</div>
<h3>[method:Vector3 getSize]( [page:Vector3 optionalTarget] )</h3>
<div>
Returns true if this box includes the entirety of *box*. If this and *box* overlap exactly,<br>
this function also returns true.
[page:Vector3 optionalTarget] — (optional) if specified, the result will be copied into this Vector3,
otherwise a new Vector3 will be created. <br /><br />
Returns the width and height of this box.
</div>
<h3>[method:Boolean containsPoint]( [page:Vector3 point] ) [page:Box3 this]</h3>
<h3>[method:Box3 intersect]( [page:Box3 box] )</h3>
<div>
point -- [page:Vector3] to check for inclusion.
[page:Box3 box] - Box to intersect with.<br /><br />
Returns the intersection of this and [page:Box3 box], setting the upper bound of this box to the lesser
of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes'
lower bounds.
</div>
<h3>[method:Boolean intersectsBox]( [page:Box3 box] )</h3>
<div>
Returns true if the specified point lies within the boundaries of this box.
[page:Box3 box] - Box to check for intersection against.<br /><br />
Determines whether or not this box intersects [page:Box3 box].
</div>
<h3>[method:Box3 translate]( [page:Vector3 offset] ) [page:Box3 this]</h3>
<h3>[method:Boolean intersectsPlane]( [page:Plane plane] )</h3>
<div>
offset -- Direction and distance of offset.
[page:Plane plane] - [page:Plane] to check for intersection against.<br /><br />
Determines whether or not this box intersects [page:Plane plane].
</div>
<h3>[method:Boolean intersectsSphere]( [page:Sphere sphere] )</h3>
<div>
Adds *offset* to both the upper and lower bounds of this box, effectively moving this box <br>
*offset* units in 3D space.
[page:Sphere sphere] - [page:Sphere] to check for intersection against.<br /><br />
Determines whether or not this box intersects [page:Sphere sphere].
</div>
<h3>[method:Boolean isEmpty]() [page:Box3 this]</h3>
<h3>[method:Boolean isEmpty]()</h3>
<div>
Returns true if this box includes zero points within its bounds.<br>
Note that a box with equal lower and upper bounds still includes one point, the <br>
one both bounds share.
Note that a box with equal lower and upper bounds still includes one point,
the one both bounds share.
</div>
<h3>[method:Box3 clone]() [page:Box3 this]</h3>
<div>
Returns a copy of this box.
</div>
<h3>[method:Box3 makeEmpty]()</h3>
<div>Makes this box empty.</div>
<h3>[method:Boolean equals]( [page:Box3 box] ) [page:Box3 this]</h3>
<div>
box -- Box to compare.
</div>
<h3>[method:Box3 set]( [page:Vector3 min], [page:Vector3 max] )</h3>
<div>
Returns true if this box and *box* share the same lower and upper bounds.
</div>
[page:Vector3 min] - [page:Vector3] representing the lower (x, y, z) boundary of the box.<br />
[page:Vector3 max] - [page:Vector3] representing the lower upper (x, y, z) boundary of the box.<br /><br />
<h3>[method:Box3 expandByPoint]( [page:Vector3 point] ) [page:Box3 this]</h3>
<div>
point -- Point that should be included in the box.
</div>
<div>
Expands the boundaries of this box to include *point*.
Sets the lower and upper (x, y, z) boundaries of this box.
</div>
<h3>[method:Box3 expandByScalar]( [page:float scalar] ) [page:Box3 this]</h3>
<div>
scalar -- Distance to expand.
</div>
<h3>[method:Box3 setFromArray]( [page:Array array] ) [page:Box3 this]</h3>
<div>
Expands each dimension of the box by *scalar*. If negative, the dimensions of the box <br/>
will be contracted.
</div>
array -- An array of position data that the resulting box will envelop.<br /><br />
<h3>[method:Box3 expandByVector]( [page:Vector3 vector] ) [page:Box3 this]</h3>
<div>
vector -- Amount to expand this box in each dimension.
</div>
<div>
Expands this box equilaterally by *vector*. The width of this box will be <br>
expanded by the x component of *vector* in both directions. The height of <br>
this box will be expanded by the y component of *vector* in both directions. <br>
The depth of this box will be expanded by the z component of *vector* in <br>
both directions.
Sets the upper and lower bounds of this box to include all of the data in *array*.
</div>
<h3>[method:Box3 copy]( [page:Box3 box] ) [page:Box3 this]</h3>
<div>
box -- Box to copy.
</div>
<h3>[method:Box3 setFromBufferAttribute]( [page:BufferAttribute attribute] ) [page:Box3 this]</h3>
<div>
Copies the values of *box* to this box.
</div>
[page:BufferAttribute attribute] - A buffer attribute of position data that the resulting box will envelop.<br /><br />
<h3>[method:Box3 makeEmpty]() [page:Box3 this]</h3>
<div>
Makes this box empty.
Sets the upper and lower bounds of this box to include all of the data in [page:BufferAttribute attribute].
</div>
<h3>[method:Vector3 getCenter]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
<h3>[method:Box3 setFromCenterAndSize]( [page:Vector3 center], [page:Vector3 size] )</h3>
<div>
optionalTarget -- If specified, the result will be copied here.
[page:Vector3 center] - Desired center position of the box ([page:Vector3]). <br>
[page:Vector3 size] - Desired x and y dimensions of the box ([page:Vector3]).<br /><br />
Centers this box on [page:Vector3 center] and sets this box's width and height to the values specified
in [page:Vector3 size].
</div>
<h3>[method:Box3 setFromCenterAndSize]( [page:Vector3 center], [page:Vector3 size] ) [page:Box3 this]</h3>
<div>
Returns the center point of this box.
[page:Vector3 center], - Desired center position of the box. <br>
[page:Vector3 size] - Desired x, y and z dimensions of the box.<br /><br />
Centers this box on [page:Vector3 center] and sets this box's width, height and depth to the values specified <br>
in [page:Vector3 size]
</div>
<h3>[method:Sphere getBoundingSphere]( [page:Sphere optionalTarget] ) [page:Box3 this]</h3>
<h3>[method:Box3 setFromObject]( [page:Object3D object] )</h3>
<div>
optionalTarget -- [page:Sphere] to optionally set the result to.
[page:Object3D object] - [page:Object3D] to compute the bounding box of.<br /><br />
Computes the world-axis-aligned bounding box of an [page:Object3D] (including its children),
accounting for the world transforms of both the object and its childrens.
</div>
<h3>[method:Box3 setFromPoints]( [page:Array points] )</h3>
<div>
Gets a sphere that bounds the box.
[page:Array points] - Array of [page:Vector3 Vector3s] that the resulting box will contain.<br /><br />
Sets the upper and lower bounds of this box to include all of the points in [page:Array points].
</div>
<h3>[method:Float distanceToPoint]( [page:Vector3 point] ) [page:Box3 this]</h3>
<h3>[method:Box3 translate]( [page:Vector3 offset] )</h3>
<div>
point -- Point to measure distance to.
[page:Vector3 offset] - Direction and distance of offset.<br /><br />
Adds [page:Vector3 offset] to both the upper and lower bounds of this box, effectively moving this box
[page:Vector3 offset] units in 2D space.
</div>
<h3>[method:Box3 union]( [page:Box3 box] )</h3>
<div>
Returns the distance from any edge of this box to the specified point. <br>
If the point lies inside of this box, the distance will be 0.
[page:Box3 box] - Box that will be unioned with this box.<br /><br />
Unions this box with [page:Box3 box], setting the upper bound of this box to the greater of the
two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes'
lower bounds.
</div>
<h2>Source</h2>
......
......@@ -11,51 +11,77 @@
<h1>[name]</h1>
<div class="desc">
Represents a color.
Class representing a color.
</div>
<h2>Example</h2>
<code>var color = new THREE.Color();</code>
<code>var color = new THREE.Color( 0xff0000 );</code>
<code>var color = new THREE.Color("rgb(255, 0, 0)");</code>
<code>var color = new THREE.Color("rgb(100%, 0%, 0%)");</code>
<code>var color = new THREE.Color("hsl(0, 100%, 50%)");</code>
<code>var color = new THREE.Color( 1, 0, 0 );</code>
<h2>Examples</h2>
A Color can be initialised in any of the following ways:
<code>
//empty constructor - will default white
var color = new THREE.Color();
//Hexadecimal color (recommended)
var color = new THREE.Color( 0xff0000 );
//RGB string
var color = new THREE.Color("rgb(255, 0, 0)");
var color = new THREE.Color("rgb(100%, 0%, 0%)");
//X11 color name - all 140 color names are supported.
//Note the lack of CamelCase in the name
var color = new THREE.Color( 'skyblue' );
//HSL string
var color = new THREE.Color("hsl(0, 100%, 50%)");
//Seperate RGB values between 0 and 1
var color = new THREE.Color( 1, 0, 0 );
</code>
<h2>Constructor</h2>
<h3>[name]( r, g, b )</h3>
<h3>[name]( [page:Multi r], [page:Float g], [page:Float b] )</h3>
<div>
r - the red component of the color if arguments g and b are defined. If they are not defined, it can be a hexadecimal or a CSS-style string or a Color instance.<br />
g - The green component of the color if it is defined.<br />
b - The blue component of the color if it is defined.
</div>
<div>
All arguments are optional. The default color is White.<br />
[page:Multi r] - (optional) the red component of the color if arguments g and b are defined.
If they are not defined, it can be a [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] (recommended) or a CSS-style string or another Color instance.<br />
[page:Float g] - (optional) The green component of the color if it is defined.<br />
[page:Float b] - (optional) The blue component of the color if it is defined.<br /><br />
Note that standard method of specifying color in Three is with a [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet], and that method is used
throughout the rest of the documentation.<br /><br />
When all arguments are defined then r is the red component, g is the green component and b is the blue component of the color.<br />
When only r is defined:<br />
<ul>
<li>It can be a hexadecimal of the color.</li>
<li>It can be an another color instance.</li>
<li>It can be a CSS style. For Instance:
<li>It can be a [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] representing the color (recommended).</li>
<li>It can be an another Color instance.</li>
<li>It can be a CSS style string. For Instance:
<ul>
<li>rgb(250, 0,0)</li>
<li>rgb(100%,0%,0%)</li>
<li>hsl(0, 100%, 50%)</li>
<li>#ff0000</li>
<li>#f00</li>
<li>red</li>
<li>'rgb(250, 0,0)'</li>
<li>'rgb(100%,0%,0%)'</li>
<li>'hsl(0, 100%, 50%)'</li>
<li>'#ff0000'</li>
<li>'#f00'</li>
<li>'red'</li>
</ul>
</li>
</ul>
</div>
<h2>Properties</h2>
<h3>[property:Boolean isColor]</h3>
<div>
Used to check whether this or derived classes are Colors. Default is *true*.<br /><br />
You should not change this, as it used internally for optimisation.
</div>
<h3>[property:Float r]</h3>
<div>
Red channel value between 0 and 1. Default is 1.
......@@ -71,183 +97,182 @@
Blue channel value between 0 and 1. Default is 1.
</div>
<h2>Methods</h2>
<h3>[method:Color set]( value ) [page:Color this]</h3>
<div>
value -- either an instance of [page:Color], a [page:Integer hexadecimal] value, or a css style [page:String string]
</div>
<div>
Delegates to .copy, .setStyle, or .setHex depending on input type.
</div>
<h3>[method:Color add]( [page:Color color] ) </h3>
<div>Adds the RGB values of [page:Color color] to the RGB values of this color.</div>
<h3>[method:Color copy]( [page:Color color] ) [page:Color this]</h3>
<div>
color — Color to copy.
</div>
<div>
Copies given color.
</div>
<h3>[method:Color addColors]( [page:Color color1], [page:Color color2] ) </h3>
<div>Sets this color's RGB values to the sum of the RGB values of [page:Color color1] and [page:Color color2].</div>
<h3>[method:Color fromArray]( [page:Array array], [page:Integer offset] ) [page:Color this]</h3>
<div>
array -- [page:Array] [r, g, b] <br />
offset -- [page:Integer] An optional offset into the array.
</div>
<div>
Sets this color's components based on an array formatted like [r, g, b]
</div>
<h3>[method:Color addScalar]( [page:Number s] ) </h3>
<div>Adds [page:Number s] to the RGB values of this color.</div>
<h3>[method:Color copyGammaToLinear]( [page:Color color] ) [page:Color this]</h3>
<div>
color — Color to copy.
</div>
<div>
Copies given color making conversion from gamma to linear space.
</div>
<h3>[method:Color clone]() </h3>
<div>Returns a new Color with the same [page:.r r], [page:.g g] and [page:.b b] parameters a this one.</div>
<h3>[method:Color copyLinearToGamma]( [page:Color color] ) [page:Color this]</h3>
<h3>[method:Color copy]( [page:Color color] ) </h3>
<div>
color — Color to copy.
</div>
<div>
Copies given color making conversion from linear to gamma space.
Copies the [page:.r r], [page:.g g] and [page:.b b] parameters from [page:Color color] in to this color.
</div>
<h3>[method:Color convertGammaToLinear]() [page:Color this]</h3>
<div>
Converts this color from gamma to linear space.
</div>
<h3>[method:Color convertGammaToLinear]() </h3>
<div>Converts this color from gamma to linear space (squares the values of [page:.r r], [page:.g g] and [page:.b b] ).</div>
<h3>[method:Color convertLinearToGamma]() </h3>
<div>Converts this color from linear to gamma space (takes the squareroot of [page:.r r], [page:.g g] and [page:.b b]).</div>
<h3>[method:Color convertLinearToGamma]() [page:Color this]</h3>
<h3>[method:Color copyGammaToLinear]( [page:Color color], [page:Float gammaFactor] ) </h3>
<div>
Converts this color from linear to gamma space.
[page:Color color] — Color to copy.<br />
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
Copies given color making conversion from gamma to linear space,
by taking [page:.r r], [page:.g g] and [page:.b b] to the power of [page:Float gammaFactor].
</div>
<h3>[method:Color setRGB]( [page:Float r], [page:Float g], [page:Float b] ) [page:Color this]</h3>
<h3>[method:Color copyLinearToGamma]( [page:Color color], [page:Float gammaFactor] ) </h3>
<div>
r — Red channel value between 0 and 1.<br />
g — Green channel value between 0 and 1.<br />
b — Blue channel value between 0 and 1.
[page:Color color] — Color to copy.<br />
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
Copies given color making conversion from linear to gamma space,
by taking [page:.r r], [page:.g g] and [page:.b b] to the power of 1 / [page:Float gammaFactor].
</div>
<h3>[method:Boolean equals]( [page:Color color] ) </h3>
<div>Compares [page:Color color] with this one and returns true if they are the same, false otherwise.</div>
<h3>[method:Color fromArray]( [page:Array array], [page:Integer offset] ) </h3>
<div>
Sets this color from RGB values.
[page:Array array] - [page:Array] of float in the form [ [page:Float r], [page:Float g], [page:Float b] ].<br />
[page:Integer offset] - An optional offset into the array.<br /><br />
Sets this color's components based on an array formatted like [ [page:Float r], [page:Float g], [page:Float b] ].
</div>
<h3>[method:Integer getHex]()</h3>
<div>
Returns the hexadecimal value of this color.
</div>
<div>Returns the hexadecimal value of this color.</div>
<h3>[method:String getHexString]()</h3>
<div>
Returns the string formated hexadecimal value of this color.
</div>
<div>Returns the string formatted hexadecimal value of this color.</div>
<h3>[method:Color setHex]( [page:Integer hex] ) [page:Color this]</h3>
<div>
hex — Color in hexadecimal.<br />
</div>
<h3>[method:Object getHSL]( [page:Object optionalTarget] )</h3>
<div>
Sets this color from a hexadecimal value.
</div>
[page:Object optionalTarget] — (optional) if specified, adds h, s and l keys to object (if not already present)
and sets the results there, otherwise a new Object will be created. <br /><br />
Convert the values [page:.r r], [page:.g g] and [page:.b b] to [link:https://en.wikipedia.org/wiki/HSL_and_HSV HSL]
format and returns an object of the form:
<code>
{ h: 0, s: 0, l: 0 }
</code>
<h3>[method:Color setStyle]( [page:String style] ) [page:Color this]</h3>
<div>
style — color as a CSS-style string.
</div>
<div>
Sets this color from a CSS-style string. For example, "rgb(250, 0,0)", "rgb(100%, 0%, 0%)", "hsl(0, 100%, 50%)", "#ff0000", "#f00", or "red". Transluent colors such as "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" are also accepted, but the alpha-channel coordinate will be discarded.
</div>
<h3>[method:String getStyle]()</h3>
<div>
Returns the value of this color as a CSS-style string. Example: rgb(255,0,0)
</div>
<div>Returns the value of this color as a CSS-style string. Example: 'rgb(255,0,0)'.</div>
<h3>[method:Color setScalar]( [page:Float scalar] ) [page:Color this]</h3>
<div>
scalar — a value between 0.0 and 1.0.
</div>
<h3>[method:Color lerp]( [page:Color color], [page:Float alpha] ) </h3>
<div>
Sets all three color components to the value *scalar*.
</div>
[page:Color color] - color to converge on.<br />
[page:Float alpha] - interpolation factor in the closed interval [0, 1].<br /><br />
<h3>[method:Color setHSL]( [page:Float h], [page:Float s], [page:Float l] ) [page:Color this]</h3>
<div>
h — hue value between 0.0 and 1.0 <br />
s — saturation value between 0.0 and 1.0 <br />
l — lightness value between 0.0 and 1.0
</div>
<div>
Sets color from hsl
Linear interpolation of this colors RGB values and the RGB values of the passed argument.
The alpha argument can be thought of as the percent between the two colors, where 0 is
this color and 1 is the first argument.
</div>
<h3>[method:Object getHSL]() [page:Object hsl]</h3>
<div>
Returns an object with properties h, s, and l.
</div>
<h3>[method:Color multiply]( [page:Color color] ) </h3>
<div>Multiplies this color's RGB values by given [page:Color color]'s RGB values.</div>
<h3>[method:Color offsetHSL]( [page:Float h], [page:Float s], [page:Float l] ) [page:Color this]</h3>
<div>
Adds given h, s, and l to this color's existing h, s, and l values.
</div>
<h3>[method:Color multiplyScalar]( [page:Number s] ) </h3>
<div>Multiplies this color's RGB values by [page:Number s].</div>
<h3>[method:Color sub]( [page:Color color] ) [page:Color this]</h3>
<h3>[method:Color offsetHSL]( [page:Float h], [page:Float s], [page:Float l] ) </h3>
<div>
Subtracts rgb components of given color from rgb components of this color. If a component is negative, it is set to zero.
Adds given [page:Float h], [page:Float s], and [page:Float l] to this color's existing values.
Internally this converts the [page:.r r], [page:.g g] and [page:.b b] values to HSL, adds
[page:Float h], [page:Float s], and [page:Float l] and then converts back to RGB.
</div>
<h3>[method:Color add]( [page:Color color] ) [page:Color this]</h3>
<h3>[method:Color set]( [page:Multi value] ) </h3>
<div>
Adds rgb values of given color to rgb values of this color
</div>
[page:Multi value] - Value to set this color to.<br /><br />
<h3>[method:Color addColors]( [page:Color color1], [page:Color color2] ) [page:Color this]</h3>
<div>
Sets this color to the sum of color1 and color2
See the Constructor above for full details of what [page:Multi value] can be.
Delegates to [page:.copy], .setStyle, or .setHex depending on input type.
</div>
<h3>[method:Color addScalar]( [page:Number s] ) [page:Color this]</h3>
<h3>[method:Color setHex]( [page:Integer hex] ) </h3>
<div>
Adds s to the rgb values of this color
</div>
[page:Integer hex] — [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] format.<br /><br />
<h3>[method:Color multiply]( [page:Color color] ) [page:Color this]</h3>
<div>
Multiplies this color's rgb values by given color's rgb values
Sets this color from a hexadecimal value.
</div>
<h3>[method:Color multiplyScalar]( [page:Number s] ) [page:Color this]</h3>
<h3>[method:Color setHSL]( [page:Float h], [page:Float s], [page:Float l] ) </h3>
<div>
Multiplies this color's rgb values by s
</div>
[page:Float h] — hue value between 0.0 and 1.0 <br />
[page:Float s] — saturation value between 0.0 and 1.0 <br />
[page:Float l] — lightness value between 0.0 and 1.0<br /><br />
<h3>[method:Color lerp]( [page:Color color], alpha ) [page:Color this]</h3>
<div>
alpha -- a number between 0 and 1.
Sets color from HSL values.
</div>
<h3>[method:Color setRGB]( [page:Float r], [page:Float g], [page:Float b] ) </h3>
<div>
Linear interpolation of this colors rgb values and the rgb values of the first argument. The alpha argument can be thought of as the percent between the two colors, where 0 is this color and 1 is the first argument.
[page:Float r] — Red channel value between 0 and 1.<br />
[page:Float g] — Green channel value between 0 and 1.<br />
[page:Float b] — Blue channel value between 0 and 1.<br /><br />
Sets this color from RGB values.
</div>
<h3>[method:Boolean equals]( [page:Color c] ) [page:Color this]</h3>
<h3>[method:Color setScalar]( [page:Float scalar] ) </h3>
<div>
Compares this color and c and returns true if they are the same, false otherwise.
[page:Float scalar] — a value between 0.0 and 1.0.<br /><br />
Sets all three color components to the value [page:Float scalar].
</div>
<h3>[method:Color clone]() [page:Color this]</h3>
<h3>[method:Color setStyle]( [page:String style] ) </h3>
<div>
Clones this color.
[page:String style] — color as a CSS-style string.<br /><br />
Sets this color from a CSS-style string. For example,
"rgb(250, 0,0)",
"rgb(100%, 0%, 0%)",
"hsl(0, 100%, 50%)",
"#ff0000",
"#f00", or
"red" ( or any [link:https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart X11 color name]
- all 140 color names are supported ).<br />
Transluent colors such as "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" are also accepted,
but the alpha-channel coordinate will be discarded.<br /><br />
Note that for X11 color names, multiple words such as Dark Orange become the string 'darkorange' (all lowercase).
</div>
<h3>[method:Array toArray]( [page:Array array], [page:Integer offset] ) [page:Color this]</h3>
<h3>[method:Color sub]( [page:Color color] ) </h3>
<div>
array -- An optional array to store the color to. <br />
offset -- An optional offset into the array.
Subtracts RGB components of the given color from the RGB components of this color.
If a component is negative, it is set to zero.
</div>
<h3>[method:Array toArray]( [page:Array array], [page:Integer offset] ) </h3>
<div>
Returns an array [r,g,b]
[page:Array array] - An optional array to store the color to. <br />
[page:Integer offset] - An optional offset into the array.<br /><br />
Returns an array of the form [ r, g, b ].
</div>
<h2>Source</h2>
......
......@@ -10,17 +10,20 @@
<body>
<h1>[name]</h1>
<div class="desc">A point's cylindrical coordinates.</div>
<div class="desc">
A point's [link:https://en.wikipedia.org/wiki/Cylindrical_coordinate_system cylindrical coordinates].
</div>
<h2>Constructor</h2>
<h3>[name]( [page:Float radius], [page:Float theta], [page:Float y] )</h3>
<div>
radius -- [page:Float] distance from the origin to a point in the x-z plane<br />
theta -- [page:Float] counterclockwise angle in the x-z plane measured in radians from the positive z-axis<br />
y -- [page:Float] height above the x-z plane
[page:Float radius] - distance from the origin to a point in the x-z plane.
Default is *1.0*.<br />
[page:Float theta] - counterclockwise angle in the x-z plane measured in radians
from the positive z-axis. Default is *0*.<br />
[page:Float y] - height above the x-z plane. Default is *0*.
</div>
......@@ -35,24 +38,30 @@
<h2>Methods</h2>
<h3>[method:Cylindrical set]( [page:Float radius], [page:Float theta], [page:Float y] ) [page:Cylindrical this]</h3>
<h3>[method:Cylindrical clone]()</h3>
<div>
Sets values of this cylindrical's component coordinates.
Returns a new cylindrical with the same [page:.radius radius], [page:.theta theta]
and [page:.y y] properties as this one.
</div>
<h3>[method:Cylindrical copy]( [page:Cylindrical c] ) [page:Cylindrical this]</h3>
<h3>[method:Cylindrical copy]( [page:Cylindrical other] )</h3>
<div>
Copies value of *c* to this cylindrical.
Copies the values of the passed Cylindrical's [page:.radius radius], [page:.theta theta]
and [page:.y y] properties to this cylindrical.
</div>
<h3>[method:Cylindrical clone]() [page:Cylindrical this]</h3>
<div>
Clones this cylindrical.
</div>
<h3>[method:Cylindrical set]( [page:Float radius], [page:Float phi], [page:Float theta] )</h3>
<div>Sets values of this cylindrical's [page:.radius radius], [page:.theta theta]
and [page:.y y] properties.</div>
<h3>[method:Cylindrical setFromVector3]( [page:Vector3 v] ) [page:Cylindrical this]</h3>
<h3>[method:Cylindrical setFromVector3]( [page:Vector3 vec3] )</h3>
<div>
Sets this object from the vector *v*.
Sets values of this cylindrical's [page:.radius radius], [page:.theta theta]
and [page:.y y] properties from the [page:Vector3 Vector3].<br /><br />
The [page:.radius radius] is set the vector's distance from the origin as measured along
the the x-z plane, while [page:.theta theta] is set from its direction on
the the x-z plane and [page:.y y] is set from the vector's y component.
</div>
<h2>Source</h2>
......
......@@ -10,10 +10,11 @@
<body>
<h1>[name]</h1>
<div class="desc">Euler Angles. <br/><br/>
<div class="desc">A class representing [link:http://en.wikipedia.org/wiki/Euler_angles Euler Angles].<br /><br />
Euler angles describe a rotation transformation by rotating an object on its various axes in specified amounts per axis, and a specified axis order.
(More information on <a href='http://en.wikipedia.org/wiki/Euler_angles' target='blank'>Wikipedia</a>)</div>
Euler angles describe a rotational transformation by rotating an object on its various
axes in specified amounts per axis, and a specified axis order.
</div>
<h2>Example</h2>
......@@ -28,114 +29,149 @@
<h3>[name]( [page:Float x], [page:Float y], [page:Float z], [page:String order] )</h3>
<div>
x -- [page:Float] the angle of the x axis in radians<br />
y -- [page:Float] the angle of the y axis in radians<br />
z -- [page:Float] the angle of the z axis in radians<br />
order -- [page:String] A string representing the order that the rotations are applied, defaults to 'XYZ' (must be upper case).
</div>
<div>
A euler angle for transforming
[page:Float x] - (optional) the angle of the x axis in radians. Default is *0*.<br />
[page:Float y] - (optional) the angle of the y axis in radians. Default is *0*.<br />
[page:Float z] - (optional) the angle of the z axis in radians. Default is *0*.<br />
[page:String order] - (optional) a string representing the order that the rotations are applied,
defaults to 'XYZ' (must be upper case).<br /><br />
</div>
<h2>Properties</h2>
<h3>[property:Float x]</h3>
<h3>[property:Float y]</h3>
<h3>[property:Boolean isEuler]</h3>
<div>
Used to check whether this or derived classes are Eulers. Default is *true*.<br /><br />
<h3>[property:Float z]</h3>
You should not change this, as it used internally for optimisation.
</div>
<h3>[property:String order]</h3>
<h2>Methods</h2>
<h3>[method:Euler set]( [page:Float x], [page:Float y], [page:Float z], [page:String order] ) [page:Euler this]</h3>
<div>
x -- [page:Float] Angle in x axis in radians<br />
y -- [page:Float] Angle in y axis in radians<br />
z -- [page:Float] Angle in z axis in radians<br />
order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
</div>
<div>
Sets the angles of this euler transform.
</div>
The order in which to apply rotations. Default is 'XYZ', which means that the object will first be
rotated around its X axis, then its Y axis and finally its Z axis. Other possibilities are:
'YZX', 'ZXY', 'XZY', 'YXZ' and 'ZYX'. Note that these must be in upper case.<br /><br />
<h3>[method:Euler copy]( [page:Euler euler] ) [page:Euler this]</h3>
<div>
Copies value of *euler* to this euler.
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
</div>
<h3>[method:Euler setFromRotationMatrix]( [page:Matrix4 m], [page:String order] ) [page:Euler this]</h3>
<div>
m -- [page:Matrix4] assumes upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled)<br />
order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
</div>
<h3>[property:Float x]</h3>
<div>
Sets the angles of this euler transform from a pure rotation matrix based on the orientation specified by order.
</div>
The current value of the x component.<br /><br />
<h3>[method:Euler setFromQuaternion]( [page:Quaternion q], [page:String order] ) [page:Euler this]</h3>
<div>
q -- [page:Quaternion] quaternion must be normalized<br />
order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
</div>
<h3>[property:Float y]</h3>
<div>
Sets the angles of this euler transform from a normalized quaternion based on the orientation specified by order.
The current value of the y component.<br /><br />
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
</div>
<h3>[method:Euler reorder]( [page:String newOrder] ) [page:Euler this]</h3>
<h3>[property:Float z]</h3>
<div>
Resets the euler angle with a new order by creating a quaternion from this euler angle and then setting this euler angle with the quaternion and the new order. <br />
WARNING: this discards revolution information.
The current value of the z component.<br /><br />
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
</div>
<h3>[method:Euler setFromVector3]( [page:Vector3 vector], [page:String order] ) [page:Euler this]</h3>
<h2>Methods</h2>
<h3>[method:Euler copy]( [page:Euler euler] )</h3>
<div>Copies value of [page:Euler euler] to this euler.</div>
<h3>[method:Euler clone]()</h3>
<div>Returns a new Euler with the same parameters as this one.</div>
<h3>[method:Boolean equals]( [page:Euler euler] )</h3>
<div>Checks for strict equality of this euler and [page:Euler euler].</div>
<h3>[method:Euler fromArray]( [page:Array array] )</h3>
<div>
vector -- [page:Vector3].
order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
[page:Array array] of length 3 or 4. The optional 4th argument corresponds to the [page:.order order].<br /><br />
Assigns this euler's [page:.x x] angle to array[0]. <br />
Assigns this euler's [page:.y y] angle to array[1]. <br />
Assigns this euler's [page:.z z] angle to array[2]. <br />
Optionally assigns this euler's [page:.order order] to array[3].
</div>
<h3>[method:Euler onChange]( [page:Function onChangeCallback] )</h3>
<div>
Optionally Vector3 to the XYZ parameters of Euler, and order to the Euler's order property.
[page:Function onChangeCallback] - set the value of the onChangeCallback() function.
</div>
<h3>[method:Vector3 toVector3]()</h3>
<h3>[method:Euler onChangeCallback]( )</h3>
<div>
Returns the Euler's XYZ properties as a Vector3.
By default this is an empty function, however it can be set via [page:.onChange onChange]().<br />
It gets called after changing the [page:.x x], [page:.y y], [page:.z z] or [page:.order order] properties,
and also after calling most setter functions (see those for details).
</div>
<h3>[method:Euler fromArray]( [page:Array array] ) [page:Euler this]</h3>
<h3>[method:Euler reorder]( [page:String newOrder] )</h3>
<div>
array -- [page:Array] of length 3 or 4. array[3] is an optional order argument.
Resets the euler angle with a new order by creating a quaternion from this euler angle
and then setting this euler angle with the quaternion and the new order. <br /><br />
<em>WARNING</em>: this discards revolution information.
</div>
<h3>[method:Euler set]( [page:Float x], [page:Float y], [page:Float z], [page:String order] )</h3>
<div>
Assigns this euler's x angle to array[0]. <br />
Assigns this euler's y angle to array[1]. <br />
Assigns this euler's z angle to array[2]. <br />
Optionally assigns this euler's order to array[3].
[page:.x x] - the angle of the x axis in radians.<br />
[page:.y y] - the angle of the y axis in radians.<br />
[page:.z z] - the angle of the z axis in radians.<br />
[page:.order order] - (optional) a string representing the order that the rotations are applied.<br /><br />
Sets the angles of this euler transform and optionally the [page:.order order] and then call [page:.onChangeCallback onChangeCallback]().
</div>
<h3>[method:Array toArray]( [page:Array array] )</h3>
<h3>[method:Euler setFromRotationMatrix]( [page:Matrix4 m], [page:String order], [page:Boolean update] )</h3>
<div>
array -- Optional array to store the euler.
[page:Matrix4 m] - a [page:Matrix4] of which the upper 3x3 of matrix is a pure
[link:https://en.wikipedia.org/wiki/Rotation_matrix rotation matrix] (i.e. unscaled).<br />
[page:.order order] - (optional) a string representing the order that the rotations are applied.<br />
[page:Boolean update] - (optional) whether to call [page:.onChangeCallback onChangeCallback]() after applying
the matrix.<br /><br />
Sets the angles of this euler transform from a pure rotation matrix based on the orientation
specified by order.
</div>
<h3>[method:Euler setFromQuaternion]( [page:Quaternion q], [page:String order], [page:Boolean update] )</h3>
<div>
Returns an array [x, y, z, order]
[page:Quaternion q] - a normalized quaternion.<br />
[page:.order order] - (optional) a string representing the order that the rotations are applied.<br />
[page:Boolean update] - (optional) whether to call [page:.onChangeCallback onChangeCallback]() after applying
the matrix.<br /><br />
Sets the angles of this euler transform from a normalized quaternion based on the orientation
specified by [page:.order order].
</div>
<h3>[method:Boolean equals]( [page:Euler euler] )</h3>
<h3>[method:Euler setFromVector3]( [page:Vector3 vector], [page:String order] )</h3>
<div>
Checks for strict equality of this euler and *euler*.
[page:Vector3 vector] - [page:Vector3].<br />
[page:.order order] - (optional) a string representing the order that the rotations are applied.<br /><br />
Set the [page:.x x], [page:.y y] and [page:.z z], and optionally update the [page:.order order]. [page:.onChangeCallback onChangeCallback]()
is called after these changes are made.
</div>
<h3>[method:Euler clone]()</h3>
<h3>[method:Array toArray]( [page:Array array], [page:Integer offset] )</h3>
<div>
Returns a new euler created from this euler.
</div>
[page:Array array] - (optional) array to store the euler in.<br />
[page:Integer offset] (optional) offset in the array.<br />
Returns an array of the form [[page:.x x], [page:.y y], [page:.z z], [page:.order order ]].
</div>
<h3>[method:Vector3 toVector3]()</h3>
<div>Returns the Euler's [page:.x x], [page:.y y] and [page:.z z] properties as a [page:Vector3].</div>
<h2>Source</h2>
......
......@@ -10,7 +10,14 @@
<body>
<h1>[name]</h1>
<div class="desc"><a href="http://en.wikipedia.org/wiki/Frustum">Frustums</a> are used to determine what is inside the camera's field of view. They help speed up the rendering process.</div>
<div class="desc">
[link:http://en.wikipedia.org/wiki/Frustum Frustums] are used to determine what is
inside the camera's field of view. They help speed up the rendering process - object which lie
outside a camera's frustum can safely be excluded from rendering.<br /><br />
This class is mainly intended for use internally by a renderer for calculating
a [page:Camera camera] or [page:LightShadow.camera shadowCamera]'s frustum.
</div>
<h2>Constructor</h2>
......@@ -18,85 +25,95 @@
<h3>[name]([page:Plane p0], [page:Plane p1], [page:Plane p2], [page:Plane p3], [page:Plane p4], [page:Plane p5])</h3>
<div>
p0 -- [page:Plane] <br />
p1 -- [page:Plane] <br />
p2 -- [page:Plane] <br />
p3 -- [page:Plane] <br />
p4 -- [page:Plane] <br />
p5 -- [page:Plane]
</div>
<div>
Creates a frustum from the designated planes.
[page:Plane p0] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p1] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p2] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p3] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p4] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p5] - (optional) defaults to a new [page:Plane].<br /><br />
Creates a new [name].
</div>
<h2>Properties</h2>
<h3>[property:Array planes]</h3>
<div>
Array of 6 [page:Plane planes].
</div>
<div>Array of 6 [page:Plane planes].</div>
<h2>Methods</h2>
<h3>[method:Frustum setFromMatrix]( [page:Matrix4 matrix] )</h3>
<h3>[method:Frustum clone]()</h3>
<div>Return a new Frustum with the same parameters as this one.</div>
<h3>[method:Boolean intersectsObject]( [page:Object3D object] )</h3>
<div>
Checks whether the object's bounding sphere is intersecting the Frustum.
</div>
<h3>[method:Frustum clone]()</h3>
<h3>[method:Boolean containsPoint]( [page:Vector3 point] )</h3>
<div>
Return a copy of this Frustum
</div>
[page:Vector3 point] - [page:Vector3] to test.<br /><br />
<h3>[method:Frustum set]( [page:Plane p0], [page:Plane p1], [page:Plane p2], [page:Plane p3], [page:Plane p4], [page:Plane p5] )</h3>
<div>
p0 -- [page:Plane] <br />
p1 -- [page:Plane] <br />
p2 -- [page:Plane] <br />
p3 -- [page:Plane] <br />
p4 -- [page:Plane] <br />
p5 -- [page:Plane]
</div>
<div>
Sets the current frustum from the passed planes. No plane order is implicitely implied.
Checks to see if the frustum contains the [page:Vector3 point].
</div>
<h3>[method:Frustum copy]( [page:Frustum frustum] ) [page:Frustum this]</h3>
<h3>[method:Frustum copy]( [page:Frustum frustum] )</h3>
<div>
frustum -- The frustum to copy
</div>
<div>
Copies the values of the passed frustum.
[page:Frustum frustum] - The frustum to copy<br /><br />
Copies the properties of the passed [page:Frustum frustum] into this one.
</div>
<h3>[method:Boolean containsPoint]( [page:Vector3 point] )</h3>
<h3>[method:Boolean intersectsBox]( [page:Box3 box] )</h3>
<div>
point -- [page:Vector3] to test
[page:Box3 box] - [page:Box3] to check for intersection.<br /><br />
Return true if [page:Box3 box] intersects with this frustum.
</div>
<h3>[method:Boolean intersectsObject]( [page:Object3D object] )</h3>
<div>
Checks to see if the frustum contains the point.
Checks whether the [page:Object3D object]'s [page:Geometry.boundingSphere bounding sphere] is intersecting the Frustum.<br /><br />
Note that the object must have a [page:Geometry] or [page:BufferGeometry] so that the bounding sphere
can be calculated.
</div>
<h3>[method:Boolean intersectsBox]( [page:Box3 box] )</h3>
<h3>[method:Boolean intersectsSphere]( [page:Sphere sphere] )</h3>
<div>
box -- [page:Box3]
[page:Sphere sphere] - [page:Sphere] to check for intersection.<br /><br />
Return true if [page:Sphere sphere] intersects with this frustum.
</div>
<h3>[method:Boolean intersectsSprite]( [page:Sprite sprite] )</h3>
<div>
Check to see if the box intersects with the frustum.
Checks whether the [page:Sprite sprite] is intersecting the Frustum.<br /><br />
</div>
<h3>[method:Boolean intersectsSphere]( [page:Sphere sphere] )</h3>
<h3>[method:Frustum set]( [page:Plane p0], [page:Plane p1], [page:Plane p2], [page:Plane p3], [page:Plane p4], [page:Plane p5] )</h3>
<div>
sphere -- [page:Sphere]
Sets the current frustum from the passed planes. No plane order is implicitely implied.
</div>
<h3>[method:Frustum setFromMatrix]( [page:Matrix4 matrix] )</h3>
<div>
Check to see if the sphere intersects with the frustum.
[page:Matrix4 matrix] - [page:Matrix4] used to set the [page:.planes planes]<br /><br />
This is used by the [page:WebGLRenderer] to set up the Frustum from a [page:Camera Camera's]
[page:Camera.projectionMatrix projectionMatrix] and [page:Camera.matrixWorldInverse matrixWorldInverse].
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -18,116 +18,106 @@
<h3>[name]( [page:Vector3 start], [page:Vector3 end] )</h3>
<div>
start -- [page:Vector3] Start of the line segment<br />
end -- [page:Vector3] End of the line segment
</div>
<div>
The start and end vectors default to origin vectors if none are set.
[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].
</div>
<h2>Properties</h2>
<h3>[property:Vector3 start]</h3>
<div>[page:Vector3] representing the start point of the line.</div>
<h3>[property:Vector3 end]</h3>
<div>[page:Vector3] representing the end point of the line.</div>
<h2>Methods</h2>
<h3>[method:Line3 set]( [page:Vector3 start], [page:Vector3 end] )</h3>
<div>
start -- [page:Vector3] <br />
end -- [page:Vector3]
</div>
<div>
Sets the start and end values by copying the provided vectors.
</div>
<h3>[method:Line3 copy]( [page:Line3 line] )</h3>
<div>
line -- [page:Line3]
</div>
<h2>Methods</h2>
<h3>[method:Line3 applyMatrix4]( [page:Matrix4 matrix] )</h3>
<div>Apply a matrix transform to the line segment.</div>
<h3>[method:Vector3 at]( [page:Float t], [page:Vector3 optionalTarget] )</h3>
<div>
Copies the passed line's start and end vectors to this line.
[page:Float t] - Use values 0-1 to return a position along the line segment. <br />
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3],
otherwise a new [page:Vector3] will be created.<br /><br />
Return 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 />
</div>
<h3>[method:Line3 clone]()</h3>
<div>Return a new [page:Line3] with the same [page:.start start] and [page:.end end] vectors as this one.</div>
<h3>[method:Vector3 closestPointToPoint]( [page:Vector3 point], [page:Boolean clampToLine], [page:Vector3 optionalTarget] )</h3>
<div>
Return a new copy of this [page:Line3].
[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 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3],
otherwise a new [page:Vector3] will be created.<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.
</div>
<h3>[method:Boolean equals]( [page:Line3 line] )</h3>
<h3>[method:Float closestPointToPointParameter]( [page:Vector3 point], [page:Boolean clampToLine] )</h3>
<div>
line -- [page:Line3]
[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 clamp to line is true, then the returned value will be between 0 and 1.
</div>
<h3>[method:Line3 copy]( [page:Line3 line] )</h3>
<div>Copies the passed line's [page:.start start] and [page:.end end] vectors to this line.</div>
<h3>[method:Vector3 delta]( [page:Vector3 optionalTarget] )</h3>
<div>
Returns true if both line's start and end points are equal.
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3],
otherwise a new [page:Vector3] will be created.<br /><br />
Returns the delta vector of the line segment ( [page:.end end] vector minus the [page:.start start] vector).
</div>
<h3>[method:Float distance]()</h3>
<div>
Returns the length of the line segment.
</div>
<div>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.</div>
<h3>[method:Float distanceSq]()</h3>
<div>
Returns the line segment's length squared.
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.
</div>
<h3>[method:Line3 applyMatrix4]( [page:Matrix4 matrix] ) [page:Line3 this]</h3>
<div>
matrix -- [page:Matrix4]
</div>
<h3>[method:Boolean equals]( [page:Line3 line] )</h3>
<div>
Apply a matrix transform to the line segment.
</div>
[page:Line3 line] - [page:Line3] to compare with this one.<br /><br />
<h3>[method:Vector3 at]( [page:Float t], [page:Vector3 optionalTarget] )</h3>
<div>
t -- [page:Float] Use values 0-1 to return a result on the line segment. <br />
optionalTarget -- [page:Vector] Optional target to set the result.
</div>
<div>
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.
Returns true if both line's [page:.start start] and [page:.end en] points are equal.
</div>
<h3>[method:Vector3 getCenter]( [page:Vector3 optionalTarget] )</h3>
<div>
optionalTarget -- [page:Vector3] Optional target to set the result.
</div>
<div>
Return the center of the line segment.
</div>
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3],
otherwise a new [page:Vector3] will be created.<br /><br />
<h3>[method:Vector3 delta]( [page:Vector3 optionalTarget] )</h3>
<div>
optionalTarget -- [page:Vector3] Optional target to set the result.
</div>
<div>
Returns the delta vector of the line segment, or the end vector minus the start vector.
Return the center of the line segment.
</div>
<h3>[method:Vector3 closestPointToPoint]( [page:Vector3 point], [page:Boolean clampToLine], [page:Vector3 optionalTarget] )</h3>
<div>
point -- [page:Vector3] <br />
clampToLine -- [page:Boolean] <br />
optionalTarget -- [page:Vector3] Optional target to set the result.
</div>
<h3>[method:Line3 set]( [page:Vector3 start], [page:Vector3 end] )</h3>
<div>
Returns the closets point on the line. If clamp to line is true, then the returned value will be clamped to the line segment.
</div>
[page:Vector3 start] - set the [page:.start start point] of the line.<br />
end - [page:Vector3] - set the [page:.end end point] of the line.<br /><br />
<h3>[method:Float closestPointToPointParameter]( [page:Vector3 point], [page:Boolean clampToLine] )</h3>
<div>
point -- [page:Vector3] <br />
clampToLine -- [page:Boolean]
</div>
<div>
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.
Sets the start and end values by copying the provided vectors.
</div>
<h2>Source</h2>
......
......@@ -10,131 +10,104 @@
<body>
<h1>[name]</h1>
<div class="desc">Math utility functions</div>
<div class="desc">An object with several math utility functions.</div>
<h2>Properties</h2>
<h2>Methods</h2>
<h2>Functions</h2>
<h3>[method:Float clamp]( [page:Float value], [page:Float min], [page:Float max] )</h3>
<div>
value — Value to be clamped.<br />
min — Minimum value<br />
max — Maximum value.
</div>
<div>
Clamps the *value* to be between *min* and *max*.
[page:Float value] — Value to be clamped.<br />
[page:Float min] — Minimum value.<br />
[page:Float max] — Maximum value.<br /><br />
Clamps the [page:Float value] to be between [page:Float min] and [page:Float max].
</div>
<h3>[method:Float degToRad]( [page:Float degrees] )</h3>
<div>
degrees -- [page:Float]
</div>
<div>
Converts degrees to radians.
</div>
<div>Converts degrees to radians.</div>
<h3>[method:Integer euclideanModulo]( [page:Integer n], [page:Integer m] )</h3>
<div>
n, m --Integers
</div>
<div>
Compute the Euclidian modulo of m % n, that is:
[page:Integer n], [page:Integer m] - Integers<br /><br />
Compute the Euclidean modulo of m % [page:Integer n], that is:
<code>( ( n % m ) + m ) % m</code>
</div>
<h3>[method:UUID generateUUID]( )</h3>
<div>
Generate a [link:https://en.wikipedia.org/wiki/Universally_unique_identifier UUID] (universally unique identifier).
Generate a [link:https://en.wikipedia.org/wiki/Universally_unique_identifier UUID]
(universally unique identifier).
</div>
<h3>[method:Boolean isPowerOfTwo]( n )</h3>
<div>
Return *true* if n is a power of 2.
</div>
<h3>[method:Boolean isPowerOfTwo]( [page:Number n] )</h3>
<div>Return *true* if [page:Number n] is a power of 2.</div>
<h3>[method:Float lerp]( [page:Float x], [page:Float y], [page:Float t] )</h3>
<div>
x -- Start point. <br />
y -- End point. <br />
t -- Closed unit interval from [0,1].
</div>
<div>
Returns a value [link:https://en.wikipedia.org/wiki/Linear_interpolation linearly interpolated] from two known points based on the given interval.
</div>
[page:Float x] - Start point. <br />
[page:Float y] - End point. <br />
[page:Float t] - interpolation factor in the closed interval [0, 1].<br><br />
<h3>[method:Float mapLinear]( [page:Float x], [page:Float a1], [page:Float a2], [page:Float b1], [page:Float b2] )</h3>
<div>
x — Value to be mapped.<br />
a1 — Minimum value for range A.<br />
a2 — Maximum value for range A.<br />
b1 — Minimum value for range B.<br />
b2 — Maximum value for range B.
</div>
<div>
Linear mapping of *x* from range [*a1*, *a2*] to range [*b1*, *b2*].
Returns a value [link:https://en.wikipedia.org/wiki/Linear_interpolation linearly interpolated]
from two known points based on the given interval - [page:Float t] = 0 will return [page:Float x]
and [page:Float t] = 1 will return [page:Float y].
</div>
<h3>[method:Integer nearestPowerOfTwo]( n )</h3>
<h3>[method:Float mapLinear](
[page:Float x],
[page:Float a1],
[page:Float a2],
[page:Float b1],
[page:Float b2] )</h3>
<div>
Return the nearest power of 2 to a given number n.
</div>
[page:Float x] — Value to be mapped.<br />
[page:Float a1] — Minimum value for range A.<br />
[page:Float a2] — Maximum value for range A.<br />
[page:Float b1] — Minimum value for range B.<br />
[page:Float b2] — Maximum value for range B.<br /><br />
<h3>[method:Integer nextPowerOfTwo]( n )</h3>
<div>
Return the nearest power of 2 that is bigger than n.
Linear mapping of [page:Float x] from range [[page:Float a1], [page:Float a2]] to range [[page:Float b1], [page:Float b2]].
</div>
<h3>[method:Integer nearestPowerOfTwo]( [page:Number n] )</h3>
<div> Return the nearest power of 2 to a given number [page:Number n].</div>
<h3>[method:Integer nextPowerOfTwo]( [page:Number n] )</h3>
<div>Return the nearest power of 2 that is bigger than [page:Number n].</div>
<h3>[method:Float radToDeg]( [page:Float radians] )</h3>
<div>
radians -- [page:Float]
</div>
<div>
Converts radians to degrees
</div>
<div>Converts radians to degrees.</div>
<h3>[method:Float randFloat]( [page:Float low], [page:Float high] )</h3>
<div>
Random float from *low* to *high* interval.
</div>
<div>Random float in the interval [page:Float low] to [page:Float high].</div>
<h3>[method:Float randFloatSpread]( [page:Float range] )</h3>
<div>
Random float from *- range / 2* to *range / 2* interval.
</div>
<div>Random float in the intercal *- [page:Float range] / 2* to *[page:Float range] / 2*.</div>
<h3>[method:Integer randInt]( [page:Integer low], [page:Integer high] )</h3>
<div>
Random integer from *low* to *high* interval.
</div>
<h3>[method:Float random16]()</h3>
<div>
Random float from 0 to 1 with 16 bits of randomness.<br />
Standard Math.random() creates repetitive patterns when applied over larger space.
</div>
<div>Random integer in the interval [page:Float low] to [page:Float high].</div>
<h3>[method:Float smoothstep]( [page:Float x], [page:Float min], [page:Float max] )</h3>
<div>
x -- The value to evaluate based on its position between min and max. <br />
min -- Any x value below min will be 0 <br />
max -- Any x value above max will be 1
</div>
<div>
[page:Float x] - The value to evaluate based on its position between min and max. <br />
[page:Float min] - Any x value below min will be 0.<br />
[page:Float max] - Any x value above max will be 1.<br /><br />
Returns a value between 0-1 that represents the percentage that x has moved between min and max,
but smoothed or slowed down the closer X is to the min and max.<br/><br/>
[link:http://en.wikipedia.org/wiki/Smoothstep Wikipedia]
See [link:http://en.wikipedia.org/wiki/Smoothstep Smoothstep] for details.
</div>
<h3>[method:Float smootherstep]( [page:Float x], [page:Float min], [page:Float max] )</h3>
<div>
x -- The value to evaluate based on its position between min and max. <br />
min -- Any x value below min will be 0 <br />
max -- Any x value above max will be 1
</div>
<div>
Returns a value between 0-1. It works the same as smoothstep, but more smooth.
[page:Float x] - The value to evaluate based on its position between min and max. <br />
[page:Float min] - Any x value below min will be 0.<br />
[page:Float max] - Any x value above max will be 1.<br /><br />
Returns a value between 0-1. A [link:https://en.wikipedia.org/wiki/Smoothstep#Variations variation on smoothstep]
that has zero 1st and 2nd order derivatives at x=0 and x=1.
</div>
<h2>Source</h2>
......
......@@ -10,15 +10,45 @@
<body>
<h1>[name]</h1>
<div class="desc">A 3x3 matrix.</div>
<div class="desc">
A class representing a 3x3 [link:https://en.wikipedia.org/wiki/Matrix_(mathematics) matrix].
</div>
<h2>Example</h2>
<code>
var m = new Matrix3();
</code>
<h2>A Note on Row-Major and Column-Major Ordering</h2>
<div>
The [page:set]() method takes arguments in [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order row-major]
order, while internally they are stored in the [page:.elements elements] array in column-major order.<br /><br />
This means that calling
<code>
m.set( 11, 12, 13,
21, 22, 23,
31, 32, 33 );
</code>
will result in the [page:.elements elements] array containing:
<code>
m.elements = [ 11, 21, 31,
12, 22, 32,
13, 23, 33 ];
</code>
and internally all calculations are performed using column-major ordering. However, as the actual ordering
makes no difference mathematically and most people are used to thinking about matrices in row-major order,
the Three.js documentation shows matrices in row-major order. Just bear in mind that if you are reading the source
code, you'll have to take the transpose of any matrices outlined here to make sense of the calculations.
</div>
<h2>Constructor</h2>
<h3>[name]()</h3>
<div>
Creates and initializes the 3x3 matrix to the identity matrix.
Creates and initializes the [name] to the 3x3
[link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix].
</div>
......@@ -27,117 +57,138 @@
<h3>[property:Float32Array elements]</h3>
<div>
A column-major list of matrix values.
A [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order column-major]
list of matrix values.
</div>
<h3>[property:Boolean isMatrix3]</h3>
<div>
Used to check whether this or derived classes are Matrix3s. Default is *true*.<br /><br />
You should not change this, as it used internally for optimisation.
</div>
<h2>Methods</h2>
<h3>[method:Matrix3 set]( [page:Float n11], [page:Float n12], [page:Float n13], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n31], [page:Float n32], [page:Float n33] ) [page:Matrix3 this]</h3>
<div>
n11 -- [page:Float] <br />
n12 -- [page:Float] <br />
n13 -- [page:Float] <br />
n21 -- [page:Float] <br />
n22 -- [page:Float] <br />
n23 -- [page:Float] <br />
n31 -- [page:Float] <br />
n32 -- [page:Float] <br />
n33 -- [page:Float]
</div>
<h3>[method:Array applyToBuffer]( [page:ArrayBuffer buffer], [page:Number offset], [page:Number length] )</h3>
<div>
Sets the 3x3 matrix values to the given row-major sequence of values.
</div>
[page:Array buffer] - An [link:https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer ArrayBuffer]
of floats in the form [vector1x, vector1y, vector1z, vector2x, vector2y, vector2z, ...], that represent 3D vectors.<br />
[page:Number offset] - (optional) index in the array of the first vector's x component. Default is 0.<br />
[page:Number length] - (optional) index in the array of the last vector's z component.
Default is the last element in the array.<br /><br />
<h3>[method:Matrix3 copy]( [page:Matrix3 m] ) [page:Matrix3 this]</h3>
<div>
m -- [page:Matrix4]
</div>
<div>
Copies the values of matrix *m* into this matrix.
Multiplies (applies) this matrix to every 3D vector in the [page:ArrayBuffer buffer].
</div>
<h3>[method:Matrix3 fromArray]( [page:Array array], [page:Integer offset] ) [page:Matrix3 this]</h3>
<h3>[method:Array applyToVector3Array]( [page:Array array], [page:Number offset], [page:Number length] )</h3>
<div>
array -- [page:Array] The array to read the elements from.<br />
offset -- [page:Integer] optional offset into the array. Default is 0.
</div>
<div>
Sets the elements of this matrix based on an array in column-major format.
</div>
[page:Array array] - An array of floats in the form [vector1x, vector1y, vector1z, vector2x, vector2y, vector2z, ...],
that represent 3D vectors.<br />
[page:Number offset] - (optional) index in the array of the first vector's x component. Default is 0.<br />
[page:Number length] - (optional) index in the array of the last vector's z component.
Default is the last element in the array.<br /><br />
<h3>[method:Matrix3 transpose]() [page:Matrix3 this]</h3>
<div>
Transposes this matrix in place.
Multiplies (applies) this matrix to every 3D vector in the [page:Array array].
</div>
<h3>[method:Matrix3 transposeIntoArray]( [page:Array array] ) [page:Matrix3 this]</h3>
<div>
array -- [page:Array] <br />
</div>
<div>
Transposes this matrix into the supplied array, and returns itself unchanged.
</div>
<h3>[method:Matrix3 clone]()</h3>
<div>Creates a new Matrix3 and with identical elements to this one.</div>
<h3>[method:Float determinant]() [page:Matrix3 this]</h3>
<div>
Computes and returns the determinant of this matrix.
</div>
<h3>[method:Matrix3 copy]( [page:Matrix3 m] )</h3>
<div>Copies the elements of matrix [page:Matrix3 m] into this matrix.</div>
<h3>[method:Matrix3 multiplyScalar]( [page:Float s] ) [page:Matrix3 this]</h3>
<div>
scalar -- [page:Float]
</div>
<h3>[method:Float determinant]()</h3>
<div>
Multiplies every component of the matrix by the scalar value *s*.
Computes and returns the
[link:https://en.wikipedia.org/wiki/Determinant determinant] of this matrix.
</div>
<h3>[method:Array applyToVector3Array]( [page:Array array] ) [page:Matrix3 this]</h3>
<div>
array -- An array in the form [vector1x, vector1y, vector1z, vector2x, vector2y, vector2z, ...]
</div>
<h3>[method:Matrix3 fromArray]( [page:Array array], [page:Integer offset] )</h3>
<div>
Multiplies (applies) this matrix to every vector3 in the array.
</div>
[page:Array array] - the array to read the elements from.<br />
[page:Integer offset] - (optional) index of first element in the array. Default is 0.<br /><br />
<h3>[method:Matrix3 getNormalMatrix]( [page:Matrix4 m] ) [page:Matrix3 this]</h3>
<div>
m -- [page:Matrix4]
</div>
<div>
Sets this matrix as the normal matrix (upper left 3x3)of the passed [page:Matrix4 matrix4]. The normal matrix is the inverse transpose of the matrix *m*.
Sets the elements of this matrix based on an array in
[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] format.
</div>
<h3>[method:Matrix3 getInverse]( [page:Matrix4 m], [page:Boolean throwOnDegenerate] ) [page:Matrix3 this]</h3>
<h3>[method:Matrix3 getInverse]( [page:Matrix3 m], [page:Boolean throwOnDegenerate] )</h3>
<div>
m -- [page:Matrix4]<br />
throwOnDegenerate -- [Page:Boolean] If true, throw an error if the matrix is degenerate (not invertible).
[page:Matrix3 m] - the matrix to take the inverse of.<br />
[page:Boolean throwOnDegenerate] - (optional) If true, throw an error if the matrix is degenerate (not invertible).<br /><br />
Set this matrix to the [link:https://en.wikipedia.org/wiki/Invertible_matrix inverse] of the passed matrix [page:Matrix3 m],
using the [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution analytic method].
If [page:Boolean throwOnDegenerate] is not set and the matrix is not invertible, set this to the 3x3 identity matrix.
</div>
<h3>[method:Matrix3 getNormalMatrix]( [page:Matrix4 m] )</h3>
<div>
Set this matrix to the inverse of the passed matrix.
[page:Matrix4 m] - [page:Matrix4]<br /><br />
Sets this matrix as the upper left 3x3 of the [link:https://en.wikipedia.org/wiki/Normal_matrix normal matrix]
of the passed [page:Matrix4 matrix4]. The normal matrix is the [link:https://en.wikipedia.org/wiki/Invertible_matrix inverse] [link:https://en.wikipedia.org/wiki/Transpose transpose]
of the matrix [page:Matrix4 m].
</div>
<h3>[method:Matrix3 identity]() [page:Matrix3 this]</h3>
<h3>[method:Matrix3 identity]()</h3>
<div>
Resets this matrix to identity.<br/><br/>
Resets this matrix to the 3x3 identity matrix:
<code>
1, 0, 0
0, 1, 0
0, 0, 1
</code>
1, 0, 0<br/>
0, 1, 0<br/>
0, 0, 1<br/>
</div>
<h3>[method:Matrix3 clone]() [page:Matrix3 this]</h3>
<h3>[method:Matrix3 multiplyScalar]( [page:Float s] )</h3>
<div>Multiplies every component of the matrix by the scalar value *s*.</div>
<h3>
[method:Matrix3 set](
[page:Float n11], [page:Float n12], [page:Float n13],
[page:Float n21], [page:Float n22], [page:Float n23],
[page:Float n31], [page:Float n32], [page:Float n33] )
</h3>
<div>
Creates a copy of this matrix.
[page:Float n11] - value to put in row 1, col 1.<br />
[page:Float n12] - value to put in row 1, col 2.<br />
...<br />
...<br />
[page:Float n32] - value to put in row 3, col 2.<br />
[page:Float n33] - value to put in row 3, col 3.<br /><br />
Sets the 3x3 matrix values to the given
[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order row-major]
sequence of values.
</div>
<h3>[method:Array toArray]( [page:Array array], [page:Integer offset] ) [page:Matrix3 this]</h3>
<h3>[method:Matrix3 setFromMatrix4]( [page:Matrix4 m] )</h3>
<div>Set this matrx to the upper 3x3 matrix of the Matrix4 [page:Matrix4 m].</div>
<h3>[method:Array toArray]( [page:Array array], [page:Integer offset] )</h3>
<div>
array -- [page:Array] optional array to store the vector <br />
offset -- [page:Integer] optional offset into the array
[page:Array array] - (optional) array to store the resulting vector in. If not given a new array will be created.<br />
[page:Integer offset] - (optional) offset in the array at which to put the result.<br /><br />
Writes the elements of this matrix to an array in
[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] format.
</div>
<h3>[method:Matrix3 transpose]()</h3>
<div>[link:https://en.wikipedia.org/wiki/Transpose Transposes] this matrix in place.</div>
<h3>[method:Matrix3 transposeIntoArray]( [page:Array array] )</h3>
<div>
Writes the elements of this matrix to an array in column-major format.
[page:Array array] - array to store the resulting vector in.<br /><br />
[link:https://en.wikipedia.org/wiki/Transpose Transposes] this matrix into the supplied array,
and returns itself unchanged.
</div>
<h2>Source</h2>
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -10,16 +10,16 @@
<body>
<h1>[name]</h1>
<div class="desc">A geometric sphere defined by a center position and radius.</div>
<div class="desc">A sphere defined by a center and radius.</div>
<h2>Constructor</h2>
<h3>[name]( [page:Vector3 center], [page:Float radius] )</h3>
<div>
center -- [page:Vector3] <br />
radius -- [page:Float]
[page:Vector3 center] - center of the sphere. Default is a [page:Vector3] at (0, 0, 0). <br />
[page:Float radius] - radius of the sphere. Default is 0.<br /><br />
Creates a new [name].
</div>
......@@ -27,129 +27,109 @@
<h3>[property:Vector3 center]</h3>
<div>A [page:Vector3] defining the center of the sphere. Default is (0, 0, 0).</div>
<h3>[property:Float radius]</h3>
<div>The radius of the sphere. Default is 0.</div>
<h2>Methods</h2>
<h3>[method:Sphere set]( [page:Vector3 center], [page:Float radius] ) [page:Sphere this]</h3>
<h3>[method:Sphere applyMatrix4]( [page:Matrix4 matrix] )</h3>
<div>
center -- [page:Vector3] <br />
radius -- [page:Float]
</div>
<div>
Sets the center and radius.
</div>
[page:Matrix4 matrix] - the [Page:Matrix4] to apply <br /><br />
<h3>[method:Sphere applyMatrix4]( [page:Matrix4 matrix] ) [page:Sphere this]</h3>
<div>
matrix -- [page:Matrix4]
</div>
<div>
Transforms this sphere with the provided [page:Matrix4].
Transforms this sphere with the provided [page:Matrix4].
</div>
<h3>[method:Vector3 clampPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )</h3>
<div>
point -- [page:Vector3] The point to clamp <br />
optionalTarget -- [page:Vector3] The optional target point to return
</div>
<div>
Clamps a point within the sphere. If the point is is outside the sphere, it will clamp it to the closets point on the edge of the sphere.
</div>
[page:Vector3 point] - [page:Vector3] The point to clamp.<br />
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3],
otherwise a new [page:Vector3] will be created.<br /><br />
<h3>[method:Sphere translate]( [page:Vector3 offset] ) [page:Sphere this]</h3>
<div>
offset -- [page:Vector3]
</div>
<div>
Translate the sphere's center by the provided offset vector.
Clamps a point within the sphere. If the point is is outside the sphere, it will clamp it to the
closets point on the edge of the sphere. Points already inside the sphere will not be affected.
</div>
<h3>[method:Sphere clone]()</h3>
<div>
Provides a new copy of the sphere.
</div>
<div>Returns a new sphere with the same [page:.center center] and [page:.radius radius] as this one.</div>
<h3>[method:Boolean equals]( [page:Sphere sphere] )</h3>
<div>
sphere -- [page:Sphere]
</div>
<h3>[method:Boolean containsPoint]( [page:Vector3 point] )</h3>
<div>
Checks to see if the two spheres' centers and radii are equal.
</div>
[page:Vector3 point] - the [page:Vector3] to be checked<br /><br />
<h3>[method:Sphere setFromPoints]( [page:Array points], [page:Vector3 optionalCenter] ) [page:Sphere this]</h3>
<div>
points -- [page:Array] of [page:Vector3] positions.<br />
optionalCenter -- Optional [page:Vector3] position for the sphere's center.<br />
Checks to see if the sphere contains the provided [page:Vector3 point] inclusive of the
surface of the sphere.
</div>
<h3>[method:Sphere copy]( [page:Sphere sphere] )</h3>
<div>
Computes the minimum bounding sphere for *points*. If *optionalCenter* is given, it is used as the sphere's center. Otherwise, the center of the axis-aligned bounding box encompassing *points* is calculated.
Copies the values of the passed sphere's [page:.center center] and [page:.radius radius]
properties to this sphere.
</div>
<h3>[method:Float distanceToPoint]( [page:Vector3 point] )</h3>
<div>
point -- [page:Vector3]
</div>
<div>
Returns the closest distance from the boundary of the sphere to the point. If the sphere contains the point, the distance will be negative.
Returns the closest distance from the boundary of the sphere to the [page:Vector3 point]. If the sphere contains the point,
the distance will be negative.
</div>
<h3>[method:Box3 getBoundingBox]( [page:Box optionalTarget] )</h3>
<div>
optionalTarget -- [page:Box]
</div>
<div>
Returns a bounding box for the sphere, optionally setting a provided box target.
</div>
<h3>[method:Boolean empty]()</h3>
<div>Checks to see if the sphere is empty (the radius set to 0).</div>
<h3>[method:Boolean containsPoint]( [page:Vector3 point] )</h3>
<h3>[method:Boolean equals]( [page:Sphere sphere] )</h3>
<div>
point -- [page:Vector3]
Checks to see if the two spheres' centers and radii are equal.
</div>
<h3>[method:Box3 getBoundingBox]( [page:Box3 optionalTarget] )</h3>
<div>
Checks to see if the sphere contains the provided point inclusive of the edge of the sphere.
[page:Box3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3], otherwise a new [page:Box3] will be created.<br /><br />
Returns a[link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Box] for the sphere.
</div>
<h3>[method:Sphere copy]( [page:Sphere sphere] )</h3>
<h3>[method:Boolean intersectsBox]( [page:Box3 box] )</h3>
<div>
sphere -- [page:Sphere] to copy
[page:Box3 box] - [page:Box3] to check for intersection against.<br /><br />
Determines whether or not this sphere intersects a given [page:Box3 box].
</div>
<h3>[method:Boolean intersectsPlane]( [page:Plane plane] )</h3>
<div>
Copies the values of the passed sphere to this sphere.
[page:Plane plane] - Plane to check for intersection against.<br /><br />
Determines whether or not this sphere intersects a given [page:Plane plane].
</div>
<h3>[method:Boolean intersectsSphere]( [page:Sphere sphere] )</h3>
<div>
sphere -- [page:Sphere]
</div>
<div>
[page:Sphere sphere] - Sphere to check for intersection against.<br /><br />
Checks to see if two spheres intersect.
</div>
<h3>[method:Boolean intersectsBox]( [page:Box3 box] ) [page:Sphere this]</h3>
<div>
box -- Box to check for intersection against.
</div>
<h3>[method:Sphere set]( [page:Vector3 center], [page:Float radius] )</h3>
<div>
Determines whether or not this sphere intersects *box*.
</div>
[page:Vector3 center] - center of the sphere.<br />
[page:Float radius] - radius of the sphere.<br /><br />
<h3>[method:Boolean intersectsPlane]( [page:Plane plane] ) [page:Sphere this]</h3>
<div>
plane -- Plane to check for intersection against.
Sets the [page:.center center] and [page:.radius radius] properties of this sphere.
</div>
<h3>[method:Sphere setFromPoints]( [page:Array points], [page:Vector3 optionalCenter] )</h3>
<div>
Determines whether or not this sphere intersects *plane*.
[page:Array points] - an [page:Array] of [page:Vector3] positions.<br />
[page:Vector3 optionalCenter] - Optional [page:Vector3] position for the sphere's center.<br /><br />
Computes the minimum bounding sphere for an array of [page:Array points]. If [page:Vector3 optionalCenter]is given,
it is used as the sphere's center. Otherwise, the center of the axis-aligned bounding box encompassing
[page:Array points] is calculated.
</div>
<h3>[method:Boolean empty]()</h3>
<div>
Checks to see if the sphere is empty (the radius set to 0).
<h3>[method:Sphere translate]( [page:Vector3 offset] )</h3>
Translate the sphere's center by the provided offset [page:Vector3].
</div>
<h2>Source</h2>
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -16,38 +16,41 @@
A bone which is part of a [page:Skeleton]. The skeleton in turn is used by the [page:SkinnedMesh].
Bones are almost identical to a blank [page:Object3D].
</div>
<h3>Example</h3>
<code>
var root = new THREE.Bone();
var child = new THREE.Bone();
root.add( child );
child.position.y = 5;
</code>
<h2>Constructor</h2>
<h3>[name]( [page:SkinnedMesh skin] )</h3>
<h3>[name]( )</h3>
<div>
skin — (optional) The [page:SkinnedMesh] to which the bone belongs.
Creates a new [name].
</div>
<h2>Properties</h2>
<div>See the base [page:Object3D] class for common properties.</div>
<h3>[property:SkinnedMesh skin]</h3>
<h3>[property:Boolean isBone]</h3>
<div>
An optional reference to the [page:SkinnedMesh].
Used to check whether this or derived classes are bones. Default is *true*.<br /><br />
You should not change this, as it used internally for optimisation.
</div>
<h2>Methods</h2>
<h3>[method:Bone clone]()</h3>
<div>
Returns a clone of this Bone object and its descendants.
</div>
<h3>[property:String type]</h3>
<div>Set to 'Bone', this can be used to find all Bones in a scene.</div>
<h2>Methods</h2>
<div>See the base [page:Object3D] class for common methods.</div>
<h2>Source</h2>
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册