浏览代码

Merge pull request #21211 from Mugen87/dev43

Examples: Fix toJSON() methods for certain node classes.
Mr.doob 4 年之前
父节点
当前提交
d001b22cf7

+ 4 - 10
examples/jsm/nodes/utils/TimerNode.js

@@ -77,18 +77,12 @@ TimerNode.prototype.copy = function ( source ) {
 
 TimerNode.prototype.toJSON = function ( meta ) {
 
-	var data = this.getJSONNode( meta );
+	var data = FloatNode.prototype.toJSON.call( this, meta );
 
-	if ( ! data ) {
+	data.scope = this.scope;
+	data.scale = this.scale;
 
-		data = this.createJSONNode( meta );
-
-		data.scope = this.scope;
-		data.scale = this.scale;
-
-		data.timeScale = this.timeScale;
-
-	}
+	data.timeScale = this.timeScale;
 
 	return data;
 

+ 4 - 10
examples/jsm/nodes/utils/VelocityNode.js

@@ -154,18 +154,12 @@ VelocityNode.prototype.copy = function ( source ) {
 
 VelocityNode.prototype.toJSON = function ( meta ) {
 
-	var data = this.getJSONNode( meta );
+	var data = Vector3Node.prototype.toJSON.call( this, meta );
 
-	if ( ! data ) {
+	if ( this.target ) data.target = this.target.uuid;
 
-		data = this.createJSONNode( meta );
-
-		if ( this.target ) data.target = this.target.uuid;
-
-		// clone params
-		data.params = JSON.parse( JSON.stringify( this.params ) );
-
-	}
+	// clone params
+	data.params = JSON.parse( JSON.stringify( this.params ) );
 
 	return data;
 

文件差异内容过多而无法显示
+ 0 - 0
examples/nodes/caustic.json


文件差异内容过多而无法显示
+ 0 - 0
examples/nodes/displace.json


文件差异内容过多而无法显示
+ 0 - 0
examples/nodes/wave.json


部分文件因为文件数量过多而无法显示