fcfanLocal.three.ts 637 B

1234567891011121314151617181920212223242526272829303132
  1. import * as THREE from 'three';
  2. class fcFan {
  3. model;
  4. modelName = 'jbfj-fc';
  5. group: THREE.Object3D | null = null;
  6. constructor(model) {
  7. this.model = model;
  8. }
  9. mountedThree() {
  10. return new Promise((resolve) => {
  11. this.model.setGLTFModel([this.modelName]).then((gltf) => {
  12. this.group = gltf[0];
  13. if (this.group) {
  14. this.group.name = this.modelName;
  15. this.group.position.set(-0.056, -0.007, 3.494);
  16. }
  17. resolve(null);
  18. });
  19. });
  20. }
  21. destroy() {
  22. this.model.clearGroup(this.group);
  23. this.model = null;
  24. this.group = null;
  25. }
  26. }
  27. export default fcFan;