@soonspacejs/plugin-navigation 2.13.5 → 2.13.7

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,68 +0,0 @@
1
- import { Object3D, Vector3 } from 'three';
2
- import SoonSpace from 'soonspacejs';
3
- import { Topology } from 'soonspacejs';
4
- import { PLAY_STATUS, playInfo } from './types';
5
- export * from './navigator-nodes';
6
- export * from './types';
7
- export * from './utils';
8
- export declare class Navigator {
9
- readonly ssp: SoonSpace;
10
- paths: Topology[];
11
- onPlay: (info: playInfo) => void;
12
- onStatusChange: (status: PLAY_STATUS) => void;
13
- /** 是否循环播放,默认为否 */
14
- loop: boolean;
15
- /** 是否自动开始下一段路径播放,默认为是 */
16
- autoNext: boolean;
17
- /** 开始或者重新开始后自动播放路径动画,默认为否 */
18
- playAfterStart: boolean;
19
- /** 开始时飞向模型,默认为是 */
20
- flyToModelAfterStart: boolean;
21
- /** 停止时是否返回起点,默认为是 */
22
- backStartPointWhenStop: boolean;
23
- /** 路径动画主体模型 */
24
- _model: Object3D<import("three").Object3DEventMap>;
25
- get model(): Object3D;
26
- set model(obj: Object3D);
27
- protected _speed: number;
28
- /** 播放速度 */
29
- get speed(): number;
30
- set speed(value: number);
31
- protected _pathProgress: number;
32
- /** 当前段进度 */
33
- get pathProgress(): number;
34
- set pathProgress(value: number);
35
- protected _totalProgress: number;
36
- /** 总进度 */
37
- get totalProgress(): number;
38
- set totalProgress(value: number);
39
- /** 当前播放的动画路径索引 */
40
- protected _currentPathIndex: number;
41
- /** 当前节点 */
42
- protected _currentNode: Vector3 | null;
43
- /** 下个路径节点 */
44
- protected _nextNode: Vector3 | null;
45
- /** 当前状态 */
46
- protected _playStatus: PLAY_STATUS;
47
- get currentPath(): Topology;
48
- /** 对外只读 当前路径索引 */
49
- get currentPathIndex(): number;
50
- /** 对外只读 当前朝向方向向量 */
51
- get currentRotationVector(): Vector3;
52
- constructor(ssp: SoonSpace, paths: Topology[]);
53
- protected changeStatus(status: PLAY_STATUS): void;
54
- /** 开始导航 */
55
- start(): void;
56
- /** 重新开始导航 */
57
- restart(): void;
58
- /** 播放动画 */
59
- play(index?: number, node?: Vector3): void;
60
- /** 暂停动画 */
61
- pause(): void;
62
- /** 停止动画 */
63
- stop(): void;
64
- /** 路径反转 */
65
- flip(): void;
66
- /** 结束导航 */
67
- over(): void;
68
- }
@@ -1,26 +0,0 @@
1
- import type { Node, Topology } from 'soonspacejs';
2
- import { Direction } from './types';
3
- interface NavigatorNodeInfo {
4
- progressArea: [number, number];
5
- distanceArea: [number, number];
6
- node: Node;
7
- nextNode?: Node;
8
- distanceToNext: number;
9
- distanceToStart: number;
10
- distanceToEnd: number;
11
- frontDirection: Direction;
12
- }
13
- interface DistanceInfo {
14
- distanceToStartNode: number;
15
- distanceToEndNode: number;
16
- distanceToStart: number;
17
- distanceToEnd: number;
18
- }
19
- export declare function getDirectionByNodes(p1: Node, p2?: Node, p3?: Node): Direction;
20
- /** 分析并返回所有节点信息 */
21
- export declare function getNavigatorNodeInfosByTopology(topology: Topology): NavigatorNodeInfo[];
22
- /** 根据进度获取当前节点信息 */
23
- export declare function getNavigatorNodeInfoByProgress(progress: number, infos: NavigatorNodeInfo[]): NavigatorNodeInfo | undefined;
24
- /** 获取当前位置距离信息 */
25
- export declare function getDistanceInfoByProgress(progress: number, info?: NavigatorNodeInfo): DistanceInfo;
26
- export {};
@@ -1,23 +0,0 @@
1
- import { Vector3 } from 'three';
2
- export type Direction = 'left' | 'right' | 'up' | 'down' | 'left-up' | 'left-down' | 'right-up' | 'right-down' | 'straight';
3
- export interface playInfo {
4
- pathId: string;
5
- progress: number;
6
- pathProgress: number;
7
- distanceToNodeStart: number;
8
- distanceToPathStart: number;
9
- distanceToStart: number;
10
- distanceToNodeEnd: number;
11
- distanceToPathEnd: number;
12
- distanceToEnd: number;
13
- position: Vector3;
14
- rotation: Vector3;
15
- direction: Direction;
16
- }
17
- export declare enum PLAY_STATUS {
18
- 'PENDING' = "pending",
19
- 'STOP' = "stop",
20
- 'PLAYING' = "playing",
21
- 'PAUSE' = "pause",
22
- 'FINISHED' = "finished"
23
- }
@@ -1,12 +0,0 @@
1
- import SoonSpace from 'soonspacejs';
2
- import { Topology } from 'soonspacejs';
3
- import { Vector3 } from 'three';
4
- import { Direction } from './types';
5
- export declare function getDirection(target: Vector3, front: Vector3): Direction;
6
- /**
7
- * 路径反转
8
- * @param ssp
9
- * @param topologies 路径数组
10
- * @returns
11
- */
12
- export declare function reverseTopologies(ssp: SoonSpace, topologies: Topology[]): Topology[];
@@ -1,26 +0,0 @@
1
- export declare class GyroListener {
2
- gyroEvent: null | ((event: DeviceOrientationEvent) => void);
3
- onChange: (alpha: number | null, beta: number | null, gamma: number | null) => void;
4
- _isActive: boolean;
5
- defaultBeta: number | null;
6
- defaultAlpha: number | null;
7
- defaultGamma: number | null;
8
- cache: null | {
9
- beta: number | null;
10
- alpha: number | null;
11
- gamma: number | null;
12
- };
13
- beta: number | null;
14
- alpha: number | null;
15
- gamma: number | null;
16
- gyroX: boolean;
17
- gyroY: boolean;
18
- gyroZ: boolean;
19
- absolute: boolean;
20
- constructor(x?: boolean, y?: boolean, z?: boolean, absolute?: boolean);
21
- requestPermisson(): Promise<unknown>;
22
- /** 监听陀螺仪事件 */
23
- active(): Promise<void>;
24
- /** 销毁陀螺仪事件 */
25
- inActive(): void;
26
- }
@@ -1 +0,0 @@
1
- export * from './gyro';