Преглед на файлове

Examples: Fix toJSON() methods for certain node classes.

Mugen87 преди 4 години
родител
ревизия
60306cf826
променени са 5 файла, в които са добавени 8 реда и са изтрити 20 реда
  1. 4 10
      examples/jsm/nodes/utils/TimerNode.js
  2. 4 10
      examples/jsm/nodes/utils/VelocityNode.js
  3. 0 0
      examples/nodes/caustic.json
  4. 0 0
      examples/nodes/displace.json
  5. 0 0
      examples/nodes/wave.json

+ 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


Някои файлове не бяха показани, защото твърде много файлове са промени