@threenative/core 0.1.0 → 0.2.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.
- package/dist/{audio-3vkjtiuo.d.ts → audio-CEAw0w5y.d.ts} +9 -9
- package/dist/game-DRt1Qhq3.d.ts +429 -0
- package/dist/hot.d.ts +17 -5
- package/dist/index.d.ts +95 -39
- package/dist/index.js +1841 -157
- package/dist/playtest.d.ts +26 -4
- package/dist/playtest.js +161 -23
- package/package.json +3 -2
- package/dist/game-DRPs3M7r.d.ts +0 -269
package/dist/index.d.ts
CHANGED
|
@@ -1,85 +1,141 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { AnimationMixer, AnimationClip, Object3D, Sprite, Vector3, CatmullRomCurve3 } from 'three';
|
|
2
|
+
export { A as AudioBus, I as IAudioBusOptions, b as IAudioPlayOptions } from './audio-CEAw0w5y.js';
|
|
3
|
+
import { a as IRendererLike, b as IGamePluginRuntime, c as IGamePluginHooks } from './game-DRt1Qhq3.js';
|
|
4
|
+
export { C as CanvasLayer, d as ICtx, I as IGame, e as IGameObservationContribution, f as IGameObservationSampleRequest, g as IGamePlatformSource, h as IRandom, i as IRawInputPointer, j as IRaycastOptions, k as IScenePickerOptions, S as Scene, l as SceneFrame, m as ScenePicker, n as ScheduleHandle, o as Scheduler, p as createRandom, q as defineGame } from './game-DRt1Qhq3.js';
|
|
5
5
|
import { StorageBufferNode, SpriteNodeMaterial, ComputeNode } from 'three/webgpu';
|
|
6
6
|
import { IReplayRecording } from '@threenative/playtest';
|
|
7
7
|
import 'zustand/vanilla';
|
|
8
8
|
|
|
9
|
-
interface
|
|
9
|
+
interface IAnimationPlayerOptions {
|
|
10
10
|
readonly clips: readonly AnimationClip[];
|
|
11
11
|
readonly root: Object3D;
|
|
12
12
|
}
|
|
13
|
-
interface
|
|
13
|
+
interface IAnimationPlayOptions {
|
|
14
14
|
readonly fade?: number;
|
|
15
15
|
}
|
|
16
16
|
declare class AnimationPlayer {
|
|
17
17
|
#private;
|
|
18
18
|
readonly mixer: AnimationMixer;
|
|
19
|
-
constructor(options:
|
|
19
|
+
constructor(options: IAnimationPlayerOptions);
|
|
20
20
|
get current(): string | undefined;
|
|
21
21
|
get advancedFrames(): number;
|
|
22
|
-
play(name: string, options?:
|
|
22
|
+
play(name: string, options?: IAnimationPlayOptions): void;
|
|
23
23
|
update(dt: number): void;
|
|
24
24
|
stop(): void;
|
|
25
25
|
dispose(): void;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
readonly
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
type ThreeNativeOrientation = "landscape" | "portrait" | "sensor";
|
|
29
|
+
interface IThreeNativeConfig {
|
|
30
|
+
readonly app?: {
|
|
31
|
+
readonly id?: string;
|
|
32
|
+
readonly name?: string;
|
|
33
|
+
readonly version?: string;
|
|
34
|
+
readonly build?: number;
|
|
35
|
+
readonly icon?: string;
|
|
36
|
+
};
|
|
37
|
+
readonly display?: {
|
|
38
|
+
readonly orientation?: ThreeNativeOrientation;
|
|
39
|
+
readonly fullscreen?: boolean;
|
|
40
|
+
readonly keepScreenOn?: boolean;
|
|
41
|
+
};
|
|
42
|
+
readonly window?: {
|
|
43
|
+
readonly title?: string;
|
|
44
|
+
readonly width?: number;
|
|
45
|
+
readonly height?: number;
|
|
46
|
+
readonly resizable?: boolean;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* What the generated loading screen reads.
|
|
50
|
+
*
|
|
51
|
+
* These are declarations, not a renderer: `src/render/loading.ts` is your source and it is the
|
|
52
|
+
* only thing that draws them, so a look this cannot express is a file you edit rather than an
|
|
53
|
+
* option we add. Deleting that file still opts out of the screen entirely.
|
|
54
|
+
*/
|
|
55
|
+
readonly loading?: {
|
|
56
|
+
/** Image drawn centred above the bar, project-relative like `public/logo.png`. */
|
|
57
|
+
readonly image?: string;
|
|
58
|
+
readonly backdropColor?: string;
|
|
59
|
+
readonly trackColor?: string;
|
|
60
|
+
readonly progressColor?: string;
|
|
61
|
+
/** False draws the backdrop and image with no bar. */
|
|
62
|
+
readonly showProgressBar?: boolean;
|
|
63
|
+
};
|
|
64
|
+
readonly nativeEntry?: string;
|
|
65
|
+
readonly renderer?: {
|
|
66
|
+
readonly preferWebGPU?: boolean;
|
|
67
|
+
};
|
|
47
68
|
}
|
|
48
69
|
|
|
49
|
-
interface
|
|
70
|
+
interface IGPUParticles3DBuffers {
|
|
50
71
|
readonly positions: StorageBufferNode<"vec3">;
|
|
51
72
|
readonly velocities: StorageBufferNode<"vec3">;
|
|
52
73
|
}
|
|
53
|
-
interface
|
|
74
|
+
interface IGPUParticles3DOptions {
|
|
54
75
|
readonly amount: number;
|
|
55
76
|
readonly material: SpriteNodeMaterial;
|
|
56
|
-
readonly start: (buffers:
|
|
57
|
-
readonly process: (buffers:
|
|
77
|
+
readonly start: (buffers: IGPUParticles3DBuffers) => ComputeNode;
|
|
78
|
+
readonly process: (buffers: IGPUParticles3DBuffers) => ComputeNode;
|
|
58
79
|
}
|
|
59
80
|
declare class GPUParticles3D extends Sprite {
|
|
60
81
|
#private;
|
|
61
82
|
readonly amount: number;
|
|
62
|
-
readonly buffers:
|
|
83
|
+
readonly buffers: IGPUParticles3DBuffers;
|
|
63
84
|
emitting: boolean;
|
|
64
|
-
constructor(options:
|
|
85
|
+
constructor(options: IGPUParticles3DOptions);
|
|
65
86
|
get released(): boolean;
|
|
66
|
-
attachRenderer(renderer:
|
|
67
|
-
process(renderer?:
|
|
87
|
+
attachRenderer(renderer: IRendererLike): void;
|
|
88
|
+
process(renderer?: IRendererLike | undefined): void;
|
|
68
89
|
restart(): void;
|
|
69
90
|
detach(): void;
|
|
70
91
|
}
|
|
71
92
|
|
|
93
|
+
interface IPathFollow3DOptions {
|
|
94
|
+
readonly loop?: boolean;
|
|
95
|
+
readonly points: readonly Vector3[];
|
|
96
|
+
readonly speed?: number;
|
|
97
|
+
}
|
|
98
|
+
interface IPathFollow3DSample {
|
|
99
|
+
readonly point: Vector3;
|
|
100
|
+
readonly progress: number;
|
|
101
|
+
readonly tangent: Vector3;
|
|
102
|
+
}
|
|
103
|
+
interface IPathFollow3DProjection {
|
|
104
|
+
readonly distanceFromStart: number;
|
|
105
|
+
readonly lateralDistance: number;
|
|
106
|
+
readonly tangent: Vector3;
|
|
107
|
+
readonly point: Vector3;
|
|
108
|
+
readonly segment: number;
|
|
109
|
+
}
|
|
110
|
+
/** A portable, distance-based follower for an authored Three.js route. */
|
|
111
|
+
declare class PathFollow3D {
|
|
112
|
+
#private;
|
|
113
|
+
readonly curve: CatmullRomCurve3;
|
|
114
|
+
readonly loop: boolean;
|
|
115
|
+
readonly totalLength: number;
|
|
116
|
+
constructor(options: IPathFollow3DOptions);
|
|
117
|
+
get completed(): boolean;
|
|
118
|
+
get progress(): number;
|
|
119
|
+
get speed(): number;
|
|
120
|
+
set speed(value: number);
|
|
121
|
+
advance(dt: number): IPathFollow3DSample;
|
|
122
|
+
progressTo(distance: number): this;
|
|
123
|
+
sample(distance?: number): IPathFollow3DSample;
|
|
124
|
+
pointAt(distance: number): IPathFollow3DSample;
|
|
125
|
+
project(position: Vector3): IPathFollow3DProjection;
|
|
126
|
+
}
|
|
127
|
+
|
|
72
128
|
type Recording = IReplayRecording;
|
|
73
129
|
type ReplayPublic = {
|
|
74
130
|
readonly recording: Recording | undefined;
|
|
75
131
|
readonly runId: symbol;
|
|
76
132
|
};
|
|
77
|
-
declare function replay<TState extends Record<string, unknown> = Record<string, unknown>, TPhysics = undefined>():
|
|
78
|
-
declare function createReplayDriver(recording: Recording, target: EventTarget, pointerTarget?: EventTarget): ((runtime:
|
|
79
|
-
prepare: (runtime:
|
|
133
|
+
declare function replay<TState extends Record<string, unknown> = Record<string, unknown>, TPhysics = undefined>(): IGamePluginHooks<TState, TPhysics> & ReplayPublic;
|
|
134
|
+
declare function createReplayDriver(recording: Recording, target: EventTarget, pointerTarget?: EventTarget): ((runtime: IGamePluginRuntime) => number) & {
|
|
135
|
+
prepare: (runtime: IGamePluginRuntime) => void;
|
|
80
136
|
runId: symbol;
|
|
81
137
|
};
|
|
82
138
|
|
|
83
139
|
declare const version = "0.1.0";
|
|
84
140
|
|
|
85
|
-
export {
|
|
141
|
+
export { AnimationPlayer, GPUParticles3D, IGamePluginHooks, IGamePluginRuntime, type IPathFollow3DOptions, type IPathFollow3DProjection, type IPathFollow3DSample, type IThreeNativeConfig, PathFollow3D, type Recording, type ThreeNativeOrientation, createReplayDriver, replay, version };
|