three-base 1.0.52 → 1.0.53

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.
package/lib/ThreeBase.ts CHANGED
@@ -15,7 +15,6 @@ import threeLoader from "./threeLoader";
15
15
  import ThreeMouse from "./ThreeMouse";
16
16
  import threeUtils from "./threeUtils";
17
17
  import Transition from "./Transition";
18
- import Canvas2image from "canvas-to-png";
19
18
 
20
19
  // three.js 的基础对象
21
20
  export default class ThreeBase extends EventDispatcher {
package/lib/threeUtils.ts CHANGED
@@ -159,15 +159,11 @@ class ThreeUtils extends EventDispatcher {
159
159
 
160
160
  //缩放至指定大小
161
161
  scaleTo(object3d: Object3D | BufferGeometry, size: number = 1) {
162
+ const originSize = this.getSize(object3d);
163
+ const scale = size / Math.max(originSize.x, originSize.y, originSize.z);
162
164
  if (object3d instanceof Object3D) {
163
- this.box3.setFromObject(object3d);
164
- this.box3.getSize(this.size);
165
- const scale = size / Math.max(this.size.x, this.size.y, this.size.z);
166
165
  object3d.scale.multiplyScalar(scale);
167
- object3d.updateMatrixWorld(true);
168
166
  } else if (object3d instanceof BufferGeometry) {
169
- const originSize = this.getSize(object3d);
170
- const scale = size / Math.max(originSize.x, originSize.y, originSize.z);
171
167
  object3d.scale(scale, scale, scale);
172
168
  }
173
169
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-base",
3
- "version": "1.0.52",
3
+ "version": "1.0.53",
4
4
  "description": "three 3d three-base",
5
5
  "repository": {
6
6
  "type": "git",