CameraPOV.ts 975 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. module INSPECTOR {
  2. export interface ICameraPOV {
  3. setPOV: () => void
  4. }
  5. /**
  6. *
  7. */
  8. export class CameraPOV extends AbstractTreeTool {
  9. private cameraPOV: ICameraPOV;
  10. constructor(camera: ICameraPOV) {
  11. super();
  12. this.cameraPOV = camera;
  13. this._elem.classList.add('fa-video-camera');
  14. }
  15. protected action() {
  16. super.action();
  17. this._gotoPOV();
  18. }
  19. private _gotoPOV() {
  20. let actives = Inspector.DOCUMENT.querySelectorAll(".fa-video-camera.active");
  21. console.log(actives);
  22. for (let i = 0; i < actives.length; i++) {
  23. actives[i].classList.remove('active');
  24. }
  25. //if (this._on) {
  26. // set icon camera
  27. this._elem.classList.add('active');
  28. //}
  29. this.cameraPOV.setPOV();
  30. }
  31. }
  32. }