瀏覽代碼

Updated builds

Mr.doob 4 年之前
父節點
當前提交
0d65d318f1
共有 3 個文件被更改,包括 14 次插入10 次删除
  1. 7 5
      build/three.js
  2. 0 0
      build/three.min.js
  3. 7 5
      build/three.module.js

+ 7 - 5
build/three.js

@@ -6076,6 +6076,9 @@
 	Material.prototype = Object.assign(Object.create(EventDispatcher.prototype), {
 		constructor: Material,
 		isMaterial: true,
+		onBuild: function ()
+		/* shaderobject, renderer */
+		{},
 		onBeforeCompile: function ()
 		/* shaderobject, renderer */
 		{},
@@ -18059,6 +18062,7 @@
 				}
 			} else {
 				parameters.uniforms = programCache.getUniforms(material);
+				material.onBuild(parameters, _this);
 				material.onBeforeCompile(parameters, _this);
 				program = programCache.acquireProgram(parameters, programCacheKey);
 				programs.set(programCacheKey, program);
@@ -25675,9 +25679,7 @@
 		} // Get list of cumulative segment lengths
 
 
-		getLengths(divisions) {
-			if (divisions === undefined) divisions = this.arcLengthDivisions;
-
+		getLengths(divisions = this.arcLengthDivisions) {
 			if (this.cacheArcLengths && this.cacheArcLengths.length === divisions + 1 && !this.needsUpdate) {
 				return this.cacheArcLengths;
 			}
@@ -29387,8 +29389,8 @@
 	}
 
 	class Clock {
-		constructor(autoStart) {
-			this.autoStart = autoStart !== undefined ? autoStart : true;
+		constructor(autoStart = true) {
+			this.autoStart = autoStart;
 			this.startTime = 0;
 			this.oldTime = 0;
 			this.elapsedTime = 0;

File diff suppressed because it is too large
+ 0 - 0
build/three.min.js


+ 7 - 5
build/three.module.js

@@ -7997,6 +7997,8 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 
 	isMaterial: true,
 
+	onBuild: function ( /* shaderobject, renderer */ ) {},
+
 	onBeforeCompile: function ( /* shaderobject, renderer */ ) {},
 
 	customProgramCacheKey: function () {
@@ -24585,6 +24587,8 @@ function WebGLRenderer( parameters ) {
 
 			parameters.uniforms = programCache.getUniforms( material );
 
+			material.onBuild( parameters, _this );
+
 			material.onBeforeCompile( parameters, _this );
 
 			program = programCache.acquireProgram( parameters, programCacheKey );
@@ -35353,9 +35357,7 @@ class Curve {
 
 	// Get list of cumulative segment lengths
 
-	getLengths( divisions ) {
-
-		if ( divisions === undefined ) divisions = this.arcLengthDivisions;
+	getLengths( divisions = this.arcLengthDivisions ) {
 
 		if ( this.cacheArcLengths &&
 			( this.cacheArcLengths.length === divisions + 1 ) &&
@@ -40762,9 +40764,9 @@ class StereoCamera {
 
 class Clock {
 
-	constructor( autoStart ) {
+	constructor( autoStart = true ) {
 
-		this.autoStart = ( autoStart !== undefined ) ? autoStart : true;
+		this.autoStart = autoStart;
 
 		this.startTime = 0;
 		this.oldTime = 0;

Some files were not shown because too many files changed in this diff