Vector3Node.js 716 B

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