123456789101112131415161718192021222324252627282930313233 |
- import * as THREE from 'three';
- class fcFan {
- model;
- modelName = 'jbfj-fc';
- group: THREE.Object3D | null = null;
- constructor(model) {
- this.model = model;
- }
- mountedThree() {
- if (!this.model) return;
- 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.056, -0.007, 3.494);
- }
- resolve(null);
- });
- });
- }
- destroy() {
- this.model.clearGroup(this.group);
- this.model = null;
- this.group = null;
- }
- }
- export default fcFan;
|