Object3D.js 917 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * @author mr.doob / http://mrdoob.com/
  3. */
  4. THREE.Object3D = function ( material ) {
  5. this.position = new THREE.Vector3();
  6. this.rotation = new THREE.Vector3();
  7. this.scale = new THREE.Vector3( 1, 1, 1 );
  8. this.matrix = new THREE.Matrix4();
  9. this.screen = new THREE.Vector3();
  10. this.material = material instanceof Array ? material : [ material ];
  11. this.autoUpdateMatrix = true;
  12. this.updateMatrix = function () {
  13. this.matrix.identity();
  14. this.matrix.multiplySelf( THREE.Matrix4.translationMatrix( this.position.x, this.position.y, this.position.z ) );
  15. this.matrix.multiplySelf( THREE.Matrix4.rotationXMatrix( this.rotation.x ) );
  16. this.matrix.multiplySelf( THREE.Matrix4.rotationYMatrix( this.rotation.y ) );
  17. this.matrix.multiplySelf( THREE.Matrix4.rotationZMatrix( this.rotation.z ) );
  18. this.matrix.multiplySelf( THREE.Matrix4.scaleMatrix( this.scale.x, this.scale.y, this.scale.z ) );
  19. };
  20. };
粤ICP备19079148号