@needle-tools/engine 3.3.0-alpha → 3.5.0-alpha
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/CHANGELOG.md +19 -0
- package/dist/needle-engine.js +62620 -61118
- package/dist/needle-engine.min.js +434 -410
- package/dist/needle-engine.umd.cjs +435 -411
- package/lib/engine/api.d.ts +1 -0
- package/lib/engine/api.js +1 -0
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/codegen/register_types.js +50 -2
- package/lib/engine/codegen/register_types.js.map +1 -1
- package/lib/engine/engine_context.d.ts +1 -1
- package/lib/engine/engine_context.js +21 -15
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_context_registry.d.ts +5 -3
- package/lib/engine/engine_context_registry.js +10 -2
- package/lib/engine/engine_context_registry.js.map +1 -1
- package/lib/engine/engine_element.js.map +1 -1
- package/lib/engine/engine_element_loading.js +2 -3
- package/lib/engine/engine_element_loading.js.map +1 -1
- package/lib/engine/engine_gameobject.d.ts +1 -1
- package/lib/engine/engine_gameobject.js +4 -2
- package/lib/engine/engine_gameobject.js.map +1 -1
- package/lib/engine/engine_input.d.ts +2 -2
- package/lib/engine/engine_physics.d.ts +20 -93
- package/lib/engine/engine_physics.js +20 -892
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/engine_physics.types.js.map +1 -1
- package/lib/engine/engine_physics_rapier.d.ts +103 -0
- package/lib/engine/engine_physics_rapier.js +1003 -0
- package/lib/engine/engine_physics_rapier.js.map +1 -0
- package/lib/engine/engine_three_utils.js +2 -2
- package/lib/engine/engine_three_utils.js.map +1 -1
- package/lib/engine/engine_types.d.ts +50 -1
- package/lib/engine/engine_types.js +8 -0
- package/lib/engine/engine_types.js.map +1 -1
- package/lib/engine-components/Animation.js +4 -0
- package/lib/engine-components/Animation.js.map +1 -1
- package/lib/engine-components/Collider.js +6 -6
- package/lib/engine-components/Collider.js.map +1 -1
- package/lib/engine-components/Joints.js +2 -2
- package/lib/engine-components/Joints.js.map +1 -1
- package/lib/engine-components/RigidBody.d.ts +0 -1
- package/lib/engine-components/RigidBody.js +24 -30
- package/lib/engine-components/RigidBody.js.map +1 -1
- package/lib/engine-components/codegen/components.d.ts +25 -1
- package/lib/engine-components/codegen/components.js +25 -1
- package/lib/engine-components/codegen/components.js.map +1 -1
- package/lib/engine-components/export/usdz/Extension.d.ts +4 -4
- package/lib/engine-components/export/usdz/ThreeUSDZExporter.d.ts +86 -0
- package/lib/engine-components/export/usdz/ThreeUSDZExporter.js +858 -0
- package/lib/engine-components/export/usdz/ThreeUSDZExporter.js.map +1 -0
- package/lib/engine-components/export/usdz/USDZExporter.d.ts +6 -3
- package/lib/engine-components/export/usdz/USDZExporter.js +34 -11
- package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/Animation.d.ts +15 -15
- package/lib/engine-components/export/usdz/extensions/Animation.js +24 -29
- package/lib/engine-components/export/usdz/extensions/Animation.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/DocumentExtension.d.ts +5 -0
- package/lib/engine-components/export/usdz/extensions/DocumentExtension.js +7 -0
- package/lib/engine-components/export/usdz/extensions/DocumentExtension.js.map +1 -0
- package/lib/engine-components/export/usdz/extensions/USDZText.d.ts +47 -0
- package/lib/engine-components/export/usdz/extensions/USDZText.js +114 -0
- package/lib/engine-components/export/usdz/extensions/USDZText.js.map +1 -0
- package/lib/engine-components/export/usdz/extensions/behavior/Actions.d.ts +30 -0
- package/lib/engine-components/export/usdz/extensions/behavior/Actions.js +89 -0
- package/lib/engine-components/export/usdz/extensions/behavior/Actions.js.map +1 -0
- package/lib/engine-components/export/usdz/extensions/behavior/Behaviour.d.ts +23 -0
- package/lib/engine-components/export/usdz/extensions/behavior/Behaviour.js +114 -0
- package/lib/engine-components/export/usdz/extensions/behavior/Behaviour.js.map +1 -0
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.d.ts +102 -0
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js +458 -0
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js.map +1 -0
- package/lib/engine-components/export/usdz/extensions/behavior/BehavioursBuilder.d.ts +111 -0
- package/lib/engine-components/export/usdz/extensions/behavior/BehavioursBuilder.js +409 -0
- package/lib/engine-components/export/usdz/extensions/behavior/BehavioursBuilder.js.map +1 -0
- package/lib/engine-components/postprocessing/PostProcessingHandler.js.map +1 -1
- package/lib/engine-components/ui/BaseUIComponent.d.ts +2 -0
- package/lib/engine-components/ui/BaseUIComponent.js +6 -0
- package/lib/engine-components/ui/BaseUIComponent.js.map +1 -1
- package/lib/engine-components/ui/Canvas.d.ts +11 -1
- package/lib/engine-components/ui/Canvas.js +72 -3
- package/lib/engine-components/ui/Canvas.js.map +1 -1
- package/lib/engine-components/ui/Graphic.js.map +1 -1
- package/lib/engine-components/ui/Image.js +4 -4
- package/lib/engine-components/ui/Image.js.map +1 -1
- package/lib/engine-components/ui/Interfaces.d.ts +11 -0
- package/lib/engine-components/ui/Interfaces.js +11 -0
- package/lib/engine-components/ui/Interfaces.js.map +1 -1
- package/lib/engine-components/ui/Layout.d.ts +65 -3
- package/lib/engine-components/ui/Layout.js +304 -3
- package/lib/engine-components/ui/Layout.js.map +1 -1
- package/lib/engine-components/ui/RectTransform.d.ts +8 -7
- package/lib/engine-components/ui/RectTransform.js +66 -36
- package/lib/engine-components/ui/RectTransform.js.map +1 -1
- package/lib/engine-components/utils/LookAt.d.ts +7 -1
- package/lib/engine-components/utils/LookAt.js +43 -6
- package/lib/engine-components/utils/LookAt.js.map +1 -1
- package/lib/engine-components/webxr/WebXRImageTracking.d.ts +4 -3
- package/lib/engine-components/webxr/WebXRImageTracking.js +81 -25
- package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/plugins/vite/config.js +2 -1
- package/plugins/vite/defines.js +30 -0
- package/plugins/vite/dependency-watcher.js +173 -0
- package/plugins/vite/editor-connection.js +37 -39
- package/plugins/vite/index.js +5 -1
- package/plugins/vite/reload.js +16 -3
- package/src/engine/api.ts +1 -0
- package/src/engine/codegen/register_types.js +50 -2
- package/src/engine/engine_context.ts +32 -23
- package/src/engine/engine_context_registry.ts +13 -6
- package/src/engine/engine_element.ts +2 -1
- package/src/engine/engine_element_loading.ts +2 -3
- package/src/engine/engine_gameobject.ts +3 -2
- package/src/engine/engine_input.ts +2 -2
- package/src/engine/engine_physics.ts +25 -1020
- package/src/engine/engine_physics.types.ts +1 -3
- package/src/engine/engine_physics_rapier.ts +1127 -0
- package/src/engine/engine_three_utils.ts +2 -2
- package/src/engine/engine_types.ts +66 -4
- package/src/engine-components/Animation.ts +4 -0
- package/src/engine-components/Collider.ts +6 -6
- package/src/engine-components/Joints.ts +2 -2
- package/src/engine-components/RigidBody.ts +24 -31
- package/src/engine-components/codegen/components.ts +25 -1
- package/src/engine-components/export/usdz/Extension.ts +4 -5
- package/src/engine-components/export/usdz/ThreeUSDZExporter.ts +1312 -0
- package/src/engine-components/export/usdz/USDZExporter.ts +39 -17
- package/src/engine-components/export/usdz/extensions/Animation.ts +37 -45
- package/src/engine-components/export/usdz/extensions/DocumentExtension.ts +10 -0
- package/src/engine-components/export/usdz/extensions/USDZText.ts +142 -0
- package/src/engine-components/export/usdz/extensions/behavior/Actions.ts +99 -0
- package/src/engine-components/export/usdz/extensions/behavior/Behaviour.ts +181 -0
- package/src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts +545 -0
- package/src/engine-components/export/usdz/extensions/behavior/BehavioursBuilder.ts +459 -0
- package/src/engine-components/postprocessing/PostProcessingHandler.ts +1 -1
- package/src/engine-components/ui/BaseUIComponent.ts +7 -1
- package/src/engine-components/ui/Canvas.ts +80 -5
- package/src/engine-components/ui/Graphic.ts +2 -0
- package/src/engine-components/ui/Image.ts +3 -3
- package/src/engine-components/ui/Interfaces.ts +30 -6
- package/src/engine-components/ui/Layout.ts +303 -4
- package/src/engine-components/ui/RectTransform.ts +67 -41
- package/src/engine-components/utils/LookAt.ts +60 -7
- package/src/engine-components/webxr/WebXRImageTracking.ts +100 -27
- package/lib/engine-components/export/usdz/types.d.ts +0 -34
- package/lib/engine-components/export/usdz/types.js +0 -2
- package/lib/engine-components/export/usdz/types.js.map +0 -1
- package/src/engine-components/export/usdz/types.ts +0 -39
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
BufferGeometry, Camera, Clock, Color, DepthTexture, Group,
|
|
3
|
+
Material, NearestFilter, NoToneMapping, Object3D, PCFSoftShadowMap,
|
|
4
|
+
PerspectiveCamera, RGBAFormat, Scene, sRGBEncoding,
|
|
5
|
+
Texture, WebGLRenderer, WebGLRenderTarget
|
|
5
6
|
} from 'three'
|
|
6
7
|
import { Input } from './engine_input';
|
|
7
8
|
import { Physics } from './engine_physics';
|
|
@@ -27,6 +28,7 @@ import { PlayerViewManager } from './engine_playerview';
|
|
|
27
28
|
import { CoroutineData, ICamera, IComponent, IContext, ILight } from "./engine_types"
|
|
28
29
|
import { destroy, foreachComponent } from './engine_gameobject';
|
|
29
30
|
import { ContextEvent, ContextRegistry } from './engine_context_registry';
|
|
31
|
+
import { delay } from './engine_utils';
|
|
30
32
|
// import { createCameraWithOrbitControl } from '../engine-components/CameraUtils';
|
|
31
33
|
|
|
32
34
|
|
|
@@ -251,8 +253,8 @@ export class Context implements IContext {
|
|
|
251
253
|
this.isManagedExternally = true;
|
|
252
254
|
}
|
|
253
255
|
else {
|
|
254
|
-
this.renderer = new WebGLRenderer({
|
|
255
|
-
antialias: true
|
|
256
|
+
this.renderer = new WebGLRenderer({
|
|
257
|
+
antialias: true
|
|
256
258
|
});
|
|
257
259
|
|
|
258
260
|
// some tonemapping other than "NONE" is required for adjusting exposure with EXR environments
|
|
@@ -346,12 +348,13 @@ export class Context implements IContext {
|
|
|
346
348
|
camera.updateProjectionMatrix();
|
|
347
349
|
}
|
|
348
350
|
|
|
349
|
-
onCreate(buildScene?: (context: Context, loadingOptions?: LoadingOptions) => Promise<void>, opts?: LoadingOptions) {
|
|
351
|
+
async onCreate(buildScene?: (context: Context, loadingOptions?: LoadingOptions) => Promise<void>, opts?: LoadingOptions) {
|
|
350
352
|
if (this._isCreated) {
|
|
351
353
|
console.warn("Context already created");
|
|
352
354
|
return null;
|
|
353
355
|
}
|
|
354
356
|
this._isCreated = true;
|
|
357
|
+
await delay(1);
|
|
355
358
|
return this.internalOnCreate(buildScene, opts);
|
|
356
359
|
}
|
|
357
360
|
|
|
@@ -498,8 +501,8 @@ export class Context implements IContext {
|
|
|
498
501
|
|
|
499
502
|
private async internalOnCreate(buildScene?: (context: Context, opts?: LoadingOptions) => Promise<void>, opts?: LoadingOptions) {
|
|
500
503
|
|
|
501
|
-
|
|
502
|
-
await
|
|
504
|
+
Context.Current = this;
|
|
505
|
+
await ContextRegistry.dispatchCallback(ContextEvent.ContextCreationStart, this);
|
|
503
506
|
|
|
504
507
|
// load and create scene
|
|
505
508
|
let prepare_succeeded = true;
|
|
@@ -512,7 +515,7 @@ export class Context implements IContext {
|
|
|
512
515
|
console.error(err);
|
|
513
516
|
prepare_succeeded = false;
|
|
514
517
|
}
|
|
515
|
-
if (!prepare_succeeded) return;
|
|
518
|
+
if (!prepare_succeeded) return false;
|
|
516
519
|
|
|
517
520
|
this.internalOnUpdateVisible();
|
|
518
521
|
|
|
@@ -523,6 +526,9 @@ export class Context implements IContext {
|
|
|
523
526
|
|
|
524
527
|
Context.Current = this;
|
|
525
528
|
|
|
529
|
+
// TODO: we could configure if we need physics
|
|
530
|
+
// await this.physics.engine?.initialize();
|
|
531
|
+
|
|
526
532
|
// Setup
|
|
527
533
|
Context.Current = this;
|
|
528
534
|
for (let i = 0; i < this.new_scripts.length; i++) {
|
|
@@ -609,13 +615,13 @@ export class Context implements IContext {
|
|
|
609
615
|
if (debug)
|
|
610
616
|
logHierarchy(this.scene, true);
|
|
611
617
|
|
|
612
|
-
ContextRegistry.dispatchCallback(ContextEvent.ContextCreated, this);
|
|
618
|
+
return ContextRegistry.dispatchCallback(ContextEvent.ContextCreated, this);
|
|
613
619
|
}
|
|
614
620
|
|
|
615
621
|
private _accumulatedTime = 0;
|
|
616
622
|
private _framerateClock = new Clock();
|
|
617
623
|
|
|
618
|
-
private render(_, frame
|
|
624
|
+
private render(_, frame: XRFrame) {
|
|
619
625
|
this._xrFrame = frame;
|
|
620
626
|
|
|
621
627
|
this._currentFrameEvent = FrameEvent.Undefined;
|
|
@@ -627,7 +633,7 @@ export class Context implements IContext {
|
|
|
627
633
|
}
|
|
628
634
|
this._accumulatedTime = 0;
|
|
629
635
|
}
|
|
630
|
-
|
|
636
|
+
|
|
631
637
|
this._stats?.begin();
|
|
632
638
|
|
|
633
639
|
Context.Current = this;
|
|
@@ -696,16 +702,19 @@ export class Context implements IContext {
|
|
|
696
702
|
this.executeCoroutines(FrameEvent.LateUpdate);
|
|
697
703
|
if (this.onHandlePaused()) return;
|
|
698
704
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
705
|
+
if (this.physics.engine) {
|
|
706
|
+
const physicsSteps = 1;
|
|
707
|
+
const dt = this.time.deltaTime / physicsSteps;
|
|
708
|
+
for (let i = 0; i < physicsSteps; i++) {
|
|
709
|
+
this._currentFrameEvent = FrameEvent.PrePhysicsStep;
|
|
710
|
+
this.executeCoroutines(FrameEvent.PrePhysicsStep);
|
|
711
|
+
this.physics.engine.step(dt);
|
|
712
|
+
this._currentFrameEvent = FrameEvent.PostPhysicsStep;
|
|
713
|
+
this.executeCoroutines(FrameEvent.PostPhysicsStep);
|
|
714
|
+
}
|
|
715
|
+
this.physics.engine.postStep();
|
|
707
716
|
}
|
|
708
|
-
|
|
717
|
+
|
|
709
718
|
if (this.onHandlePaused()) return;
|
|
710
719
|
|
|
711
720
|
if (this.isVisibleToUser) {
|
|
@@ -781,7 +790,7 @@ export class Context implements IContext {
|
|
|
781
790
|
this.renderRequiredTextures();
|
|
782
791
|
// if (camera === this.mainCameraComponent?.cam) {
|
|
783
792
|
// if (this.mainCameraComponent.activeTexture) {
|
|
784
|
-
|
|
793
|
+
|
|
785
794
|
// }
|
|
786
795
|
// }
|
|
787
796
|
if (this.composer && !this.isInXR) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { IContext } from "./engine_types";
|
|
1
|
+
import { IComponent, IContext } from "./engine_types";
|
|
2
2
|
|
|
3
3
|
export enum ContextEvent {
|
|
4
4
|
/** called when the context is registered to the registry, the context is not fully initialized at this point */
|
|
5
5
|
ContextRegistered = "ContextRegistered",
|
|
6
|
+
/** called before the first glb is loaded, can be used to initialize physics engine, is awaited */
|
|
7
|
+
ContextCreationStart = "ContextCreationStart",
|
|
6
8
|
ContextCreated = "ContextCreated",
|
|
7
9
|
ContextDestroyed = "ContextDestroyed",
|
|
8
10
|
MissingCamera = "MissingCamera",
|
|
@@ -13,11 +15,11 @@ export type ContextEventArgs = {
|
|
|
13
15
|
context: IContext;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
export type ContextCallback = (evt: ContextEventArgs) => void;
|
|
18
|
+
export type ContextCallback = (evt: ContextEventArgs) => void | Promise<any> | IComponent;
|
|
17
19
|
|
|
18
20
|
export class ContextRegistry {
|
|
19
21
|
|
|
20
|
-
static get Current(): IContext{
|
|
22
|
+
static get Current(): IContext {
|
|
21
23
|
return globalThis["NeedleEngine.Context.Current"]
|
|
22
24
|
}
|
|
23
25
|
static set Current(ctx: IContext) {
|
|
@@ -51,10 +53,15 @@ export class ContextRegistry {
|
|
|
51
53
|
this._callbacks[evt].splice(index, 1);
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
static dispatchCallback(evt: ContextEvent, context:IContext) {
|
|
55
|
-
if (!this._callbacks[evt]) return;
|
|
56
|
+
static dispatchCallback(evt: ContextEvent, context: IContext) {
|
|
57
|
+
if (!this._callbacks[evt]) return true;
|
|
56
58
|
const args = { event: evt, context }
|
|
57
|
-
|
|
59
|
+
const promises = new Array<Promise<any>>();
|
|
60
|
+
this._callbacks[evt].forEach(cb => {
|
|
61
|
+
const res = cb(args)
|
|
62
|
+
if (res instanceof Promise) promises.push(res);
|
|
63
|
+
});
|
|
64
|
+
return Promise.all(promises);
|
|
58
65
|
}
|
|
59
66
|
|
|
60
67
|
static addContextCreatedCallback(callback: ContextCallback) {
|
|
@@ -164,6 +164,7 @@ export class NeedleEngineHTMLElement extends HTMLElement implements INeedleEngin
|
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
+
|
|
167
168
|
this._previousSrc = src;
|
|
168
169
|
|
|
169
170
|
// Set the source attribute so codegen doesnt try to re-assign it again and we communicate to the outside which root files are being loaded
|
|
@@ -221,7 +222,7 @@ export class NeedleEngineHTMLElement extends HTMLElement implements INeedleEngin
|
|
|
221
222
|
if (!url.includes(".glb") && !url.includes(".gltf")) {
|
|
222
223
|
const warning = `Needle Engine: found suspicious src "${url}"`;
|
|
223
224
|
console.warn(warning);
|
|
224
|
-
if(isLocalNetwork()) showBalloonWarning(warning);
|
|
225
|
+
if (isLocalNetwork()) showBalloonWarning(warning);
|
|
225
226
|
}
|
|
226
227
|
const fileName = getNameFromUrl(url);
|
|
227
228
|
const progress: LoadingProgressArgs = {
|
|
@@ -73,7 +73,7 @@ export class EngineLoadingView implements ILoadingViewHandler {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
onLoadingBegin(message?: string) {
|
|
76
|
-
if (debug) console.
|
|
76
|
+
if (debug) console.warn("Begin Loading")
|
|
77
77
|
if (!this._loadingElement) {
|
|
78
78
|
for (let i = 0; i < this._element.children.length; i++) {
|
|
79
79
|
const el = this._element.children[i] as HTMLElement;
|
|
@@ -98,9 +98,8 @@ export class EngineLoadingView implements ILoadingViewHandler {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
onLoadingUpdate(progress: LoadingProgressArgs | ProgressEvent | number, message?: string) {
|
|
101
|
-
// if the element has no parent we want to add it
|
|
102
101
|
if (!this._loadingElement?.parentElement) {
|
|
103
|
-
|
|
102
|
+
return;
|
|
104
103
|
}
|
|
105
104
|
// console.log(callback.name, callback.progress.loaded / callback.progress.total, callback.index + "/" + callback.count);
|
|
106
105
|
let total01 = 0;
|
|
@@ -163,8 +163,9 @@ export function foreachComponent(instance: Object3D, cb: ForEachComponentCallbac
|
|
|
163
163
|
return internalForEachComponent(instance, cb, recursive);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
export function* foreachComponentEnumerator<T extends IComponent>(instance: Object3D, type?: Constructor<T>, includeChildren: boolean = false): Generator<T> {
|
|
166
|
+
export function* foreachComponentEnumerator<T extends IComponent>(instance: Object3D, type?: Constructor<T>, includeChildren: boolean = false, maxLevel: number = 999, _currentLevel: number = 0): Generator<T> {
|
|
167
167
|
if (!instance?.userData.components) return;
|
|
168
|
+
if (_currentLevel > maxLevel) return;
|
|
168
169
|
for (const comp of instance.userData.components) {
|
|
169
170
|
if (type && comp?.isComponent === true && comp instanceof type) {
|
|
170
171
|
yield comp;
|
|
@@ -175,7 +176,7 @@ export function* foreachComponentEnumerator<T extends IComponent>(instance: Obje
|
|
|
175
176
|
}
|
|
176
177
|
if (includeChildren === true) {
|
|
177
178
|
for (const ch of instance.children) {
|
|
178
|
-
yield* foreachComponentEnumerator(ch, type, true);
|
|
179
|
+
yield* foreachComponentEnumerator(ch, type, true, maxLevel, _currentLevel + 1);
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
182
|
}
|
|
@@ -2,7 +2,7 @@ import { Vector2 } from 'three';
|
|
|
2
2
|
import { showBalloonMessage, showBalloonWarning } from './debug/debug';
|
|
3
3
|
import { assign } from './engine_serialization_core';
|
|
4
4
|
import { Context } from './engine_setup';
|
|
5
|
-
import { Vec2 } from './engine_types';
|
|
5
|
+
import { IInput, Vec2 } from './engine_types';
|
|
6
6
|
import { getParam } from './engine_utils';
|
|
7
7
|
|
|
8
8
|
const debug = getParam("debuginput");
|
|
@@ -52,7 +52,7 @@ export enum PointerType {
|
|
|
52
52
|
// }
|
|
53
53
|
// }
|
|
54
54
|
|
|
55
|
-
export class Input extends EventTarget {
|
|
55
|
+
export class Input extends EventTarget implements IInput {
|
|
56
56
|
|
|
57
57
|
_doubleClickTimeThreshold = .2;
|
|
58
58
|
_longPressTimeThreshold = 1;
|