Object3D.js 702 B

1234567891011121314151617181920212223242526
  1. var Object3D = Class.extend
  2. ({
  3. position: null,
  4. rotation: null,
  5. scale: null,
  6. matrix: null,
  7. screen: null,
  8. init: function()
  9. {
  10. this.position = new Vector3(0, 0, 0);
  11. this.rotation = new Vector3(0, 0, 0);
  12. this.scale = new Vector3(1, 1, 1);
  13. this.matrix = new Matrix4();
  14. this.screen = new Vector3(0, 0, 0);
  15. },
  16. updateMatrix: function()
  17. {
  18. this.matrix.identity();
  19. this.matrix.multiplySelf( Matrix4.translationMatrix( this.position.x, this.position.y, this.position.z) );
  20. this.matrix.multiplySelf( Matrix4.rotationMatrix( this.rotation.x, this.rotation.y, this.rotation.z ) );
  21. this.matrix.multiplySelf( Matrix4.scaleMatrix( this.scale.x, this.scale.y, this.scale.z ) ); }
  22. });