浏览代码

Documentation: Added InstancedMesh page.

Mugen87 5 年之前
父节点
当前提交
47f6b1a15e
共有 3 个文件被更改,包括 160 次插入0 次删除
  1. 79 0
      docs/api/en/objects/InstancedMesh.html
  2. 79 0
      docs/api/zh/objects/InstancedMesh.html
  3. 2 0
      docs/list.js

+ 79 - 0
docs/api/en/objects/InstancedMesh.html

@@ -0,0 +1,79 @@
+<!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:Mesh] &rarr;
+
+		<h1>[name]</h1>
+
+		<p class="desc">
+		A special version of [page:Mesh] with instanced rendering support. Use [name] if you have to render a large amount of
+		objects with the same geometry and material but with different world transformations. The usage of [name] will help you
+		to reduce the amount of draw calls and thus improve the overall rendering performance in your application.
+		</p>
+
+		<h3>Example</h3>
+
+		<p>
+			[example:webgl_instancing_suzanne WebGL / instancing / suzanne]<br />
+		</p>
+
+		<h2>Constructor</h2>
+		<h3>[name]( [param:BufferGeometry geometry], [param:Material material], [param:Integer count] )</h3>
+		<p>
+		[page:Geometry geometry] - an instance of [page:BufferGeometry].<br />
+		[page:Material material] - an instance of [page:Material]. Default is a new [page:MeshBasicMaterial].<br />
+		[page:Integer count] - the amount of instances.<br />
+		</p>
+
+		<h2>Properties</h2>
+		<p>See the base [page:Mesh] class for common properties.</p>
+
+		<h3>[property:Integer count]</h3>
+		<p>
+			The amount of instances. The *count* value passed into the constructor represents the maximum amount of
+			instances of this mesh. You can change the amount of instances at runtime to an integer value
+			in the range [0, count].
+		</p>
+		<p>
+			If you need more instances than the original count value, you have to create a new [name].
+		</p>
+
+		<h3>[property:Boolean isInstancedMesh]</h3>
+		<p>
+			Used to check whether this or derived classes are instanced meshes.
+			You should not change this, as it used internally for optimization. Default is *true*.
+		</p>
+
+		<h3>[property:BufferAttribute instanceMatrix]</h3>
+		<p>
+			Represents the local transformation of all instances. For internal use only.
+		</p>
+
+		<h2>Methods</h2>
+		<p>See the base [page:Mesh] class for common methods.</p>
+
+		<h3>[method:null setMatrixAt]( [param:Integer index], [param:Matrix4 matrix] )</h3>
+		<p>
+			[page:Integer index]: The index of an instance. Values have to be in the range [0, count].
+		</p>
+		<p>
+			[page:Matrix4 matrix]: A 4x4 matrix representing the local transformation of a single instance.
+		</p>
+		<p>
+			Sets the given local transformation matrix to the defined instance.
+		</p>
+
+		<h2>Source</h2>
+
+		<p>
+			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+		</p>
+	</body>
+</html>

+ 79 - 0
docs/api/zh/objects/InstancedMesh.html

@@ -0,0 +1,79 @@
+<!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:Mesh] &rarr;
+
+		<h1>[name]</h1>
+
+		<p class="desc">
+		A special version of [page:Mesh] with instanced rendering support. Use [name] if you have to render a large amount of
+		objects with the same geometry and material but with different world transformations. The usage of [name] will help you
+		to reduce the amount of draw calls and thus improve the overall rendering performance in your application.
+		</p>
+
+		<h3>Example</h3>
+
+		<p>
+			[example:webgl_instancing_suzanne WebGL / instancing / suzanne]<br />
+		</p>
+
+		<h2>Constructor</h2>
+		<h3>[name]( [param:BufferGeometry geometry], [param:Material material], [param:Integer count] )</h3>
+		<p>
+		[page:Geometry geometry] - an instance of [page:BufferGeometry].<br />
+		[page:Material material] - an instance of [page:Material]. Default is a new [page:MeshBasicMaterial].<br />
+		[page:Integer count] - the amount of instances.<br />
+		</p>
+
+		<h2>Properties</h2>
+		<p>See the base [page:Mesh] class for common properties.</p>
+
+		<h3>[property:Integer count]</h3>
+		<p>
+			The amount of instances. The *count* value passed into the constructor represents the maximum amount of
+			instances of this mesh. You can change the amount of instances at runtime to an integer value
+			in the range [0, count].
+		</p>
+		<p>
+			If you need more instances than the original count value, you have to create a new [name].
+		</p>
+
+		<h3>[property:Boolean isInstancedMesh]</h3>
+		<p>
+			Used to check whether this or derived classes are instanced meshes.
+			You should not change this, as it used internally for optimization. Default is *true*.
+		</p>
+
+		<h3>[property:BufferAttribute instanceMatrix]</h3>
+		<p>
+			Represents the local transformation of all instances. For internal use only.
+		</p>
+
+		<h2>Methods</h2>
+		<p>See the base [page:Mesh] class for common methods.</p>
+
+		<h3>[method:null setMatrixAt]( [param:Integer index], [param:Matrix4 matrix] )</h3>
+		<p>
+			[page:Integer index]: The index of an instance. Values have to be in the range [0, count].
+		</p>
+		<p>
+			[page:Matrix4 matrix]: A 4x4 matrix representing the local transformation of a single instance.
+		</p>
+		<p>
+			Sets the given local transformation matrix to the defined instance.
+		</p>
+
+		<h2>Source</h2>
+
+		<p>
+			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+		</p>
+	</body>
+</html>

+ 2 - 0
docs/list.js

@@ -301,6 +301,7 @@ var list = {
 			"Objects": {
 				"Bone": "api/en/objects/Bone",
 				"Group": "api/en/objects/Group",
+				"InstancedMesh": "api/en/objects/InstancedMesh",
 				"Line": "api/en/objects/Line",
 				"LineLoop": "api/en/objects/LineLoop",
 				"LineSegments": "api/en/objects/LineSegments",
@@ -744,6 +745,7 @@ var list = {
 			"物体": {
 				"Bone": "api/zh/objects/Bone",
 				"Group": "api/zh/objects/Group",
+				"InstancedMesh": "api/zh/objects/InstancedMesh",
 				"Line": "api/zh/objects/Line",
 				"LineLoop": "api/zh/objects/LineLoop",
 				"LineSegments": "api/zh/objects/LineSegments",