Selaa lähdekoodia

Object3D.toJSON: Handle castShadow and receiveShadow.

Mr.doob 9 vuotta sitten
vanhempi
commit
e996d3ce2d
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      src/core/Object3D.js

+ 3 - 1
src/core/Object3D.js

@@ -629,7 +629,9 @@ THREE.Object3D.prototype = {
 
 
 		if ( this.name !== '' ) object.name = this.name;
 		if ( this.name !== '' ) object.name = this.name;
 		if ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData;
 		if ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData;
-		if ( this.visible !== true ) object.visible = this.visible;
+		if ( this.castShadow === true ) object.castShadow = true;
+		if ( this.receiveShadow === true ) object.receiveShadow = true;
+		if ( this.visible === false ) object.visible = false;
 
 
 		object.matrix = this.matrix.toArray();
 		object.matrix = this.matrix.toArray();