| 1234567891011121314151617181920212223242526272829 |
- import * as THREE from 'three';
- class fmFan {
- model;
- modelName = 'jbfj-fm';
- group: THREE.Object3D | null = null;
- constructor(model) {
- this.model = model;
- }
- mountedThree() {
-
- return new Promise((resolve) => {
- this.model.setGLTFModel([this.modelName]).then((gltf) => {
- this.group = gltf[0];
- if (this.group) this.group.name = this.modelName;
- this.group?.position.set(-0.668, -0.037, -0.023);
- resolve(null);
- });
- });
- }
- destroy() {
- this.model.clearGroup(this.group);
- this.model = null;
- this.group = null;
- }
- }
- export default fmFan;
|