浏览代码

Minor improvements.

Mr.doob 11 年之前
父节点
当前提交
c67501322b
共有 3 个文件被更改,包括 4 次插入6 次删除
  1. 2 2
      examples/js/wip/IndexedTypedGeometry.js
  2. 1 1
      examples/js/wip/PlaneTypedGeometry.js
  3. 1 3
      src/core/Object3D.js

+ 2 - 2
examples/js/wip/IndexedTypedGeometry.js

@@ -20,8 +20,8 @@ THREE.IndexedTypedGeometry.prototype.setArrays = function ( indices, vertices, n
 	this.attributes[ 'index' ] = { array: indices, itemSize: 1 };
 	this.attributes[ 'index' ] = { array: indices, itemSize: 1 };
 	this.attributes[ 'position' ] = { array: vertices, itemSize: 3 };
 	this.attributes[ 'position' ] = { array: vertices, itemSize: 3 };
 	this.attributes[ 'normal' ] = { array: normals, itemSize: 3 };
 	this.attributes[ 'normal' ] = { array: normals, itemSize: 3 };
-	this.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };	
+	this.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };
 
 
 	return this;
 	return this;
 
 
-};
+};

+ 1 - 1
examples/js/wip/PlaneTypedGeometry.js

@@ -56,7 +56,7 @@ THREE.PlaneTypedGeometry = function ( width, height, widthSegments, heightSegmen
 
 
 	offset = 0;
 	offset = 0;
 
 
-	var indices = new ( vertices.length > 65535 ? Uint32Array : Uint16Array )( gridX * gridY * 6 );
+	var indices = new ( ( vertices.length / 3 ) > 65535 ? Uint32Array : Uint16Array )( gridX * gridY * 6 );
 
 
 	for ( var iy = 0; iy < gridY; iy ++ ) {
 	for ( var iy = 0; iy < gridY; iy ++ ) {
 
 

+ 1 - 3
src/core/Object3D.js

@@ -208,9 +208,7 @@ THREE.Object3D.prototype = {
 
 
 		return function ( axis, distance ) {
 		return function ( axis, distance ) {
 
 
-			v1.copy( axis );
-
-			v1.applyQuaternion( this.quaternion );
+			v1.copy( axis ).applyQuaternion( this.quaternion );
 
 
 			this.position.add( v1.multiplyScalar( distance ) );
 			this.position.add( v1.multiplyScalar( distance ) );