lythreeframe 1.2.10 → 1.2.11

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.
@@ -3263,17 +3263,8 @@ class TransformGizmo extends Pawn {
3263
3263
  let q1 = new webgpu.Quaternion();
3264
3264
  let s1 = new webgpu.Vector3();
3265
3265
  TA2.decompose(p1, q1, s1);
3266
- let mode = this.getMode();
3267
- if (mode === "translate") {
3268
- this.primaryTarget.onTranslating(p1);
3269
- }
3270
- else if (mode === "rotate") {
3271
- this.primaryTarget.onRotating(q1);
3272
- }
3273
- else if (mode === "scale") {
3274
- this.primaryTarget.onScaling(s1);
3275
- }
3276
- // this.primaryTarget.onTransforming(TA2);
3266
+ this.getMode();
3267
+ this.primaryTarget.onTransforming(TA2);
3277
3268
  // const TA1Inverse = TA1.clone().invert();
3278
3269
  //const transformMatrix = new Matrix4().multiplyMatrices(TA2, TA1Inverse);
3279
3270
  this.targets.forEach((tar) => {
@@ -3285,16 +3276,7 @@ class TransformGizmo extends Pawn {
3285
3276
  let s2 = new webgpu.Vector3();
3286
3277
  let TB2 = new webgpu.Matrix4().multiplyMatrices(TA2, t); // B
3287
3278
  TB2.decompose(p2, q2, s2);
3288
- if (mode === "translate") {
3289
- tar.onTranslating(p2);
3290
- }
3291
- else if (mode === "rotate") {
3292
- tar.onRotating(q2);
3293
- }
3294
- else if (mode === "scale") {
3295
- tar.onScaling(s2);
3296
- }
3297
- // tar.onTransforming(TB2);
3279
+ tar.onTransforming(TB2);
3298
3280
  }
3299
3281
  }
3300
3282
  });
@@ -3261,17 +3261,8 @@ class TransformGizmo extends Pawn {
3261
3261
  let q1 = new Quaternion();
3262
3262
  let s1 = new Vector3();
3263
3263
  TA2.decompose(p1, q1, s1);
3264
- let mode = this.getMode();
3265
- if (mode === "translate") {
3266
- this.primaryTarget.onTranslating(p1);
3267
- }
3268
- else if (mode === "rotate") {
3269
- this.primaryTarget.onRotating(q1);
3270
- }
3271
- else if (mode === "scale") {
3272
- this.primaryTarget.onScaling(s1);
3273
- }
3274
- // this.primaryTarget.onTransforming(TA2);
3264
+ this.getMode();
3265
+ this.primaryTarget.onTransforming(TA2);
3275
3266
  // const TA1Inverse = TA1.clone().invert();
3276
3267
  //const transformMatrix = new Matrix4().multiplyMatrices(TA2, TA1Inverse);
3277
3268
  this.targets.forEach((tar) => {
@@ -3283,16 +3274,7 @@ class TransformGizmo extends Pawn {
3283
3274
  let s2 = new Vector3();
3284
3275
  let TB2 = new Matrix4().multiplyMatrices(TA2, t); // B
3285
3276
  TB2.decompose(p2, q2, s2);
3286
- if (mode === "translate") {
3287
- tar.onTranslating(p2);
3288
- }
3289
- else if (mode === "rotate") {
3290
- tar.onRotating(q2);
3291
- }
3292
- else if (mode === "scale") {
3293
- tar.onScaling(s2);
3294
- }
3295
- // tar.onTransforming(TB2);
3277
+ tar.onTransforming(TB2);
3296
3278
  }
3297
3279
  }
3298
3280
  });
@@ -1,5 +1,5 @@
1
1
  import { Pawn } from "./Pawn";
2
- import { Matrix4, Quaternion, Vector3 } from "three/webgpu";
2
+ import { Matrix4 } from "three/webgpu";
3
3
  import { TransformControls } from "three/examples/jsm/controls/TransformControls.js";
4
4
  import { Controller } from "../../Frame/Controller";
5
5
  export interface TransformType {
@@ -10,9 +10,6 @@ export interface TransformType {
10
10
  export interface ITransforming {
11
11
  isTransformAllowed(): boolean;
12
12
  onTransforming(worldMatrix: Matrix4): void;
13
- onTranslating(worldPos: Vector3): void;
14
- onRotating(worldQuat: Quaternion): void;
15
- onScaling(worldScale: Vector3): void;
16
13
  getMatrixInWorld(): Matrix4;
17
14
  getAllowedTransformType(): TransformType;
18
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lythreeframe",
3
- "version": "1.2.10",
3
+ "version": "1.2.11",
4
4
  "description": "Three.js 封装",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.esm.js",