Parcourir la source

Merge branch 'dev' of https://github.com/mrdoob/three.js into zh_doc

gogoend il y a 6 ans
Parent
commit
eb572f973a

+ 0 - 9
docs/api/en/math/Box3.html

@@ -244,15 +244,6 @@
 		Sets the upper and lower bounds of this box to include all of the data in [page:BufferAttribute attribute].
 		</p>
 
-		<h3>[method:Box3 setFromCenterAndSize]( [param:Vector3 center], [param:Vector3 size] )</h3>
-		<p>
-		[page:Vector3 center] - Desired center position of the box ([page:Vector3]). <br>
-		[page:Vector3 size] - Desired x, y and z 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].
-		</p>
-
 		<h3>[method:Box3 setFromCenterAndSize]( [param:Vector3 center], [param:Vector3 size] ) [param:Box3 this]</h3>
 		<p>
 		[page:Vector3 center], - Desired center position of the box. <br>

+ 3 - 11
docs/api/zh/math/Box3.html

@@ -34,7 +34,7 @@
 		<h3>[property:Boolean isBox3]</h3>
 		<p>
 			用于检测当前对象或者派生类对象是否是Box3。默认为 *true*。<br /><br />
-			
+
 			不应该修改这个值,因为内部使用该属性做了优化的任务。
 		</p>
 
@@ -57,7 +57,7 @@
 		<h3>[method:Box3 applyMatrix4]( [param:Matrix4 matrix] )</h3>
 		<p>
 		[page:Matrix4 matrix] - 要应用的 [page:Matrix4] <br /><br />
-		
+
 		使用传入的矩阵变换Box3(包围盒8个顶点都会乘以这个变换矩阵)。
 		</p>
 
@@ -219,7 +219,7 @@
 		[page:Vector3 min] - [page:Vector3] 表示下边界每个纬度(x,y,z)的值。<br />
 		[page:Vector3 max] - [page:Vector3] 表示上边界每个纬度(x,y,z)的值。<br /><br />
 
-		设置包围盒上下边界每个纬度(x,y,z)的值。 
+		设置包围盒上下边界每个纬度(x,y,z)的值。
 		</p>
 
 		<h3>[method:Box3 setFromArray]( [param:Array array] ) [param:Box3 this]</h3>
@@ -236,14 +236,6 @@
 		设置此包围盒的上边界和下边界,以包含 [page:BufferAttribute attribute] 中的所有位置数据。
 		</p>
 
-<!--	<h3>[method:Box3 setFromCenterAndSize]( [param:Vector3 center], [param:Vector3 size] )</h3>
-		<p>
-		[page:Vector3 center] - 包围盒的中心位置 ([page:Vector3]). <br>
-		[page:Vector3 size] - 需要设置包围盒x,y,z的分量 ([page:Vector3]).<br /><br />
-
-		将包围盒的中心点设为 [page:Vector3 center] ,然后将包围盒的宽高设为指定的 [page:Vector3 size]。
-		</p>-->	
-
 		<h3>[method:Box3 setFromCenterAndSize]( [param:Vector3 center], [param:Vector3 size] ) [param:Box3 this]</h3>
 		<p>
 		[page:Vector3 center], - 包围盒所要设置的中心位置。 <br>

+ 6 - 3
docs/examples/loaders/GLTFLoader.html

@@ -31,13 +31,16 @@
 			<li>KHR_draco_mesh_compression</li>
 			<li>KHR_materials_pbrSpecularGlossiness</li>
 			<li>KHR_materials_unlit</li>
-			<li>KHR_lights_punctual</li>
-			<li>KHR_texture_transform<sup>*</sup></li>
+			<li>KHR_lights_punctual<sup>1</sup></li>
+			<li>KHR_texture_transform<sup>2</sup></li>
 			<li>MSFT_texture_dds</li>
 		</ul>
 
 		<p><i>
-			<sup>*</sup>UV transforms are supported, with several key limitations. Transforms applied to
+			<sup>1</sup>Requires [link:https://threejs.org/docs/#api/en/renderers/WebGLRenderer.physicallyCorrectLights physicallyCorrectLights] to be enabled.
+		</i></p>
+		<p><i>
+			<sup>2</sup>UV transforms are supported, with several key limitations. Transforms applied to
 			a texture using the first UV slot (all textures except aoMap and lightMap) must share the same
 			transform, or no transfor at all. The aoMap and lightMap textures cannot be transformed. No
 			more than one transform may be used per material. Each use of a texture with a unique

+ 28 - 0
docs/examples/utils/BufferGeometryUtils.html

@@ -45,6 +45,34 @@
 
     </p>
 
+    <h3>[method:InterleavedBufferAttribute interleaveAttributes]( [param:Array attributes] )</h3>
+    <p>
+    attributes -- Array of [page:BufferAttribute BufferAttribute] instances.<br /><br />
+
+    Interleaves a set of attributes and returns a new array of corresponding attributes that share
+    a single InterleavedBuffer instance. All attributes must have compatible types. If merge does not
+    succeed, the method returns null.
+
+    </p>
+
+    <h3>[method:Number estimateBytesUsed]( [param:BufferGeometry geometry] )</h3>
+    <p>
+    geometry -- Instance of [page:BufferGeometry BufferGeometry] to estimate the memory use of.<br /><br />
+
+    Returns the amount of bytes used by all attributes to represent the geometry.
+
+    </p>
+
+    <h3>[method:BufferGeometry mergeVertices]( [param:BufferGeometry geometry], [param:Number tolerance] )</h3>
+    <p>
+    geometry -- Instance of [page:BufferGeometry BufferGeometry] to merge the vertices of.<br />
+    tolerance -- The maximum allowable difference between vertex attributes to merge. Defaults to 1e-4.<br /><br />
+
+    Returns a new [page:BufferGeometry BufferGeometry] with vertices for which all similar vertex attributes
+    (within tolerance) are merged.
+
+    </p>
+
     <h2>Source</h2>
 
     [link:https://github.com/mrdoob/three.js/blob/master/examples/js/utils/BufferGeometryUtils.js examples/js/utils/BufferGeometryUtils.js]

+ 1 - 1
docs/manual/zh/introduction/Creating-a-scene.html

@@ -114,7 +114,7 @@
 		cube.rotation.y += 0.01;
 		</code>
 
-		<p>这一段代码将在每一帧时被渲染时调用(正常情况下是60次/秒),这就让立方体有了一个看起来很不错的旋转动画。基本上来说,当应用程序运行时,如果你想要移动或者改变任何场景中的东西,都必须要经过这个动画循环。当然,在这个动画循环函数里,你也可以调用别的函数,这样你在写<strong>animate</strong>函数的时候,这样你在写animate函数的时候,就不用在这里以成千上万的代码来结尾了。</p>
+		<p>这一段代码将在每一帧时被渲染时调用(正常情况下是60次/秒),这就让立方体有了一个看起来很不错的旋转动画。基本上来说,当应用程序运行时,如果你想要移动或者改变任何场景中的东西,都必须要经过这个动画循环。当然,在这个动画循环函数里,你也可以调用别的函数,这样你在写<strong>animate</strong>函数的时候,就不用在这里以成千上万的代码来结尾了。</p>
 
 		<h2>结果</h2>
 		<p>祝贺你!你现在已经成功完成了你的第一个Three.js应用程序。虽然它很简单,但现在你已经有了一个入门的起点。</p>

+ 2 - 2
examples/jsm/controls/MapControls.js

@@ -1036,7 +1036,7 @@ var MapControls = function ( object, domElement ) {
 };
 
 MapControls.prototype = Object.create( EventDispatcher.prototype );
-MapControls.prototype.constructor = THREE.MapControls;
+MapControls.prototype.constructor = MapControls;
 
 Object.defineProperties( MapControls.prototype, {
 
@@ -1163,4 +1163,4 @@ Object.defineProperties( MapControls.prototype, {
 
 } );
 
-export { MapControls }
+export { MapControls };

+ 2 - 2
examples/jsm/controls/OrbitControls.js

@@ -932,7 +932,7 @@ var OrbitControls = function ( object, domElement ) {
 };
 
 OrbitControls.prototype = Object.create( EventDispatcher.prototype );
-OrbitControls.prototype.constructor = THREE.OrbitControls;
+OrbitControls.prototype.constructor = OrbitControls;
 
 Object.defineProperties( OrbitControls.prototype, {
 
@@ -1059,4 +1059,4 @@ Object.defineProperties( OrbitControls.prototype, {
 
 } );
 
-export { OrbitControls }
+export { OrbitControls };

+ 3 - 3
examples/jsm/controls/TrackballControls.js

@@ -499,7 +499,7 @@ var TrackballControls = function ( object, domElement ) {
 	function touchstart( event ) {
 
 		if ( _this.enabled === false ) return;
-		
+
 		event.preventDefault();
 
 		switch ( event.touches.length ) {
@@ -623,6 +623,6 @@ var TrackballControls = function ( object, domElement ) {
 };
 
 TrackballControls.prototype = Object.create( EventDispatcher.prototype );
-TrackballControls.prototype.constructor = THREE.TrackballControls;
+TrackballControls.prototype.constructor = TrackballControls;
 
-export { TrackballControls }
+export { TrackballControls };

+ 11 - 6
examples/jsm/loaders/GLTFLoader.js

@@ -432,7 +432,7 @@ var GLTFLoader = ( function () {
 
 			case 'directional':
 				lightNode = new DirectionalLight( color );
-				lightNode.target.position.set( 0, 0, -1 );
+				lightNode.target.position.set( 0, 0, - 1 );
 				lightNode.add( lightNode.target );
 				break;
 
@@ -450,7 +450,7 @@ var GLTFLoader = ( function () {
 				lightDef.spot.outerConeAngle = lightDef.spot.outerConeAngle !== undefined ? lightDef.spot.outerConeAngle : Math.PI / 4.0;
 				lightNode.angle = lightDef.spot.outerConeAngle;
 				lightNode.penumbra = 1.0 - lightDef.spot.innerConeAngle / lightDef.spot.outerConeAngle;
-				lightNode.target.position.set( 0, 0, -1 );
+				lightNode.target.position.set( 0, 0, - 1 );
 				lightNode.add( lightNode.target );
 				break;
 
@@ -1058,6 +1058,7 @@ var GLTFLoader = ( function () {
 					uniforms.refractionRatio.value = material.refractionRatio;
 
 					uniforms.maxMipLevel.value = renderer.properties.get( material.envMap ).__maxMipLevel;
+
 				}
 
 				uniforms.specular.value.copy( material.specular );
@@ -1450,8 +1451,10 @@ var GLTFLoader = ( function () {
 				var accessor = target.POSITION !== undefined
 					? parser.getDependency( 'accessor', target.POSITION )
 						.then( function ( accessor ) {
+
 							// Cloning not to pollute original accessor below
 							return cloneBufferAttribute( accessor );
+
 						} )
 					: geometry.attributes.position;
 
@@ -1465,7 +1468,9 @@ var GLTFLoader = ( function () {
 				var accessor = target.NORMAL !== undefined
 					? parser.getDependency( 'accessor', target.NORMAL )
 						.then( function ( accessor ) {
+
 							return cloneBufferAttribute( accessor );
+
 						} )
 					: geometry.attributes.normal;
 
@@ -1942,7 +1947,7 @@ var GLTFLoader = ( function () {
 
 				case 'light':
 					dependency = this.extensions[ EXTENSIONS.KHR_LIGHTS_PUNCTUAL ].loadLight( index );
-					break
+					break;
 
 				default:
 					throw new Error( 'Unknown type: ' + type );
@@ -3223,7 +3228,7 @@ var GLTFLoader = ( function () {
 
 		var nodeDef = json.nodes[ nodeIndex ];
 
-		return ( function() {
+		return ( function () {
 
 			// .isBone isn't in glTF spec. See .markDefs
 			if ( nodeDef.isBone === true ) {
@@ -3416,7 +3421,7 @@ var GLTFLoader = ( function () {
 
 						mesh.bind( new Skeleton( bones, boneInverses ), mesh.matrixWorld );
 
-					};
+					}
 
 					return node;
 
@@ -3487,4 +3492,4 @@ var GLTFLoader = ( function () {
 
 } )();
 
-export { GLTFLoader }
+export { GLTFLoader };

+ 1 - 1
examples/jsm/loaders/OBJLoader.js

@@ -813,4 +813,4 @@ var OBJLoader = ( function () {
 
 } )();
 
-export { OBJLoader }
+export { OBJLoader };