فهرست منبع

Updated builds.

Mr.doob 8 سال پیش
والد
کامیت
24f0d2d655
3فایلهای تغییر یافته به همراه306 افزوده شده و 276 حذف شده
  1. 34 19
      build/three.js
  2. 238 238
      build/three.min.js
  3. 34 19
      build/three.modules.js

+ 34 - 19
build/three.js

@@ -40077,7 +40077,7 @@
 
 			matrixWorldInv.getInverse( this.root.matrixWorld );
 
-			for ( var i = 0, j = 0; i < this.bones.length; i ++, j += 2 ) {
+			for ( var i = 0, j = 0; i < this.bones.length; i ++ ) {
 
 				var bone = this.bones[ i ];
 
@@ -40091,6 +40091,8 @@
 					vector.setFromMatrixPosition( boneMatrix );
 					position.setXYZ( j + 1, vector.x, vector.y, vector.z );
 
+					j += 2;
+
 				}
 
 			}
@@ -40276,9 +40278,10 @@
 	/**
 	 * @author alteredq / http://alteredqualia.com/
 	 * @author mrdoob / http://mrdoob.com/
+	 * @author Mugen87 / https://github.com/Mugen87
 	 */
 
-	function HemisphereLightHelper( light, sphereSize ) {
+	function HemisphereLightHelper( light, size ) {
 
 		Object3D.call( this );
 
@@ -40288,21 +40291,17 @@
 		this.matrix = light.matrixWorld;
 		this.matrixAutoUpdate = false;
 
-		this.colors = [ new Color(), new Color() ];
+		var geometry = new OctahedronBufferGeometry( size );
+		geometry.rotateY( Math.PI * 0.5 );
 
-		var geometry = new SphereGeometry( sphereSize, 4, 2 );
-		geometry.rotateX( - Math.PI / 2 );
+		var material = new MeshBasicMaterial( { vertexColors: VertexColors, wireframe: true } );
 
-		for ( var i = 0, il = 8; i < il; i ++ ) {
+		var position = geometry.getAttribute( 'position' );
+		var colors = new Float32Array( position.count * 3 );
 
-			geometry.faces[ i ].color = this.colors[ i < 4 ? 0 : 1 ];
-
-		}
+		geometry.addAttribute( 'color', new BufferAttribute( colors, 3 ) );
 
-		var material = new MeshBasicMaterial( { vertexColors: FaceColors, wireframe: true } );
-
-		this.lightSphere = new Mesh( geometry, material );
-		this.add( this.lightSphere );
+		this.add( new Mesh( geometry, material ) );
 
 		this.update();
 
@@ -40313,8 +40312,8 @@
 
 	HemisphereLightHelper.prototype.dispose = function () {
 
-		this.lightSphere.geometry.dispose();
-		this.lightSphere.material.dispose();
+		this.children[ 0 ].geometry.dispose();
+		this.children[ 0 ].material.dispose();
 
 	};
 
@@ -40322,13 +40321,29 @@
 
 		var vector = new Vector3();
 
+		var color1 = new Color();
+		var color2 = new Color();
+
 		return function update() {
 
-			this.colors[ 0 ].copy( this.light.color ).multiplyScalar( this.light.intensity );
-			this.colors[ 1 ].copy( this.light.groundColor ).multiplyScalar( this.light.intensity );
+			var mesh = this.children[ 0 ];
+
+			var colors = mesh.geometry.getAttribute( 'color' );
+
+			color1.copy( this.light.color ).multiplyScalar( this.light.intensity );
+			color2.copy( this.light.groundColor ).multiplyScalar( this.light.intensity );
+
+			for ( var i = 0, l = colors.count; i < l; i ++ ) {
+
+				var color = ( i < ( l / 2 ) ) ? color1 : color2;
+
+				colors.setXYZ( i, color.r, color.g, color.b );
+
+			}
+
+			mesh.lookAt( vector.setFromMatrixPosition( this.light.matrixWorld ).negate() );
 
-			this.lightSphere.lookAt( vector.setFromMatrixPosition( this.light.matrixWorld ).negate() );
-			this.lightSphere.geometry.colorsNeedUpdate = true;
+			colors.needsUpdate = true;
 
 		};
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 238 - 238
build/three.min.js


+ 34 - 19
build/three.modules.js

@@ -40071,7 +40071,7 @@ SkeletonHelper.prototype.update = function () {
 
 		matrixWorldInv.getInverse( this.root.matrixWorld );
 
-		for ( var i = 0, j = 0; i < this.bones.length; i ++, j += 2 ) {
+		for ( var i = 0, j = 0; i < this.bones.length; i ++ ) {
 
 			var bone = this.bones[ i ];
 
@@ -40085,6 +40085,8 @@ SkeletonHelper.prototype.update = function () {
 				vector.setFromMatrixPosition( boneMatrix );
 				position.setXYZ( j + 1, vector.x, vector.y, vector.z );
 
+				j += 2;
+
 			}
 
 		}
@@ -40270,9 +40272,10 @@ RectAreaLightHelper.prototype.update = function () {
 /**
  * @author alteredq / http://alteredqualia.com/
  * @author mrdoob / http://mrdoob.com/
+ * @author Mugen87 / https://github.com/Mugen87
  */
 
-function HemisphereLightHelper( light, sphereSize ) {
+function HemisphereLightHelper( light, size ) {
 
 	Object3D.call( this );
 
@@ -40282,21 +40285,17 @@ function HemisphereLightHelper( light, sphereSize ) {
 	this.matrix = light.matrixWorld;
 	this.matrixAutoUpdate = false;
 
-	this.colors = [ new Color(), new Color() ];
+	var geometry = new OctahedronBufferGeometry( size );
+	geometry.rotateY( Math.PI * 0.5 );
 
-	var geometry = new SphereGeometry( sphereSize, 4, 2 );
-	geometry.rotateX( - Math.PI / 2 );
+	var material = new MeshBasicMaterial( { vertexColors: VertexColors, wireframe: true } );
 
-	for ( var i = 0, il = 8; i < il; i ++ ) {
+	var position = geometry.getAttribute( 'position' );
+	var colors = new Float32Array( position.count * 3 );
 
-		geometry.faces[ i ].color = this.colors[ i < 4 ? 0 : 1 ];
-
-	}
+	geometry.addAttribute( 'color', new BufferAttribute( colors, 3 ) );
 
-	var material = new MeshBasicMaterial( { vertexColors: FaceColors, wireframe: true } );
-
-	this.lightSphere = new Mesh( geometry, material );
-	this.add( this.lightSphere );
+	this.add( new Mesh( geometry, material ) );
 
 	this.update();
 
@@ -40307,8 +40306,8 @@ HemisphereLightHelper.prototype.constructor = HemisphereLightHelper;
 
 HemisphereLightHelper.prototype.dispose = function () {
 
-	this.lightSphere.geometry.dispose();
-	this.lightSphere.material.dispose();
+	this.children[ 0 ].geometry.dispose();
+	this.children[ 0 ].material.dispose();
 
 };
 
@@ -40316,13 +40315,29 @@ HemisphereLightHelper.prototype.update = function () {
 
 	var vector = new Vector3();
 
+	var color1 = new Color();
+	var color2 = new Color();
+
 	return function update() {
 
-		this.colors[ 0 ].copy( this.light.color ).multiplyScalar( this.light.intensity );
-		this.colors[ 1 ].copy( this.light.groundColor ).multiplyScalar( this.light.intensity );
+		var mesh = this.children[ 0 ];
+
+		var colors = mesh.geometry.getAttribute( 'color' );
+
+		color1.copy( this.light.color ).multiplyScalar( this.light.intensity );
+		color2.copy( this.light.groundColor ).multiplyScalar( this.light.intensity );
+
+		for ( var i = 0, l = colors.count; i < l; i ++ ) {
+
+			var color = ( i < ( l / 2 ) ) ? color1 : color2;
+
+			colors.setXYZ( i, color.r, color.g, color.b );
+
+		}
+
+		mesh.lookAt( vector.setFromMatrixPosition( this.light.matrixWorld ).negate() );
 
-		this.lightSphere.lookAt( vector.setFromMatrixPosition( this.light.matrixWorld ).negate() );
-		this.lightSphere.geometry.colorsNeedUpdate = true;
+		colors.needsUpdate = true;
 
 	};
 

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است