Browse Source

Rotation atribute serialization

Tentone 8 years ago
parent
commit
d078b361a7
2 changed files with 4 additions and 0 deletions
  1. 2 0
      src/loaders/MaterialLoader.js
  2. 2 0
      src/materials/Material.js

+ 2 - 0
src/loaders/MaterialLoader.js

@@ -82,6 +82,8 @@ Object.assign( MaterialLoader.prototype, {
 		if ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap;
 		if ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap;
 		if ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin;
 		if ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin;
 
 
+		if ( json.rotation !== undefined ) material.rotation = json.rotation;
+
 		if ( json.skinning !== undefined ) material.skinning = json.skinning;
 		if ( json.skinning !== undefined ) material.skinning = json.skinning;
 		if ( json.morphTargets !== undefined ) material.morphTargets = json.morphTargets;
 		if ( json.morphTargets !== undefined ) material.morphTargets = json.morphTargets;
 		if ( json.dithering !== undefined ) material.dithering = json.dithering;
 		if ( json.dithering !== undefined ) material.dithering = json.dithering;

+ 2 - 0
src/materials/Material.js

@@ -223,6 +223,8 @@ Object.assign( Material.prototype, EventDispatcher.prototype, {
 		data.depthTest = this.depthTest;
 		data.depthTest = this.depthTest;
 		data.depthWrite = this.depthWrite;
 		data.depthWrite = this.depthWrite;
 
 
+		if ( this.rotation !== 0 ) data.rotation = this.rotation;
+
 		if ( this.dithering === true ) data.dithering = true;
 		if ( this.dithering === true ) data.dithering = true;
 
 
 		if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest;
 		if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest;