Vector4Node.js 727 B

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * @author sunag / http://www.sunag.com.br/
  3. */
  4. THREE.Vector4Node = function ( x, y, z, w ) {
  5. THREE.InputNode.call( this, 'v4' );
  6. this.value = new THREE.Vector4( x, y, z, w );
  7. };
  8. THREE.Vector4Node.prototype = Object.create( THREE.InputNode.prototype );
  9. THREE.Vector4Node.prototype.constructor = THREE.Vector4Node;
  10. THREE.Vector4Node.prototype.nodeType = "Vector4";
  11. THREE.NodeMaterial.addShortcuts( THREE.Vector4Node.prototype, 'value', [ 'x', 'y', 'z', 'w' ] );
  12. THREE.Vector4Node.prototype.toJSON = function ( meta ) {
  13. var data = this.getJSONNode( meta );
  14. if ( ! data ) {
  15. data = this.createJSONNode( meta );
  16. data.x = this.x;
  17. data.y = this.y;
  18. data.z = this.z;
  19. data.w = this.w;
  20. }
  21. return data;
  22. };