Browse Source

Add zh doc entry

Luis Blanco 5 years ago
parent
commit
4aed9dcd6c
2 changed files with 114 additions and 0 deletions
  1. 113 0
      docs/api/zh/core/GLBufferAttribute.html
  2. 1 0
      docs/list.js

+ 113 - 0
docs/api/zh/core/GLBufferAttribute.html

@@ -0,0 +1,113 @@
+<!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>
+
+		<p class="desc">
+			This buffer attribute class does not construct a VBO. Instead, it uses
+			whatever VBO is passed in constructor and can later be altered via the
+			*buffer* property.<br /><br />
+			It is required to pass additional params alongside the VBO. Those are:
+			the GL context, the GL data type, the number of components per vertex
+			and the number of vertices.<br /><br />
+			The most common use case for this class is when some kind of GPGPU
+			calculation interferes or even produces the VBOs in question.
+		</p>
+
+		<h2>Constructor</h2>
+		<h3>[name]( [param:WebGLRenderingContext gl], [param:WebGLBuffer buffer], [param:GLenum type], [param:Integer itemSize], [param:Integer count], [param:Boolean normalized] )</h3>
+		<p>
+		gl — Must be a [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext].
+		<br />
+		buffer — Must be a [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer].
+		<br />
+		type — One of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types].
+		<br />
+		itemSize — The number of values of the array that should be associated with
+		a particular vertex. For instance, if this
+		attribute is storing a 3-component vector (such as a position, normal, or color), then itemSize should be 3.
+		<br />
+		count — The expected number of vertices in VBO.
+		<br /><br />
+		
+		normalized — (optional) Applies to integer data only. Indicates how the underlying data
+		in the buffer maps to the values in the GLSL code. For instance, if [page:TypedArray array] is an instance
+		of UInt16Array, and [page:Boolean normalized] is true, the values 0 - +65535 in the array
+		 data will be mapped to 0.0f - +1.0f in the GLSL attribute. An Int16Array (signed) would map
+		 from -32767 - +32767  to -1.0f - +1.0f. If [page:Boolean normalized] is false, the values
+		 will be converted to floats unmodified, i.e. 32767 becomes 32767.0f.
+		</p>
+
+		<h2>Properties</h2>
+
+		<h3>[property:WebGLBuffer buffer]</h3>
+		<p>
+			The current <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer" target="_blank">WebGLBuffer</a> instance.
+		</p>
+
+		<h3>[property:Integer count]</h3>
+		<p>
+			The expected number of vertices in VBO.
+		</p>
+
+		<h3>[property:Boolean normalized]</h3>
+		<p>
+		Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
+		See the constructor above for details.
+		</p>
+
+		<h3>[property:Integer itemSize]</h3>
+		<p>
+			How many values make up each item (vertex).
+		</p>
+
+		<h3>[property:Integer elementSize]</h3>
+		<p>
+			Stores the corresponding size in bytes for the current *type* property value.
+		</p>
+		<p>
+			<b>Don't touch</b>.
+		</p>
+
+		<h3>[property:GLenum type]</h3>
+		<p>
+			A <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Standard_WebGL_1_constants" target="_blank">WebGL Data Type</a> describing the underlying VBO contents.
+		</p>
+		<p>
+			Setting this is only allowed with *setType*.
+		</p>
+
+		<h3>[property:Boolean isGLBufferAttribute]</h3>
+		<p>
+			Should be *true*.
+		</p>
+
+		<h2>Methods</h2>
+
+		<h3>[method:null setBuffer]( buffer ) </h3>
+		<p>Sets the *buffer* property.</p>
+
+		<h3>[method:null setType]( type ) </h3>
+		<p>Sets the *type* property.</p>
+
+		<h3>[method:null setItemSize]( itemSize ) </h3>
+		<p>Sets the *itemSize* property.</p>
+
+		<h3>[method:null setCount]( count ) </h3>
+		<p>Sets the *count* property.</p>
+
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 1 - 0
docs/list.js

@@ -543,6 +543,7 @@ var list = {
 				"EventDispatcher": "api/zh/core/EventDispatcher",
 				"Face3": "api/zh/core/Face3",
 				"Geometry": "api/zh/core/Geometry",
+				"GLBufferAttribute": "api/zh/core/GLBufferAttribute",
 				"InstancedBufferAttribute": "api/zh/core/InstancedBufferAttribute",
 				"InstancedBufferGeometry": "api/zh/core/InstancedBufferGeometry",
 				"InstancedInterleavedBuffer": "api/zh/core/InstancedInterleavedBuffer",