lythreeframe 1.2.58 → 1.2.60
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/dist/bundle.cjs.js
CHANGED
|
@@ -2412,7 +2412,7 @@ class Controller {
|
|
|
2412
2412
|
getHitResultFromScreenPoint(x, y) {
|
|
2413
2413
|
this._raycastVec2.set(x, y);
|
|
2414
2414
|
this.raycaster.setFromCamera(this._raycastVec2, this.camera);
|
|
2415
|
-
const out = this.
|
|
2415
|
+
const out = this.getAllHitResultFromScreenPoint(x, y);
|
|
2416
2416
|
for (const hit of out) {
|
|
2417
2417
|
if (hit.object.userData["rayIgnored"])
|
|
2418
2418
|
continue;
|
|
@@ -2425,6 +2425,11 @@ class Controller {
|
|
|
2425
2425
|
}
|
|
2426
2426
|
return null;
|
|
2427
2427
|
}
|
|
2428
|
+
getAllHitResultFromScreenPoint(x, y) {
|
|
2429
|
+
this._raycastVec2.set(x, y);
|
|
2430
|
+
this.raycaster.setFromCamera(this._raycastVec2, this.camera);
|
|
2431
|
+
return this.raycaster.intersectObjects(this.world.scene.children, true);
|
|
2432
|
+
}
|
|
2428
2433
|
focusTo(targetPos, targetQuat, distance, time, onGoing = null, onFinished = null) {
|
|
2429
2434
|
this.pawn.focusTo(targetPos, targetQuat, distance, time, onGoing, onFinished);
|
|
2430
2435
|
}
|
package/dist/bundle.esm.js
CHANGED
|
@@ -2410,7 +2410,7 @@ class Controller {
|
|
|
2410
2410
|
getHitResultFromScreenPoint(x, y) {
|
|
2411
2411
|
this._raycastVec2.set(x, y);
|
|
2412
2412
|
this.raycaster.setFromCamera(this._raycastVec2, this.camera);
|
|
2413
|
-
const out = this.
|
|
2413
|
+
const out = this.getAllHitResultFromScreenPoint(x, y);
|
|
2414
2414
|
for (const hit of out) {
|
|
2415
2415
|
if (hit.object.userData["rayIgnored"])
|
|
2416
2416
|
continue;
|
|
@@ -2423,6 +2423,11 @@ class Controller {
|
|
|
2423
2423
|
}
|
|
2424
2424
|
return null;
|
|
2425
2425
|
}
|
|
2426
|
+
getAllHitResultFromScreenPoint(x, y) {
|
|
2427
|
+
this._raycastVec2.set(x, y);
|
|
2428
|
+
this.raycaster.setFromCamera(this._raycastVec2, this.camera);
|
|
2429
|
+
return this.raycaster.intersectObjects(this.world.scene.children, true);
|
|
2430
|
+
}
|
|
2426
2431
|
focusTo(targetPos, targetQuat, distance, time, onGoing = null, onFinished = null) {
|
|
2427
2432
|
this.pawn.focusTo(targetPos, targetQuat, distance, time, onGoing, onFinished);
|
|
2428
2433
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ThreeJsApp } from "../ThreeJsApp";
|
|
2
|
-
import { Euler, Intersection, OrthographicCamera, PerspectiveCamera, Quaternion, Vector3 } from "three/webgpu";
|
|
2
|
+
import { Euler, Intersection, OrthographicCamera, PerspectiveCamera, Quaternion, Raycaster, Vector2, Vector3 } from "three/webgpu";
|
|
3
3
|
import { World } from "./World";
|
|
4
4
|
import { Viewport } from "./Viewport";
|
|
5
5
|
import { Pawn } from "../Object/PawnV2/Pawn";
|
|
@@ -36,29 +36,33 @@ export interface ComponentPointerDownEvent {
|
|
|
36
36
|
export declare class Controller {
|
|
37
37
|
protected _app: ThreeJsApp;
|
|
38
38
|
protected _pawn: Pawn | null;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
39
|
+
protected raycaster: Raycaster;
|
|
40
|
+
protected prepareClickComponent: SceneComponent | null;
|
|
41
|
+
protected prepareClickHit: Intersection | null;
|
|
42
|
+
protected prepareClickModifiers: {
|
|
43
|
+
ctrlKey: boolean;
|
|
44
|
+
shiftKey: boolean;
|
|
45
|
+
altKey: boolean;
|
|
46
|
+
};
|
|
47
|
+
protected hoveringComponent: SceneComponent | null;
|
|
48
|
+
protected _pointButtonIsDown: Set<number>;
|
|
49
|
+
protected _onClickNothingDelegate: Delegate<[void]>;
|
|
50
|
+
protected _onComponentClickDelegate: Delegate<[ComponentInteractionEvent]>;
|
|
51
|
+
protected _onComponentDoubleClickDelegate: Delegate<[ComponentInteractionEvent]>;
|
|
52
|
+
protected _onComponentHoverBeginDelegate: Delegate<[ComponentHoverEvent]>;
|
|
53
|
+
protected _onComponentHoverEndDelegate: Delegate<[ComponentHoverEvent]>;
|
|
54
|
+
protected _onComponentPointerDownDelegate: Delegate<[ComponentPointerDownEvent]>;
|
|
55
|
+
protected pointerPosition: Vector2;
|
|
56
|
+
protected pointerLeftDownPosition: Vector2;
|
|
57
|
+
protected readonly _tempVec2: Vector2;
|
|
58
|
+
protected readonly _raycastVec2: Vector2;
|
|
59
|
+
protected readonly doubleClickDelay: number;
|
|
60
|
+
protected leftClickTimer: number | null;
|
|
61
|
+
protected onPointerMove: (event: MouseEvent) => void;
|
|
62
|
+
protected onPointerEnter: (event: MouseEvent) => void;
|
|
63
|
+
protected onPointerLeave: (event: MouseEvent) => void;
|
|
64
|
+
protected onPointerUp: (event: MouseEvent) => void;
|
|
65
|
+
protected onPointerDown: (event: MouseEvent) => void;
|
|
62
66
|
get camera(): PerspectiveCamera | OrthographicCamera;
|
|
63
67
|
get world(): World;
|
|
64
68
|
get viewPort(): Viewport;
|
|
@@ -75,7 +79,7 @@ export declare class Controller {
|
|
|
75
79
|
updateCamera(): void;
|
|
76
80
|
tick(deltaTime: number): void;
|
|
77
81
|
destroy(): void;
|
|
78
|
-
onPointerMoveEvent(event: MouseEvent): void;
|
|
82
|
+
protected onPointerMoveEvent(event: MouseEvent): void;
|
|
79
83
|
protected clearHoveringComponent(): void;
|
|
80
84
|
protected fireHoverEvent(component: SceneComponent, hit: Intersection | null, isBegin: boolean): void;
|
|
81
85
|
protected onPointerUpEvent(event: MouseEvent): void;
|
|
@@ -95,5 +99,6 @@ export declare class Controller {
|
|
|
95
99
|
protected removeCorePointerListeners(): void;
|
|
96
100
|
getHitResultUnderCursor(): Intersection | null;
|
|
97
101
|
getHitResultFromScreenPoint(x: number, y: number): Intersection | null;
|
|
102
|
+
getAllHitResultFromScreenPoint(x: number, y: number): Intersection[];
|
|
98
103
|
focusTo(targetPos: Vector3, targetQuat: Quaternion | Euler, distance: number, time: number, onGoing?: (() => void) | null, onFinished?: (() => void) | null): void;
|
|
99
104
|
}
|