ActivateCameraTool.js 817 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * ActivateCameraTool.js
  3. *
  4. * @author realor
  5. */
  6. import { Tool } from './Tool.js'
  7. import { I18N } from '../i18n/I18N.js'
  8. import * as THREE from '../lib/three.module.js'
  9. class ActivateCameraTool extends Tool {
  10. constructor(application, options) {
  11. super(application)
  12. this.name = 'activate_camera'
  13. this.label = 'tool.activate_camera.label'
  14. this.help = 'tool.activate_camera.help'
  15. this.className = 'activate_camera'
  16. this.immediate = true
  17. this.setOptions(options)
  18. }
  19. execute() {
  20. const application = this.application
  21. const object = application.selection.object
  22. if (object instanceof THREE.Camera) {
  23. application.activateCamera(object)
  24. }
  25. }
  26. }
  27. export { ActivateCameraTool }