@vived/app 4.11.3 → 4.12.0
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.
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AppObject, AppObjectController } from "../../../AppObject";
|
|
2
|
-
import { MouseController, MouseInputEvent } from "../../MouseInput";
|
|
2
|
+
import { MouseController, MouseInputEvent, MouseWheelEvent } from "../../MouseInput";
|
|
3
3
|
export default abstract class EmulateZSpaceStylus extends AppObjectController implements MouseController {
|
|
4
4
|
static readonly type = "EmulateZSpaceStylus";
|
|
5
5
|
abstract onDown: (e: MouseInputEvent) => void;
|
|
6
6
|
abstract onMove: (e: MouseInputEvent) => void;
|
|
7
7
|
abstract onUp: (e: MouseInputEvent) => void;
|
|
8
|
+
abstract onWheel: (e: MouseWheelEvent) => void;
|
|
8
9
|
}
|
|
9
10
|
export declare function makeEmulateZSpaceStylus(appObject: AppObject): EmulateZSpaceStylus;
|
|
@@ -47,6 +47,19 @@ class EmulateZSpaceStylusImp extends EmulateZSpaceStylus {
|
|
|
47
47
|
return;
|
|
48
48
|
this.stylus.updateButtonState(e.button, false);
|
|
49
49
|
};
|
|
50
|
+
this.onWheel = (e) => {
|
|
51
|
+
if (!this.emulationIsActive)
|
|
52
|
+
return;
|
|
53
|
+
if (!this.stylus)
|
|
54
|
+
return;
|
|
55
|
+
if (!this.stylusTransform)
|
|
56
|
+
return;
|
|
57
|
+
const bumpAmount = 0.01;
|
|
58
|
+
const bump = e.event.deltaY > 0 ? -bumpAmount : bumpAmount;
|
|
59
|
+
const newPos = this.stylusTransform.localPointToWorld(new ValueObjects_1.Vector3(0, 0, bump));
|
|
60
|
+
this.stylusTransform.worldPosition = newPos;
|
|
61
|
+
console.log(newPos);
|
|
62
|
+
};
|
|
50
63
|
this.onZpsaceEnabledChange = (enabled) => {
|
|
51
64
|
this.emulationIsActive = false;
|
|
52
65
|
if (!enabled)
|