浏览代码

Added missing docs from Extras (#10042)

* Added CurveUtils docs

* Added docs for ShapeUtils

* Added docs for extras / core / font

* Added documentation for SkeletonHelper
Lewy Blue 8 年之前
父节点
当前提交
cfc247c93d

+ 63 - 0
docs/api/extras/CurveUtils.html

@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		<h1>[name]</h1>
+
+		<div class="desc">
+		A class containing utility functions for curves.<br />
+
+		Note that these are all linear functions so it is neccessary to calculate seperately for
+		x, y (and z, w if present) components of a curve.
+		</div>
+
+
+		<h2>Methods</h2>
+
+		<h3>[method:Number interpolate]( p0, p1, p2, p3, t )</h3>
+		<div>
+		t -- interpolation weight. <br />
+		p0, p1, p2, p4 -- the points defining the spline curve.<br /><br />
+
+		Used internally by [page:SplineCurve SplineCurve] and [page:SplineCurve3 SplineCurve3].
+		</div>
+
+		<h3>[method:Number tangentQuadraticBezier]( t, p0, p1, p2 )</h3>
+		<div>
+		t -- the point at which to calculate the tangent. <br />
+		p0, p1, p2 -- the three points defining the quadratic Bézier curve.<br /><br />
+
+		Calculate the tangent at the point t on a quadratic Bézier curve given by the three points.<br /><br />
+
+		Used internally by [page:QuadraticBezierCurve QuadraticBezierCurve].
+		</div>
+
+		<h3>[method:Number tangentCubicBezier]( t, p0, p1, p2, p3 )</h3>
+		<div>
+		t -- the point at which to calculate the tangent. <br />
+		p0, p1, p2, p3 -- the points defining the cubic Bézier curve.<br /><br />
+
+		Calculate the tangent at the point t on a cubic Bézier curve given by the four points.<br /><br />
+
+		Used internally by [page:CubicBezierCurve CubicBezierCurve].
+		</div>
+
+		<h3>[method:Number tangentSpline]( t, p0, p1, p2, p3 )</h3>
+		<div>
+		t -- the point at which to calculate the tangent. <br />
+		p0, p1, p2, p3 -- the points defining the spline curve.<br /><br />
+
+		Calculate the tangent at the point t on a spline curve given by the four points.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 88 - 0
docs/api/extras/ShapeUtils.html

@@ -0,0 +1,88 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		<h1>[name]</h1>
+
+		<div class="desc">
+		A class containing utility functions for shapes.<br />
+
+		Note that these are all linear functions so it is neccessary to calculate seperately for
+		x, y (an z, w if present) components of a vector.
+		</div>
+
+
+		<h2>Methods</h2>
+
+		<h3>[method:Number area]( contour )</h3>
+		<div>
+		contour -- 2D polygon.<br /><br />
+
+		Calculate area of a ( 2D ) contour polygon.<br /><br />
+
+		</div>
+
+		<h3>[method:Number b2]( t, p0, p1, p2 )</h3>
+		<div>
+		t -- number<br />
+		p0, p1, p2 -- x, y, z or w components of a quadratic bezier curve.<br /><br />
+
+		Note that this is a linear function so it is neccessary to calculate seperately for
+		x, y (and z for 3D curves) components of a curve.<br /><br />
+
+		Used internally by [page:QuadraticBezierCurve QuadraticBezierCurve],
+		[page:QuadraticBezierCurve3 QuadraticBezierCurve3] and [page:Font Font].
+		</div>
+
+		<h3>[method:Number b3]( t, p0, p1, p2, p3 )</h3>
+		<div>
+		t -- number. <br />
+		p0, p1, p2, p3 -- x, y or z components of a cubic bezier curve..<br /><br />
+
+		Note that this is a linear function so it is neccessary to calculate seperately for
+		x, y (and z for 3D curves) components of a curve.<br /><br />
+
+		Used internally by [page:CubicBezierCurve CubicBezierCurve],
+		[page:CubicBezierCurve3 CubicBezierCurve3] and [page:Font Font].
+		</div>
+
+		<h3>[method:Boolean isClockwise]( pts )</h3>
+		<div>
+		pts -- points defining a 2D polygon<br /><br />
+
+		Note that this is a linear function so it is neccessary to calculate seperately for
+		x, y  components of a polygon.<br /><br />
+
+		Used internally by [page:Path Path],
+		[page:ExtrudeGeometry ExtrudeGeometry] and [page:ShapeBufferGeometry ShapeBufferGeometry].
+		</div>
+
+		<h3>[method:null triangulate]( contour, indices )</h3>
+		<div>
+		contour --  2D polygon.<br />
+		indices -- <br /><br />
+
+		Used internally by [page:ExtrudeGeometry ExtrudeGeometry]
+		and [page:ShapeBufferGeometry ShapeBufferGeometry] to calculate faces.
+		</div>
+
+		<h3>[method:null triangulateShape]( contour, holes )</h3>
+		<div>
+		contour -- 2D polygon.<br />
+		holes -- array of holes<br /><br />
+
+		Used internally by [page:ExtrudeGeometry ExtrudeGeometry]
+		and [page:ShapeBufferGeometry ShapeBufferGeometry] to calculate faces in shapes with holes.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 32 - 0
docs/api/extras/core/Font.html

@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		<h1>[name]</h1>
+
+		<div class="desc">
+		Create a set of [page:Shape Shape]s representing a font loaded in JSON format.<br /><br />
+
+		Used internally by the [page:FontLoader].
+		</div>
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( data )</h3>
+		<div>
+		data -- JSON data representing the font.<br /><br />
+
+		This constructor creates a new [name], which is an array of [page:Shape Shape]s.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 75 - 0
docs/api/extras/helpers/SkeletonHelper.html

@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		[page:Object3D] &rarr; [page:Line] &rarr; [page:LineSegments] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+		A helper object to assist with visualizing a [page:Skeleton Skeleton].
+		The helper is renderered using a [page:LineBasicMaterial LineBasicMaterial].
+		</div>
+
+
+		<h2>Example</h2>
+
+		[example:webgl_animation_skinning_blending animation / skinning / blending]<br />
+		[example:webgl_animation_skinning_morph animation / skinning / morph]<br />
+		[example:webgl_loader_bvh loader / bvh ]
+
+		<code>
+var helper = new THREE.SkeletonHelper( mesh );
+helper.material.linewidth = 3;
+scene.add( helper );
+		</code>
+
+
+
+		<h2>Constructor</h2>
+
+
+		<h3>[name]( object )</h3>
+		<div>
+		object -- can be any object that has an array of [page:Bone Bone]s as a sub object. <br />
+		For example, a [page:Skeleton Skeleton] or a [page:SkinnedMesh SkinnedMesh].
+		</div>
+
+
+		<h2>Properties</h2>
+
+		<h3>[property:Array bones]</h3>
+		<div>
+		The list of bones that the helper renders as [page:Line Line]s.
+		</div>
+
+		<h3>[property:Object root]</h3>
+		<div>
+		The object passed in the constructor.
+		</div>
+
+		<h2>Methods</h2>
+
+		<h3>[method:Array getBoneList]( object )</h3>
+		<div>
+		getBoneList -- the object used in the constructor.<br /><br />
+
+		This is called automatically to generate a list of bones from the object passed in the constructor.
+		</div>
+
+		<h3>[method:null update]()</h3>
+		<div>
+		Update the helper. Call in the render loop if animating the model.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 59 - 0
docs/api/objects/Group.html

@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		[page:Object3D] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">This is almost identical to an [page:Object3D Object3D]. It's purpose is to make working with groups of objects syntactically clearer.</div>
+
+
+		<h2>Example</h2>
+
+		<code>
+		var geometry = new THREE.BoxBufferGeometry( 1, 1, 1 );
+		var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
+
+		var cubeA = new THREE.Mesh( geometry, material );
+		cubeA.position.set( 100, 100, 0 );
+
+		var cubeB = new THREE.Mesh( geometry, material );
+		cubeA.position.set( -100, -100, 0 );
+
+		//create a group and add the two cubes
+		//These cubes can now be rotated / scaled etc as a group
+		var group = new THREE.Group();
+		group.add( cubeA );
+		group.add( cubeB )
+
+		scene.add( group );
+		</code>
+
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( )</h3>
+
+		<h2>Properties</h2>
+
+		Properties are identical to an [page:Object3D]'s properties, with the exception of:
+
+		<h3>[property:String type]</h3>
+		<div>A string 'Group'. This should not be changed.</div>
+
+		<h2>Methods</h2>
+
+		Methods are identical to an [page:Object3D]'s methods.
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 6 - 1
docs/list.js

@@ -167,6 +167,7 @@ var list = {
 
 		"Objects": [
 			[ "Bone", "api/objects/Bone" ],
+			[ "Group", "api/objects/Group" ],
 			[ "LensFlare", "api/objects/LensFlare" ],
 			[ "Line", "api/objects/Line" ],
 			[ "LineSegments", "api/objects/LineSegments" ],
@@ -226,7 +227,9 @@ var list = {
 		],
 
 		"Extras": [
-			[ "SceneUtils", "api/extras/SceneUtils" ]
+			[ "CurveUtils", "api/extras/CurveUtils" ],
+			[ "SceneUtils", "api/extras/SceneUtils" ],
+			[ "ShapeUtils", "api/extras/ShapeUtils" ]
 		],
 
 		"Extras / Collada Animation": [
@@ -238,6 +241,7 @@ var list = {
 		"Extras / Core": [
 			[ "Curve", "api/extras/core/Curve" ],
 			[ "CurvePath", "api/extras/core/CurvePath" ],
+			[ "Font", "api/extras/core/Font" ],
 			[ "Path", "api/extras/core/Path" ],
 			[ "Shape", "api/extras/core/Shape" ]
 		],
@@ -268,6 +272,7 @@ var list = {
 			[ "GridHelper", "api/extras/helpers/GridHelper" ],
 			[ "HemisphereLightHelper", "api/extras/helpers/HemisphereLightHelper" ],
 			[ "PointLightHelper", "api/extras/helpers/PointLightHelper" ],
+			[ "SkeletonHelper", "api/extras/helpers/SkeletonHelper" ],
 			[ "SpotLightHelper", "api/extras/helpers/SpotLightHelper" ],
 			[ "VertexNormalsHelper", "api/extras/helpers/VertexNormalsHelper" ]
 		],