three-base 2.0.44 → 2.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  * @Author: xiaosihan
3
3
  * @Date: 2024-02-05 09:31:57
4
4
  * @Last Modified by: xiaosihan
5
- * @Last Modified time: 2024-02-05 09:40:12
5
+ * @Last Modified time: 2024-06-07 22:14:53
6
6
  */
7
7
  import { throttle } from "lodash";
8
8
  import { InstancedBufferAttribute, InstancedMesh, Matrix4, Object3D, Vector3 } from "three";
@@ -2,7 +2,7 @@
2
2
  * @Author: xiaosihan
3
3
  * @Date: 2024-02-05 09:31:57
4
4
  * @Last Modified by: xiaosihan
5
- * @Last Modified time: 2024-02-05 09:40:12
5
+ * @Last Modified time: 2024-06-07 22:14:53
6
6
  */
7
7
 
8
8
  import { throttle } from "lodash";
@@ -169,7 +169,6 @@ export default class InstancedMeshBase extends MeshBase {
169
169
  //初始实例矩阵的数量
170
170
  setCount(count: number = 0) {
171
171
 
172
-
173
172
  const instanceMatrix = new InstancedBufferAttribute(new Float32Array(count * 16), 16);
174
173
  const instanceColor = new InstancedBufferAttribute(new Float32Array(count * 3).fill(1), 3);
175
174
 
package/MeshBase.js CHANGED
@@ -48,9 +48,6 @@ export default class MeshBase extends Group {
48
48
  else {
49
49
  console.error(`${url},不支持的格式`);
50
50
  }
51
- threeUtils.center(modal);
52
- threeUtils.alignBottom(modal);
53
- modal.updateMatrixWorld(true);
54
51
  MeshBase.models.set(url, modal);
55
52
  MeshBase.loadModeling.set(url, false);
56
53
  }
@@ -79,9 +76,9 @@ export default class MeshBase extends Group {
79
76
  }
80
77
  }
81
78
  await new Promise(resolve => requestAnimationFrame(resolve));
79
+ this.loaded = true;
82
80
  // 加载完成事件
83
81
  this.dispatchEvent({ type: "loaded" });
84
- this.loaded = true;
85
82
  }
86
83
  // 超出绘制区域时不绘制
87
84
  frustumCulled = false;
package/MeshBase.ts CHANGED
@@ -60,10 +60,6 @@ export default class MeshBase extends Group {
60
60
  console.error(`${url},不支持的格式`);
61
61
  }
62
62
 
63
- threeUtils.center(modal);
64
- threeUtils.alignBottom(modal);
65
- modal.updateMatrixWorld(true);
66
-
67
63
  MeshBase.models.set(url, modal);
68
64
  MeshBase.loadModeling.set(url, false);
69
65
  }
@@ -100,10 +96,10 @@ export default class MeshBase extends Group {
100
96
 
101
97
  await new Promise(resolve => requestAnimationFrame(resolve));
102
98
 
99
+ this.loaded = true;
100
+
103
101
  // 加载完成事件
104
102
  this.dispatchEvent({ type: "loaded" } as never);
105
-
106
- this.loaded = true;
107
103
  }
108
104
 
109
105
  // 超出绘制区域时不绘制
package/README.md CHANGED
@@ -4,8 +4,6 @@ import { AmbientLight, BoxGeometry, Mesh, MeshLambertMaterial, PointLight } from
4
4
  import ThreeBase from "three-base";
5
5
  import Transition from "three-base/Transition";
6
6
 
7
- // 仅支持vite编译的项目安装
8
- // 做项目找我 qq:389652405
9
7
  class HomeRender extends ThreeBase {
10
8
 
11
9
  constructor() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-base",
3
- "version": "2.0.44",
3
+ "version": "2.0.45",
4
4
  "description": "three 3d three-base",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"