aentity.js 568 B

123456789101112131415161718192021222324
  1. this.setGizmoMode = function (mode) {
  2. if (this.gizmo) {
  3. this.gizmo.properties.mode = mode
  4. }
  5. }
  6. this.showCloseGizmo = function () {
  7. let gizmoNode =
  8. {
  9. "extends": "http://vwf.example.com/aframe/gizmoComponent.vwf",
  10. "type": "component",
  11. "properties":
  12. {
  13. "mode": "translate"
  14. }
  15. }
  16. if (this.properties.edit) {
  17. this.children.create("gizmo", gizmoNode);
  18. } else {
  19. if (this.gizmo) {
  20. this.children.delete(this.gizmo)
  21. }
  22. }
  23. }