@needle-tools/engine 2.30.0-pre → 2.31.0-pre
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 +4 -0
- package/dist/needle-engine.d.ts +807 -753
- package/dist/needle-engine.js +336 -336
- package/dist/needle-engine.js.map +4 -4
- package/dist/needle-engine.min.js +16 -16
- package/dist/needle-engine.min.js.map +4 -4
- package/lib/engine/engine_physics.d.ts +19 -8
- package/lib/engine/engine_physics.js +57 -48
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine-components/Camera.js +0 -1
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/Component.d.ts +10 -0
- package/lib/engine-components/Component.js +53 -0
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/Rigidbody.d.ts +1 -1
- package/lib/engine-components/Rigidbody.js +3 -3
- package/lib/engine-components/Rigidbody.js.map +1 -1
- package/lib/engine-components/ScreenCapture.d.ts +35 -6
- package/lib/engine-components/ScreenCapture.js +356 -103
- package/lib/engine-components/ScreenCapture.js.map +1 -1
- package/lib/engine-components/VideoPlayer.d.ts +4 -0
- package/lib/engine-components/VideoPlayer.js +22 -1
- package/lib/engine-components/VideoPlayer.js.map +1 -1
- package/lib/needle-engine.d.ts +1 -0
- package/lib/needle-engine.js +1 -0
- package/lib/needle-engine.js.map +1 -1
- package/package.json +1 -1
- package/src/engine/engine_physics.ts +74 -57
- package/src/engine-components/Camera.ts +0 -1
- package/src/engine-components/Component.ts +58 -0
- package/src/engine-components/RigidBody.ts +2 -2
- package/src/engine-components/ScreenCapture.ts +386 -114
- package/src/engine-components/VideoPlayer.ts +26 -2
- package/src/needle-engine.ts +1 -0
package/dist/needle-engine.d.ts
CHANGED
|
@@ -350,790 +350,833 @@ declare module "engine/engine_networking_instantiate" {
|
|
|
350
350
|
export type PrefabProviderCallback = (guid: string) => Promise<GameObject | null>;
|
|
351
351
|
export function registerPrefabProvider(key: string, fn: PrefabProviderCallback): void;
|
|
352
352
|
}
|
|
353
|
-
declare module "engine-components/
|
|
354
|
-
import
|
|
355
|
-
import {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
None = 0,
|
|
364
|
-
HideInHierarchy = 1,
|
|
365
|
-
HideInInspector = 2,
|
|
366
|
-
DontSaveInEditor = 4,
|
|
367
|
-
NotEditable = 8,
|
|
368
|
-
DontSaveInBuild = 16,
|
|
369
|
-
DontUnloadUnusedAsset = 32,
|
|
370
|
-
DontSave = 52,
|
|
371
|
-
HideAndDontSave = 61
|
|
372
|
-
}
|
|
373
|
-
export type Constructor<T> = abstract new (...args: any[]) => T;
|
|
374
|
-
export type ConstructorConcrete<T> = new (...args: any[]) => T;
|
|
375
|
-
export type GuidsMap = {
|
|
376
|
-
[key: string]: string;
|
|
353
|
+
declare module "engine-components/ui/Utils" {
|
|
354
|
+
import { FrameEvent } from "engine/engine_setup";
|
|
355
|
+
import { Behaviour } from "engine-components/Component";
|
|
356
|
+
export function isUIObject(obj: THREE.Object3D): boolean;
|
|
357
|
+
export type RenderSettings = {
|
|
358
|
+
renderOnTop?: boolean;
|
|
359
|
+
doubleSided?: boolean;
|
|
360
|
+
depthWrite?: boolean;
|
|
361
|
+
castShadows?: boolean;
|
|
362
|
+
receiveShadows?: boolean;
|
|
377
363
|
};
|
|
378
|
-
|
|
379
|
-
export
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
static
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
static getComponent<T>(go: GameObject | THREE.Object3D | null, typeName: Constructor<T> | null): T | null;
|
|
421
|
-
static getComponents<T>(go: GameObject | THREE.Object3D | null, typeName: Constructor<T> | null, arr?: T[] | null): T[];
|
|
422
|
-
static findByGuid(guid: string, hierarchy: THREE.Object3D): GameObject | Behaviour | null | undefined;
|
|
423
|
-
static findObjectOfType<T>(typeName: Constructor<T> | string, context?: Context | THREE.Object3D, includeInactive?: boolean): T | null;
|
|
424
|
-
static findObjectsOfType<T>(typeName: Constructor<T>, context?: Context | THREE.Object3D): Array<T>;
|
|
425
|
-
static getComponentInChildren<T>(go: GameObject | THREE.Object3D, typeName: Constructor<T> | null): T | null;
|
|
426
|
-
static getComponentsInChildren<T>(go: GameObject | THREE.Object3D, typeName: Constructor<T> | null, arr?: T[] | null): Array<T>;
|
|
427
|
-
static getComponentInParent<T>(go: GameObject | THREE.Object3D | Array<Object3D>, typeName: Constructor<T>): T | null;
|
|
428
|
-
static getComponentsInParent<T>(go: GameObject | THREE.Object3D, typeName: Constructor<T>, arr?: Array<T> | null): Array<T>;
|
|
429
|
-
static getAllComponents(go: GameObject | THREE.Object3D): Behaviour[];
|
|
430
|
-
static iterateComponents(go: GameObject | THREE.Object3D): Generator<any, void, unknown>;
|
|
431
|
-
abstract addNewComponent<T>(type: Constructor<T>): T | null;
|
|
432
|
-
abstract removeComponent(comp: Component): Component;
|
|
433
|
-
abstract getOrAddComponent<T>(go: GameObject | THREE.Object3D, typeName: Constructor<T> | null): T;
|
|
434
|
-
abstract getComponent<T>(type: Constructor<T>): T | null;
|
|
435
|
-
abstract getComponents<T>(type: Constructor<T>, arr?: T[]): Array<T>;
|
|
436
|
-
abstract getComponentInChildren<T>(type: Constructor<T>): T | null;
|
|
437
|
-
abstract getComponentsInChildren<T>(type: Constructor<T>, arr?: T[]): Array<T>;
|
|
438
|
-
abstract getComponentInParent<T>(type: Constructor<T>): T | null;
|
|
439
|
-
abstract getComponentsInParent<T>(type: Constructor<T>, arr?: T[]): Array<T>;
|
|
440
|
-
}
|
|
441
|
-
class Component implements EventTarget {
|
|
442
|
-
get isComponent(): boolean;
|
|
443
|
-
private __context;
|
|
444
|
-
get context(): Context;
|
|
445
|
-
set context(context: Context);
|
|
446
|
-
get scene(): THREE.Scene;
|
|
447
|
-
get layer(): number;
|
|
448
|
-
get name(): string;
|
|
449
|
-
private __name?;
|
|
450
|
-
set name(str: string);
|
|
451
|
-
get tag(): string;
|
|
452
|
-
set tag(str: string);
|
|
453
|
-
get static(): any;
|
|
454
|
-
get hideFlags(): HideFlags;
|
|
455
|
-
get activeAndEnabled(): boolean;
|
|
456
|
-
private get __isActive();
|
|
457
|
-
private get __isActiveInHierarchy();
|
|
458
|
-
gameObject: GameObject;
|
|
459
|
-
guid: string;
|
|
460
|
-
sourceId?: SourceIdentifier;
|
|
461
|
-
/** called on a component with a map of old to new guids (e.g. when instantiate generated new guids and e.g. timeline track bindings needs to remape them) */
|
|
462
|
-
resolveGuids?(guidsMap: GuidsMap): void;
|
|
364
|
+
export function updateRenderSettings(shadowComponent: THREE.Object3D, settings: RenderSettings): void;
|
|
365
|
+
export type RevocableProxy = {
|
|
366
|
+
proxy: any;
|
|
367
|
+
revoke: () => void;
|
|
368
|
+
};
|
|
369
|
+
/** internal method to proxy a field to detect changes */
|
|
370
|
+
export function onChange<T extends object>(caller: T, field: string, callback: (newValue: any, oldValue: any) => void): RevocableProxy;
|
|
371
|
+
/** internal method to schedula a function at a specific moment in the update loop */
|
|
372
|
+
export function scheduleAction(caller: Behaviour, action: Function, timing?: FrameEvent): void;
|
|
373
|
+
}
|
|
374
|
+
declare module "engine/engine_serialization_decorator" {
|
|
375
|
+
import { Constructor } from "engine-components/Component";
|
|
376
|
+
export type TypeResolver<T> = (data: any) => Constructor<T> | null;
|
|
377
|
+
export const serializeable: <T>(type?: Constructor<T> | TypeResolver<T> | (Constructor<any> | TypeResolver<T>)[] | null | undefined) => (_target: any, _propertyKey: string) => void;
|
|
378
|
+
export const ALL_PROPERTIES_MARKER = "__NEEDLE__ALL_PROPERTIES";
|
|
379
|
+
/** @deprecated current not used */
|
|
380
|
+
export function allProperties(constructor: Function): void;
|
|
381
|
+
export const STRICT_MARKER = "__NEEDLE__STRICT";
|
|
382
|
+
/** @deprecated current not used */
|
|
383
|
+
export function strict(constructor: Function): void;
|
|
384
|
+
}
|
|
385
|
+
declare module "engine-components/Rigidbody" {
|
|
386
|
+
import { Behaviour } from "engine-components/Component";
|
|
387
|
+
import * as CANNON from 'cannon-es';
|
|
388
|
+
import * as THREE from 'three';
|
|
389
|
+
export class Rigidbody extends Behaviour {
|
|
390
|
+
mass: number;
|
|
391
|
+
set isKinematic(kinematic: boolean);
|
|
392
|
+
get isKinematic(): boolean;
|
|
393
|
+
private _isKinematic;
|
|
394
|
+
drag: number;
|
|
395
|
+
angularDrag: number;
|
|
396
|
+
detectCollisions: boolean;
|
|
397
|
+
sleepThreshold: number;
|
|
398
|
+
get body(): CANNON.Body | null;
|
|
399
|
+
private static tempPosition;
|
|
400
|
+
private _body;
|
|
401
|
+
private currentVelocity;
|
|
402
|
+
private _smoothedVelocity;
|
|
403
|
+
private lastWorldPosition;
|
|
404
|
+
private dirty;
|
|
405
|
+
private transformProxy?;
|
|
463
406
|
awake(): void;
|
|
407
|
+
start(): void;
|
|
464
408
|
onEnable(): void;
|
|
465
409
|
onDisable(): void;
|
|
466
410
|
onDestroy(): void;
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
__internalAwake(): void;
|
|
484
|
-
__internalStart(): void;
|
|
485
|
-
__internalEnable(): void;
|
|
486
|
-
__internalDisable(): void;
|
|
487
|
-
constructor();
|
|
488
|
-
private static _worldPositionBuffer;
|
|
489
|
-
private static _worldQuaternionBuffer;
|
|
490
|
-
private static _worldEulerBuffer;
|
|
491
|
-
private _worldPosition;
|
|
492
|
-
private _worldQuaternion;
|
|
493
|
-
private static _tempQuaternionBuffer2;
|
|
494
|
-
private _worldEuler;
|
|
495
|
-
private _worldRotation;
|
|
496
|
-
get worldPosition(): THREE.Vector3;
|
|
497
|
-
set worldPosition(val: THREE.Vector3);
|
|
498
|
-
setWorldPosition(x: number, y: number, z: number): void;
|
|
499
|
-
get worldQuaternion(): THREE.Quaternion;
|
|
500
|
-
set worldQuaternion(val: THREE.Quaternion);
|
|
501
|
-
setWorldQuaternion(x: number, y: number, z: number, w: number): void;
|
|
502
|
-
get worldEuler(): THREE.Euler;
|
|
503
|
-
set worldEuler(val: THREE.Euler);
|
|
504
|
-
get worldRotation(): THREE.Vector3;
|
|
505
|
-
set worldRotation(val: THREE.Vector3);
|
|
506
|
-
setWorldRotation(x: number, y: number, z: number, degrees?: boolean): void;
|
|
507
|
-
private static _forward;
|
|
508
|
-
get forward(): THREE.Vector3;
|
|
509
|
-
private _eventListeners;
|
|
510
|
-
addEventListener(type: string, listener: EventListener): void;
|
|
511
|
-
removeEventListener(type: string, listener: EventListener): void;
|
|
512
|
-
dispatchEvent(evt: Event): boolean;
|
|
513
|
-
}
|
|
514
|
-
class Behaviour extends Component {
|
|
515
|
-
get enabled(): boolean;
|
|
516
|
-
set enabled(val: boolean);
|
|
411
|
+
earlyUpdate(): void;
|
|
412
|
+
onBeforeRender(): void;
|
|
413
|
+
initialize(): void;
|
|
414
|
+
wakeUp(): void;
|
|
415
|
+
applyForce(vec: THREE.Vector3, rel: THREE.Vector3 | undefined): void;
|
|
416
|
+
getVelocity(): THREE.Vector3;
|
|
417
|
+
setVelocity(x: number, y: number, z: number): void;
|
|
418
|
+
get smoothedVelocity(): THREE.Vector3;
|
|
419
|
+
setAngularVelocity(x: number, y: number, z: number): void;
|
|
420
|
+
private static copyVector3;
|
|
421
|
+
setBodyFromGameObject(velocity?: THREE.Vector3 | null | {
|
|
422
|
+
x: number;
|
|
423
|
+
y: number;
|
|
424
|
+
z: number;
|
|
425
|
+
}): void;
|
|
426
|
+
private updateVelocity;
|
|
517
427
|
}
|
|
518
|
-
export { Behaviour, Component, GameObject };
|
|
519
428
|
}
|
|
520
|
-
declare module "engine/
|
|
521
|
-
import {
|
|
522
|
-
|
|
523
|
-
|
|
429
|
+
declare module "engine-components/RendererLightmap" {
|
|
430
|
+
import { GameObject } from "engine-components/Component";
|
|
431
|
+
import * as THREE from "three";
|
|
432
|
+
import { Texture } from "three";
|
|
433
|
+
import { Context } from "engine/engine_setup";
|
|
434
|
+
export class RendererLightmap {
|
|
435
|
+
get lightmap(): Texture | null;
|
|
436
|
+
set lightmap(tex: Texture | null);
|
|
437
|
+
lightmapIndex: number;
|
|
438
|
+
lightmapScaleOffset: THREE.Vector4;
|
|
439
|
+
private context;
|
|
440
|
+
private gameObject;
|
|
441
|
+
private lightmapTexture;
|
|
442
|
+
private lightmapScaleOffsetUniform;
|
|
443
|
+
private lightmapUniform;
|
|
444
|
+
private beforeRenderCallback?;
|
|
445
|
+
constructor(gameObject: GameObject, context: Context);
|
|
446
|
+
init(lightmapIndex: number, lightmapScaleOffset: THREE.Vector4, lightmapTexture: THREE.Texture, debug?: boolean): void;
|
|
447
|
+
bindOnBeforeRender(): void;
|
|
448
|
+
private onBeforeRenderThreeComplete;
|
|
449
|
+
private setupLightmap;
|
|
450
|
+
onBeforeRenderThree(material: THREE.Material): void;
|
|
451
|
+
private setLightmapDebugMaterial;
|
|
524
452
|
}
|
|
525
453
|
}
|
|
526
|
-
declare module "engine/
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
add(key: any, type: any): void;
|
|
538
|
-
get(key: any): any;
|
|
454
|
+
declare module "engine/extensions/NEEDLE_render_objects" {
|
|
455
|
+
import { SourceIdentifier } from "engine/engine_gltf";
|
|
456
|
+
import { GLTF, GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
457
|
+
import { Renderer } from "engine-components/Renderer";
|
|
458
|
+
export class NEEDLE_render_objects implements GLTFLoaderPlugin {
|
|
459
|
+
private static stencils;
|
|
460
|
+
static applyStencil(obj?: Renderer | null): void;
|
|
461
|
+
private parser;
|
|
462
|
+
private source;
|
|
463
|
+
constructor(parser: GLTFParser, source: SourceIdentifier);
|
|
464
|
+
afterRoot(_result: GLTF): Promise<void> | null;
|
|
539
465
|
}
|
|
540
|
-
export const
|
|
466
|
+
export const EXTENSION_NAME = "NEEDLE_render_objects";
|
|
541
467
|
}
|
|
542
|
-
declare module "engine/
|
|
468
|
+
declare module "engine/engine_loaders" {
|
|
469
|
+
import { Context } from "engine/engine_setup";
|
|
470
|
+
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
471
|
+
export function setDracoDecoderPath(path: string | undefined): void;
|
|
472
|
+
export function setDracoDecoderType(type: string | undefined): void;
|
|
473
|
+
export function setKtx2TranscoderPath(path: string): void;
|
|
474
|
+
export function addDracoAndKTX2Loaders(loader: GLTFLoader, context: Context): void;
|
|
475
|
+
}
|
|
476
|
+
declare module "engine/extensions/NEEDLE_deferred_texture" {
|
|
477
|
+
import { Material } from "three";
|
|
543
478
|
import { GLTF, GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
544
|
-
import {
|
|
545
|
-
|
|
546
|
-
export
|
|
547
|
-
export class
|
|
479
|
+
import { SourceIdentifier } from "engine/engine_gltf";
|
|
480
|
+
import { Context } from "engine/engine_setup";
|
|
481
|
+
export const EXTENSION_NAME = "NEEDLE_deferred_texture";
|
|
482
|
+
export class NEEDLE_deferred_texture implements GLTFLoaderPlugin {
|
|
483
|
+
static assignTextureLOD(context: Context, source: SourceIdentifier | undefined, material: Material, level?: number): void;
|
|
548
484
|
get name(): string;
|
|
549
485
|
private parser;
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
486
|
+
private sourceId;
|
|
487
|
+
private context;
|
|
488
|
+
constructor(parser: GLTFParser, sourceId: SourceIdentifier, context: Context);
|
|
489
|
+
private _loading;
|
|
490
|
+
afterRoot(gltf: GLTF): null;
|
|
491
|
+
private static cache;
|
|
492
|
+
private static resolved;
|
|
493
|
+
private static getOrLoadTexture;
|
|
553
494
|
}
|
|
554
495
|
}
|
|
555
|
-
declare module "engine/
|
|
556
|
-
import {
|
|
557
|
-
import
|
|
558
|
-
import {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
export type NodeToObjectMap = {
|
|
564
|
-
[nodeId: string]: Object3D;
|
|
565
|
-
};
|
|
566
|
-
export type ObjectToNodeMap = {
|
|
567
|
-
[uuid: string]: number;
|
|
568
|
-
};
|
|
569
|
-
class SerializationHelper {
|
|
570
|
-
register(type: string, ser: ITypeSerializer): void;
|
|
571
|
-
typeMap: {
|
|
572
|
-
[type: string]: ITypeSerializer;
|
|
573
|
-
};
|
|
574
|
-
getSerializer(type: string): ITypeSerializer | undefined;
|
|
575
|
-
getSerializerForConstructor(type: any, level?: number): ITypeSerializer | undefined;
|
|
496
|
+
declare module "engine-components/Renderer" {
|
|
497
|
+
import { Behaviour } from "engine-components/Component";
|
|
498
|
+
import * as THREE from "three";
|
|
499
|
+
import { Texture } from "three";
|
|
500
|
+
export class FieldWithDefault {
|
|
501
|
+
path: string | null;
|
|
502
|
+
asset: object | null;
|
|
503
|
+
default: any;
|
|
576
504
|
}
|
|
577
|
-
export
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
505
|
+
export enum RenderState {
|
|
506
|
+
Both = 0,
|
|
507
|
+
Back = 1,
|
|
508
|
+
Front = 2
|
|
581
509
|
}
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
*/
|
|
591
|
-
export abstract class TypeSerializer implements ITypeSerializer {
|
|
592
|
-
constructor(type: Constructor<any> | Constructor<any>[]);
|
|
593
|
-
abstract onSerialize(data: any, context: SerializationContext): any | void;
|
|
594
|
-
abstract onDeserialize(data: any, context: SerializationContext): any | void;
|
|
510
|
+
class SharedMaterialArray {
|
|
511
|
+
private _renderer;
|
|
512
|
+
private _targets;
|
|
513
|
+
is(renderer: Renderer): boolean;
|
|
514
|
+
constructor(renderer: Renderer);
|
|
515
|
+
get length(): number;
|
|
516
|
+
private setMaterial;
|
|
517
|
+
private getMaterial;
|
|
595
518
|
}
|
|
596
|
-
export
|
|
597
|
-
|
|
519
|
+
export class Renderer extends Behaviour {
|
|
520
|
+
receiveShadows: boolean;
|
|
521
|
+
shadowCastingMode: ShadowCastingMode;
|
|
522
|
+
lightmapIndex: number;
|
|
523
|
+
lightmapScaleOffset: THREE.Vector4;
|
|
524
|
+
enableInstancing: boolean[] | undefined;
|
|
525
|
+
renderOrder: number[] | undefined;
|
|
526
|
+
allowOcclusionWhenDynamic: boolean;
|
|
527
|
+
private _lightmaps?;
|
|
528
|
+
get material(): THREE.Material;
|
|
529
|
+
set material(mat: THREE.Material);
|
|
530
|
+
private _sharedMaterials;
|
|
531
|
+
get sharedMaterials(): SharedMaterialArray;
|
|
532
|
+
static get shouldSuppressInstancing(): string | boolean;
|
|
533
|
+
private _lightmapTextureOverride;
|
|
534
|
+
get lightmap(): Texture | null;
|
|
535
|
+
set lightmap(tex: Texture | null | undefined);
|
|
536
|
+
get hasLightmap(): boolean;
|
|
537
|
+
awake(): void;
|
|
538
|
+
private _isInstancingEnabled;
|
|
539
|
+
private handles;
|
|
540
|
+
private prevLayers;
|
|
541
|
+
private clearInstancingState;
|
|
542
|
+
setInstancingEnabled(enabled: boolean): boolean;
|
|
543
|
+
start(): void;
|
|
544
|
+
onEnable(): void;
|
|
545
|
+
onDisable(): void;
|
|
546
|
+
onDestroy(): void;
|
|
547
|
+
applyStencil(): void;
|
|
548
|
+
onBeforeRenderThree(_renderer: any, _scene: any, _camera: any, _geometry: any, material: any, _group: any): void;
|
|
549
|
+
onBeforeRender(): void;
|
|
550
|
+
onAfterRender(): void;
|
|
551
|
+
private applySettings;
|
|
598
552
|
}
|
|
599
|
-
export class
|
|
600
|
-
root: THREE.Object3D;
|
|
601
|
-
gltf?: GLTF;
|
|
602
|
-
gltfId?: SourceIdentifier;
|
|
603
|
-
object: THREE.Object3D;
|
|
604
|
-
target?: object;
|
|
605
|
-
nodeId?: number;
|
|
606
|
-
nodeToObject?: NodeToObjectMap;
|
|
607
|
-
objectToNode?: ObjectToNodeMap;
|
|
608
|
-
context?: Context;
|
|
609
|
-
path?: string;
|
|
610
|
-
constructor(root: THREE.Object3D);
|
|
553
|
+
export class MeshRenderer extends Renderer {
|
|
611
554
|
}
|
|
612
|
-
export
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
555
|
+
export class SkinnedMeshRenderer extends MeshRenderer {
|
|
556
|
+
awake(): void;
|
|
557
|
+
}
|
|
558
|
+
export enum ShadowCastingMode {
|
|
559
|
+
Off = 0,
|
|
560
|
+
On = 1,
|
|
561
|
+
TwoSided = 2,
|
|
562
|
+
ShadowsOnly = 3
|
|
563
|
+
}
|
|
564
|
+
export class InstancingUtil {
|
|
565
|
+
static markDirty(go: THREE.Object3D | null, recursive?: boolean): void;
|
|
620
566
|
}
|
|
621
|
-
export function serializeObject(obj: ISerializable, context: SerializationContext): object | null;
|
|
622
|
-
export function deserializeObject(obj: ISerializable, serializedData: object, context: SerializationContext): boolean;
|
|
623
|
-
/** Object.assign behaviour but check if property is writeable (e.g. getter only properties are skipped) */
|
|
624
|
-
export function assign(target: any, source: any): void;
|
|
625
567
|
}
|
|
626
|
-
declare module "engine/
|
|
568
|
+
declare module "engine-components/Collider" {
|
|
569
|
+
import { Behaviour } from "engine-components/Component";
|
|
570
|
+
import { Rigidbody } from "engine-components/Rigidbody";
|
|
571
|
+
import { Shape } from "cannon-es";
|
|
572
|
+
export class Collider extends Behaviour {
|
|
573
|
+
attachedRigidbody: Rigidbody | null;
|
|
574
|
+
isTrigger: boolean;
|
|
575
|
+
protected _shape: Shape | null;
|
|
576
|
+
awake(): void;
|
|
577
|
+
onEnable(): void;
|
|
578
|
+
onDisable(): void;
|
|
579
|
+
}
|
|
580
|
+
export class SphereCollider extends Collider {
|
|
581
|
+
radius: number;
|
|
582
|
+
center: THREE.Vector3;
|
|
583
|
+
onEnable(): void;
|
|
584
|
+
}
|
|
585
|
+
export class BoxCollider extends Collider {
|
|
586
|
+
size: THREE.Vector3;
|
|
587
|
+
center: THREE.Vector3;
|
|
588
|
+
onEnable(): void;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
declare module "engine/engine_physics" {
|
|
592
|
+
import * as CANNON from 'cannon-es';
|
|
627
593
|
import * as THREE from 'three';
|
|
628
594
|
import { Context } from "engine/engine_setup";
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
595
|
+
import { Rigidbody } from "engine-components/Rigidbody";
|
|
596
|
+
import { GameObject } from "engine-components/Component";
|
|
597
|
+
import { Object3D, Vector3 } from 'three';
|
|
598
|
+
import { Collider } from "engine-components/Collider";
|
|
599
|
+
export class BodyOptions {
|
|
600
|
+
mass: number;
|
|
601
|
+
kinematic: boolean;
|
|
602
|
+
physicsEvents: boolean;
|
|
603
|
+
drag: number;
|
|
604
|
+
angularDrag: number;
|
|
605
|
+
sleepThreshold: number;
|
|
606
|
+
}
|
|
607
|
+
type CannonCollision = {
|
|
608
|
+
body: CANNON.Body;
|
|
609
|
+
contact: CANNON.ContactEquation;
|
|
610
|
+
target: CANNON.Body;
|
|
611
|
+
type: string;
|
|
636
612
|
};
|
|
637
|
-
export class
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
613
|
+
export class RaycastOptions {
|
|
614
|
+
ray: THREE.Ray | undefined;
|
|
615
|
+
cam: THREE.Camera | undefined | null;
|
|
616
|
+
screenPoint: THREE.Vector2 | undefined;
|
|
617
|
+
raycaster: THREE.Raycaster | undefined;
|
|
618
|
+
results: Array<THREE.Intersection> | undefined;
|
|
619
|
+
targets: Array<THREE.Object3D> | undefined;
|
|
620
|
+
recursive: boolean | undefined;
|
|
621
|
+
minDistance: number | undefined;
|
|
622
|
+
maxDistance: number | undefined;
|
|
623
|
+
lineThreshold: number | undefined;
|
|
624
|
+
layerMask: THREE.Layers | number | undefined;
|
|
625
|
+
ignore: THREE.Object3D[] | undefined;
|
|
626
|
+
screenPointFromOffset(ox: number, oy: number): void;
|
|
627
|
+
setMask(mask: number): void;
|
|
628
|
+
static AllLayers: number;
|
|
642
629
|
}
|
|
643
|
-
export
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
KeyUp = "keyup",
|
|
649
|
-
KeyPressed = "keypress"
|
|
630
|
+
export class SphereIntersection implements THREE.Intersection {
|
|
631
|
+
distance: number;
|
|
632
|
+
point: THREE.Vector3;
|
|
633
|
+
object: THREE.Object3D;
|
|
634
|
+
constructor(object: THREE.Object3D, distance: number, point: THREE.Vector3);
|
|
650
635
|
}
|
|
651
|
-
export class
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
getPointerPressedCount(): number;
|
|
666
|
-
getPointerPosition(i: number): THREE.Vector2 | null;
|
|
667
|
-
getPointerPositionLastFrame(i: number): THREE.Vector2 | null;
|
|
668
|
-
getPointerPositionDelta(i: number): THREE.Vector2 | null;
|
|
669
|
-
getPointerPositionRC(i: number): THREE.Vector2 | null;
|
|
670
|
-
getPointerDown(i: number): boolean;
|
|
671
|
-
getPointerUp(i: number): boolean;
|
|
672
|
-
getPointerPressed(i: number): boolean;
|
|
673
|
-
getPointerClicked(i: number): boolean;
|
|
674
|
-
getPointerDoubleClicked(i: number): boolean;
|
|
675
|
-
getPointerDownTime(i: number): number;
|
|
676
|
-
getPointerUpTime(i: number): number;
|
|
677
|
-
getPointerLongPress(i: number): boolean;
|
|
678
|
-
getIsMouse(i: number): boolean;
|
|
679
|
-
getIsTouch(i: number): boolean;
|
|
680
|
-
getTouchesPressedCount(): number;
|
|
681
|
-
getMouseWheelChanged(i?: number): boolean;
|
|
682
|
-
getPointerEvent(i: number): Event | undefined;
|
|
636
|
+
export class Physics {
|
|
637
|
+
private readonly raycaster;
|
|
638
|
+
private readonly defaultRaycastOptions;
|
|
639
|
+
private readonly targetBuffer;
|
|
640
|
+
private readonly defaultThresholds;
|
|
641
|
+
private sphereResults;
|
|
642
|
+
private sphereMask;
|
|
643
|
+
sphereOverlap(spherePos: THREE.Vector3, radius: number): Array<THREE.Intersection>;
|
|
644
|
+
private tempBoundingBox;
|
|
645
|
+
private onSphereOverlap;
|
|
646
|
+
raycastFromRay(ray: THREE.Ray, options?: RaycastOptions | null): Array<THREE.Intersection>;
|
|
647
|
+
raycast(options?: RaycastOptions | null): Array<THREE.Intersection>;
|
|
648
|
+
get isUpdating(): boolean;
|
|
649
|
+
private _isUpdatingPhysicsWorld;
|
|
683
650
|
private context;
|
|
684
|
-
private
|
|
685
|
-
private
|
|
686
|
-
private
|
|
687
|
-
private
|
|
688
|
-
private _pointerPressed;
|
|
689
|
-
private _pointerPositions;
|
|
690
|
-
private _pointerPositionsLastFrame;
|
|
691
|
-
private _pointerPositionsDelta;
|
|
692
|
-
private _pointerPositionsRC;
|
|
693
|
-
private _pointerPositionDown;
|
|
694
|
-
private _pointerDownTime;
|
|
695
|
-
private _pointerUpTime;
|
|
696
|
-
private _pointerIds;
|
|
697
|
-
private _pointerTypes;
|
|
698
|
-
private _mouseWheelChanged;
|
|
699
|
-
private _pointerEvent;
|
|
700
|
-
getKeyDown(): string | null;
|
|
701
|
-
getKeyPressed(): string | null;
|
|
702
|
-
isKeyDown(keyCode: number): boolean;
|
|
703
|
-
isKeyUp(keyCode: number): boolean;
|
|
704
|
-
isKeyPressed(keyCode: number): boolean;
|
|
705
|
-
createPointerDown(args: PointerEventArgs): void;
|
|
706
|
-
createPointerMove(args: PointerEventArgs): void;
|
|
707
|
-
createPointerUp(args: PointerEventArgs): void;
|
|
651
|
+
private world;
|
|
652
|
+
private objects;
|
|
653
|
+
private tempPosition;
|
|
654
|
+
private tempQuaternion;
|
|
708
655
|
constructor(context: Context);
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
private
|
|
722
|
-
private
|
|
723
|
-
|
|
724
|
-
private
|
|
725
|
-
private
|
|
726
|
-
|
|
727
|
-
private
|
|
728
|
-
private
|
|
729
|
-
private
|
|
656
|
+
addPreStepListener(listener: (evt: any) => void): void;
|
|
657
|
+
addPostStepListener(listener: (evt: any) => void): void;
|
|
658
|
+
addConstraint(constraint: CANNON.Constraint): void;
|
|
659
|
+
setGravity(vec: THREE.Vector3): void;
|
|
660
|
+
multiplyGravity(vec: THREE.Vector3): void;
|
|
661
|
+
addBody(go: GameObject, body: CANNON.Body): void;
|
|
662
|
+
removeBody(go: GameObject, body: CANNON.Body, removeCompletely?: boolean): void;
|
|
663
|
+
removeShape(obj: THREE.Object3D, shape: CANNON.Shape): void;
|
|
664
|
+
createBody(obj: THREE.Object3D, settings: BodyOptions): CANNON.Body;
|
|
665
|
+
addBoxCollider(obj: THREE.Object3D, trigger: boolean, center: THREE.Vector3, size: THREE.Vector3, rb: Rigidbody | null): CANNON.Shape;
|
|
666
|
+
addSphereCollider(obj: THREE.Object3D, center: THREE.Vector3, radius: number, rb: Rigidbody | null): CANNON.Shape;
|
|
667
|
+
addMeshCollider(_obj: THREE.Object3D): void;
|
|
668
|
+
private isAlreadyRegistered;
|
|
669
|
+
private addShape;
|
|
670
|
+
step(deltaTime: number): void;
|
|
671
|
+
private temp;
|
|
672
|
+
private tempQuat;
|
|
673
|
+
postStep(): void;
|
|
674
|
+
private internalCreateBody;
|
|
675
|
+
private registerCollisionEvents;
|
|
676
|
+
private unregisterCollisionEvents;
|
|
677
|
+
private onBeginContact;
|
|
678
|
+
private raiseCollisionEvents;
|
|
679
|
+
private onEndContact;
|
|
730
680
|
}
|
|
731
|
-
export
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
ESCAPE = 27,
|
|
741
|
-
SPACE = 32,
|
|
742
|
-
PAGE_UP = 33,
|
|
743
|
-
PAGE_DOWN = 34,
|
|
744
|
-
END = 35,
|
|
745
|
-
HOME = 36,
|
|
746
|
-
LEFT_ARROW = 37,
|
|
747
|
-
UP_ARROW = 38,
|
|
748
|
-
RIGHT_ARROW = 39,
|
|
749
|
-
DOWN_ARROW = 40,
|
|
750
|
-
INSERT = 45,
|
|
751
|
-
DELETE = 46,
|
|
752
|
-
KEY_0 = 48,
|
|
753
|
-
KEY_1 = 49,
|
|
754
|
-
KEY_2 = 50,
|
|
755
|
-
KEY_3 = 51,
|
|
756
|
-
KEY_4 = 52,
|
|
757
|
-
KEY_5 = 53,
|
|
758
|
-
KEY_6 = 54,
|
|
759
|
-
KEY_7 = 55,
|
|
760
|
-
KEY_8 = 56,
|
|
761
|
-
KEY_9 = 57,
|
|
762
|
-
KEY_A = 65,
|
|
763
|
-
KEY_B = 66,
|
|
764
|
-
KEY_C = 67,
|
|
765
|
-
KEY_D = 68,
|
|
766
|
-
KEY_E = 69,
|
|
767
|
-
KEY_F = 70,
|
|
768
|
-
KEY_G = 71,
|
|
769
|
-
KEY_H = 72,
|
|
770
|
-
KEY_I = 73,
|
|
771
|
-
KEY_J = 74,
|
|
772
|
-
KEY_K = 75,
|
|
773
|
-
KEY_L = 76,
|
|
774
|
-
KEY_M = 77,
|
|
775
|
-
KEY_N = 78,
|
|
776
|
-
KEY_O = 79,
|
|
777
|
-
KEY_P = 80,
|
|
778
|
-
KEY_Q = 81,
|
|
779
|
-
KEY_R = 82,
|
|
780
|
-
KEY_S = 83,
|
|
781
|
-
KEY_T = 84,
|
|
782
|
-
KEY_U = 85,
|
|
783
|
-
KEY_V = 86,
|
|
784
|
-
KEY_W = 87,
|
|
785
|
-
KEY_X = 88,
|
|
786
|
-
KEY_Y = 89,
|
|
787
|
-
KEY_Z = 90,
|
|
788
|
-
LEFT_META = 91,
|
|
789
|
-
RIGHT_META = 92,
|
|
790
|
-
SELECT = 93,
|
|
791
|
-
NUMPAD_0 = 96,
|
|
792
|
-
NUMPAD_1 = 97,
|
|
793
|
-
NUMPAD_2 = 98,
|
|
794
|
-
NUMPAD_3 = 99,
|
|
795
|
-
NUMPAD_4 = 100,
|
|
796
|
-
NUMPAD_5 = 101,
|
|
797
|
-
NUMPAD_6 = 102,
|
|
798
|
-
NUMPAD_7 = 103,
|
|
799
|
-
NUMPAD_8 = 104,
|
|
800
|
-
NUMPAD_9 = 105,
|
|
801
|
-
MULTIPLY = 106,
|
|
802
|
-
ADD = 107,
|
|
803
|
-
SUBTRACT = 109,
|
|
804
|
-
DECIMAL = 110,
|
|
805
|
-
DIVIDE = 111,
|
|
806
|
-
F1 = 112,
|
|
807
|
-
F2 = 113,
|
|
808
|
-
F3 = 114,
|
|
809
|
-
F4 = 115,
|
|
810
|
-
F5 = 116,
|
|
811
|
-
F6 = 117,
|
|
812
|
-
F7 = 118,
|
|
813
|
-
F8 = 119,
|
|
814
|
-
F9 = 120,
|
|
815
|
-
F10 = 121,
|
|
816
|
-
F11 = 122,
|
|
817
|
-
F12 = 123,
|
|
818
|
-
NUM_LOCK = 144,
|
|
819
|
-
SCROLL_LOCK = 145,
|
|
820
|
-
SEMICOLON = 186,
|
|
821
|
-
EQUALS = 187,
|
|
822
|
-
COMMA = 188,
|
|
823
|
-
DASH = 189,
|
|
824
|
-
PERIOD = 190,
|
|
825
|
-
FORWARD_SLASH = 191,
|
|
826
|
-
GRAVE_ACCENT = 192,
|
|
827
|
-
OPEN_BRACKET = 219,
|
|
828
|
-
BACK_SLASH = 220,
|
|
829
|
-
CLOSE_BRACKET = 221,
|
|
830
|
-
SINGLE_QUOTE = 222
|
|
681
|
+
export class Collision {
|
|
682
|
+
private readonly collision;
|
|
683
|
+
readonly me: Object3D;
|
|
684
|
+
private _normal?;
|
|
685
|
+
get normal(): Vector3;
|
|
686
|
+
private _collider?;
|
|
687
|
+
get collider(): Collider;
|
|
688
|
+
get gameObject(): Object3D;
|
|
689
|
+
constructor(obj: Object3D, collision: CannonCollision);
|
|
831
690
|
}
|
|
832
691
|
}
|
|
833
|
-
declare module "engine-components/
|
|
834
|
-
import
|
|
835
|
-
import {
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
692
|
+
declare module "engine-components/Component" {
|
|
693
|
+
import * as THREE from "three";
|
|
694
|
+
import { Context, FrameEvent } from "engine/engine_setup";
|
|
695
|
+
import { Object3D } from "three";
|
|
696
|
+
import { SourceIdentifier } from "engine/engine_gltf";
|
|
697
|
+
import { Collision } from "engine/engine_physics";
|
|
698
|
+
export interface UIDProvider {
|
|
699
|
+
seed: number;
|
|
700
|
+
generateUUID(): string;
|
|
701
|
+
}
|
|
702
|
+
export enum HideFlags {
|
|
703
|
+
None = 0,
|
|
704
|
+
HideInHierarchy = 1,
|
|
705
|
+
HideInInspector = 2,
|
|
706
|
+
DontSaveInEditor = 4,
|
|
707
|
+
NotEditable = 8,
|
|
708
|
+
DontSaveInBuild = 16,
|
|
709
|
+
DontUnloadUnusedAsset = 32,
|
|
710
|
+
DontSave = 52,
|
|
711
|
+
HideAndDontSave = 61
|
|
712
|
+
}
|
|
713
|
+
export type Constructor<T> = abstract new (...args: any[]) => T;
|
|
714
|
+
export type ConstructorConcrete<T> = new (...args: any[]) => T;
|
|
715
|
+
export type GuidsMap = {
|
|
716
|
+
[key: string]: string;
|
|
848
717
|
};
|
|
849
|
-
|
|
850
|
-
export
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
private
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
718
|
+
type FunctionName = string;
|
|
719
|
+
export class InstantiateOptions {
|
|
720
|
+
idProvider?: UIDProvider | undefined;
|
|
721
|
+
parent?: string | undefined | Object3D;
|
|
722
|
+
/** for duplicatable parenting */
|
|
723
|
+
keepWorldPosition?: boolean;
|
|
724
|
+
position?: THREE.Vector3 | undefined;
|
|
725
|
+
rotation?: THREE.Quaternion | undefined;
|
|
726
|
+
scale?: THREE.Vector3 | undefined;
|
|
727
|
+
visible?: boolean | undefined;
|
|
728
|
+
context?: Context | undefined;
|
|
729
|
+
}
|
|
730
|
+
abstract class GameObject extends THREE.Object3D implements THREE.Object3D {
|
|
731
|
+
guid: string | undefined;
|
|
732
|
+
static setActive(go: THREE.Object3D, active: boolean): void;
|
|
733
|
+
static isActiveSelf(go: THREE.Object3D): boolean;
|
|
734
|
+
static isActiveInHierarchy(go: THREE.Object3D): boolean;
|
|
735
|
+
static markAsInstancedRendered(go: THREE.Object3D, instanced: boolean): void;
|
|
736
|
+
static isUsingInstancing(instance: THREE.Object3D): boolean;
|
|
737
|
+
static foreachComponent(instance: THREE.Object3D, cb: (comp: Component) => any, recursive?: boolean): any;
|
|
738
|
+
static instantiateSynced(instance: GameObject | THREE.Object3D | null, opts: InstantiateOptions): GameObject | null;
|
|
739
|
+
static instantiate(instance: GameObject | THREE.Object3D | null, opts?: InstantiateOptions | null): GameObject | null;
|
|
740
|
+
private static internalInstantiate;
|
|
741
|
+
private static resolveAndBindSkinnedMeshBones;
|
|
742
|
+
private static resolveReferences;
|
|
743
|
+
private static postProcessNewInstance;
|
|
744
|
+
static destroySynced(instance: THREE.Object3D | Component, context?: Context, recursive?: boolean): void;
|
|
745
|
+
static destroy(instance: THREE.Object3D | Component, recursive?: boolean, isRoot?: boolean): void;
|
|
746
|
+
/**
|
|
747
|
+
* Add an object to parent and also ensure all components are being registered
|
|
748
|
+
*/
|
|
749
|
+
static add(instance: THREE.Object3D | null | undefined, parent: THREE.Object3D, context?: Context): void;
|
|
750
|
+
/**
|
|
751
|
+
* Removes the object from its parent and deactivates all of its components
|
|
752
|
+
*/
|
|
753
|
+
static remove(instance: THREE.Object3D | null | undefined): void;
|
|
754
|
+
static invokeOnChildren(go: THREE.Object3D | null | undefined, functionName: string | FunctionName, ...args: any): void;
|
|
755
|
+
static invoke(go: THREE.Object3D | null | undefined, functionName: string | FunctionName, children?: boolean, ...args: any): void;
|
|
756
|
+
static addNewComponent<T extends Behaviour>(go: GameObject | THREE.Object3D, type: ConstructorConcrete<T>, callAwake?: boolean): T;
|
|
757
|
+
static addComponent(go: GameObject, instance: Component): void;
|
|
758
|
+
static removeComponent(instance: Component): Component;
|
|
759
|
+
static getOrAddComponent<T>(go: GameObject | THREE.Object3D, typeName: Constructor<T> | null): T;
|
|
760
|
+
static getComponent<T>(go: GameObject | THREE.Object3D | null, typeName: Constructor<T> | null): T | null;
|
|
761
|
+
static getComponents<T>(go: GameObject | THREE.Object3D | null, typeName: Constructor<T> | null, arr?: T[] | null): T[];
|
|
762
|
+
static findByGuid(guid: string, hierarchy: THREE.Object3D): GameObject | Behaviour | null | undefined;
|
|
763
|
+
static findObjectOfType<T>(typeName: Constructor<T> | string, context?: Context | THREE.Object3D, includeInactive?: boolean): T | null;
|
|
764
|
+
static findObjectsOfType<T>(typeName: Constructor<T>, context?: Context | THREE.Object3D): Array<T>;
|
|
765
|
+
static getComponentInChildren<T>(go: GameObject | THREE.Object3D, typeName: Constructor<T> | null): T | null;
|
|
766
|
+
static getComponentsInChildren<T>(go: GameObject | THREE.Object3D, typeName: Constructor<T> | null, arr?: T[] | null): Array<T>;
|
|
767
|
+
static getComponentInParent<T>(go: GameObject | THREE.Object3D | Array<Object3D>, typeName: Constructor<T>): T | null;
|
|
768
|
+
static getComponentsInParent<T>(go: GameObject | THREE.Object3D, typeName: Constructor<T>, arr?: Array<T> | null): Array<T>;
|
|
769
|
+
static getAllComponents(go: GameObject | THREE.Object3D): Behaviour[];
|
|
770
|
+
static iterateComponents(go: GameObject | THREE.Object3D): Generator<any, void, unknown>;
|
|
771
|
+
abstract addNewComponent<T>(type: Constructor<T>): T | null;
|
|
772
|
+
abstract removeComponent(comp: Component): Component;
|
|
773
|
+
abstract getOrAddComponent<T>(go: GameObject | THREE.Object3D, typeName: Constructor<T> | null): T;
|
|
774
|
+
abstract getComponent<T>(type: Constructor<T>): T | null;
|
|
775
|
+
abstract getComponents<T>(type: Constructor<T>, arr?: T[]): Array<T>;
|
|
776
|
+
abstract getComponentInChildren<T>(type: Constructor<T>): T | null;
|
|
777
|
+
abstract getComponentsInChildren<T>(type: Constructor<T>, arr?: T[]): Array<T>;
|
|
778
|
+
abstract getComponentInParent<T>(type: Constructor<T>): T | null;
|
|
779
|
+
abstract getComponentsInParent<T>(type: Constructor<T>, arr?: T[]): Array<T>;
|
|
780
|
+
}
|
|
781
|
+
class Component implements EventTarget {
|
|
782
|
+
get isComponent(): boolean;
|
|
783
|
+
private __context;
|
|
784
|
+
get context(): Context;
|
|
785
|
+
set context(context: Context);
|
|
786
|
+
get scene(): THREE.Scene;
|
|
787
|
+
get layer(): number;
|
|
788
|
+
get name(): string;
|
|
789
|
+
private __name?;
|
|
790
|
+
set name(str: string);
|
|
791
|
+
get tag(): string;
|
|
792
|
+
set tag(str: string);
|
|
793
|
+
get static(): any;
|
|
794
|
+
get hideFlags(): HideFlags;
|
|
795
|
+
get activeAndEnabled(): boolean;
|
|
796
|
+
private get __isActive();
|
|
797
|
+
private get __isActiveInHierarchy();
|
|
798
|
+
gameObject: GameObject;
|
|
799
|
+
guid: string;
|
|
800
|
+
sourceId?: SourceIdentifier;
|
|
801
|
+
/** called on a component with a map of old to new guids (e.g. when instantiate generated new guids and e.g. timeline track bindings needs to remape them) */
|
|
802
|
+
resolveGuids?(guidsMap: GuidsMap): void;
|
|
886
803
|
awake(): void;
|
|
887
|
-
start(): void;
|
|
888
804
|
onEnable(): void;
|
|
889
805
|
onDisable(): void;
|
|
890
806
|
onDestroy(): void;
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
private
|
|
921
|
-
private
|
|
922
|
-
private
|
|
923
|
-
private
|
|
924
|
-
private
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
private
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
807
|
+
start?(): void;
|
|
808
|
+
earlyUpdate?(): void;
|
|
809
|
+
update?(): void;
|
|
810
|
+
lateUpdate?(): void;
|
|
811
|
+
onBeforeRender?(frame: THREE.XRFrame | null): void;
|
|
812
|
+
onAfterRender?(): void;
|
|
813
|
+
onCollisionEnter?(col: Collision): any;
|
|
814
|
+
onCollisionExit?(col: Collision): any;
|
|
815
|
+
onCollisionStay?(col: Collision): any;
|
|
816
|
+
startCoroutine(routine: Generator, evt?: FrameEvent): Generator;
|
|
817
|
+
stopCoroutine(routine: Generator, evt?: FrameEvent): void;
|
|
818
|
+
get destroyed(): boolean;
|
|
819
|
+
destroy(): void;
|
|
820
|
+
protected __didAwake: boolean;
|
|
821
|
+
private __didStart;
|
|
822
|
+
protected __didEnable: boolean;
|
|
823
|
+
protected __isEnabled: boolean | undefined;
|
|
824
|
+
private __destroyed;
|
|
825
|
+
__internalNewInstanceCreated(): void;
|
|
826
|
+
__internalAwake(): void;
|
|
827
|
+
__internalStart(): void;
|
|
828
|
+
__internalEnable(): void;
|
|
829
|
+
__internalDisable(): void;
|
|
830
|
+
constructor();
|
|
831
|
+
private _collisionExitRoutine;
|
|
832
|
+
private _collisions;
|
|
833
|
+
private __internalResetsCachedPhysicsData;
|
|
834
|
+
__internalHandleCollision(col: Collision): void;
|
|
835
|
+
sendExitCollisionEvent(obj: Object3D): void;
|
|
836
|
+
private __waitForCollisionExit;
|
|
837
|
+
private static _worldPositionBuffer;
|
|
838
|
+
private static _worldQuaternionBuffer;
|
|
839
|
+
private static _worldEulerBuffer;
|
|
840
|
+
private _worldPosition;
|
|
841
|
+
private _worldQuaternion;
|
|
842
|
+
private static _tempQuaternionBuffer2;
|
|
843
|
+
private _worldEuler;
|
|
844
|
+
private _worldRotation;
|
|
845
|
+
get worldPosition(): THREE.Vector3;
|
|
846
|
+
set worldPosition(val: THREE.Vector3);
|
|
847
|
+
setWorldPosition(x: number, y: number, z: number): void;
|
|
848
|
+
get worldQuaternion(): THREE.Quaternion;
|
|
849
|
+
set worldQuaternion(val: THREE.Quaternion);
|
|
850
|
+
setWorldQuaternion(x: number, y: number, z: number, w: number): void;
|
|
851
|
+
get worldEuler(): THREE.Euler;
|
|
852
|
+
set worldEuler(val: THREE.Euler);
|
|
853
|
+
get worldRotation(): THREE.Vector3;
|
|
854
|
+
set worldRotation(val: THREE.Vector3);
|
|
855
|
+
setWorldRotation(x: number, y: number, z: number, degrees?: boolean): void;
|
|
856
|
+
private static _forward;
|
|
857
|
+
get forward(): THREE.Vector3;
|
|
858
|
+
private _eventListeners;
|
|
859
|
+
addEventListener(type: string, listener: EventListener): void;
|
|
860
|
+
removeEventListener(type: string, listener: EventListener): void;
|
|
861
|
+
dispatchEvent(evt: Event): boolean;
|
|
862
|
+
}
|
|
863
|
+
class Behaviour extends Component {
|
|
864
|
+
get enabled(): boolean;
|
|
865
|
+
set enabled(val: boolean);
|
|
932
866
|
}
|
|
867
|
+
export { Behaviour, Component, GameObject };
|
|
933
868
|
}
|
|
934
|
-
declare module "engine/extensions/
|
|
935
|
-
import {
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
export class NEEDLE_render_objects implements GLTFLoaderPlugin {
|
|
939
|
-
private static stencils;
|
|
940
|
-
static applyStencil(obj?: Renderer | null): void;
|
|
941
|
-
private parser;
|
|
942
|
-
private source;
|
|
943
|
-
constructor(parser: GLTFParser, source: SourceIdentifier);
|
|
944
|
-
afterRoot(_result: GLTF): Promise<void> | null;
|
|
869
|
+
declare module "engine/extensions/extension_resolver" {
|
|
870
|
+
import { GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
871
|
+
export interface IExtensionReferenceResolver {
|
|
872
|
+
resolve(parser: GLTFParser, path: string): Promise<void> | null;
|
|
945
873
|
}
|
|
946
|
-
export const EXTENSION_NAME = "NEEDLE_render_objects";
|
|
947
874
|
}
|
|
948
|
-
declare module "engine/
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
export function setDracoDecoderPath(path: string | undefined): void;
|
|
952
|
-
export function setDracoDecoderType(type: string | undefined): void;
|
|
953
|
-
export function setKtx2TranscoderPath(path: string): void;
|
|
954
|
-
export function addDracoAndKTX2Loaders(loader: GLTFLoader, context: Context): void;
|
|
875
|
+
declare module "engine/engine_default_parameters" {
|
|
876
|
+
export const showGizmos: string | boolean;
|
|
877
|
+
export const debugExtension: string | boolean;
|
|
955
878
|
}
|
|
956
|
-
declare module "engine/extensions/
|
|
957
|
-
import {
|
|
879
|
+
declare module "engine/extensions/extension_utils" {
|
|
880
|
+
import { GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
881
|
+
export function resolveReferences(parser: GLTFParser, obj: any): Promise<void | void[]>;
|
|
882
|
+
}
|
|
883
|
+
declare module "engine/engine_typestore" {
|
|
884
|
+
class _TypeStore {
|
|
885
|
+
private _types;
|
|
886
|
+
add(key: any, type: any): void;
|
|
887
|
+
get(key: any): any;
|
|
888
|
+
}
|
|
889
|
+
export const TypeStore: _TypeStore;
|
|
890
|
+
}
|
|
891
|
+
declare module "engine/extensions/NEEDLE_persistent_assets" {
|
|
958
892
|
import { GLTF, GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
959
|
-
import {
|
|
960
|
-
|
|
961
|
-
export
|
|
962
|
-
export class
|
|
963
|
-
static assignTextureLOD(context: Context, source: SourceIdentifier | undefined, material: Material, level?: number): void;
|
|
893
|
+
import { IExtensionReferenceResolver } from "engine/extensions/extension_resolver";
|
|
894
|
+
export const EXTENSION_NAME = "NEEDLE_persistent_assets";
|
|
895
|
+
export function isPersistentAsset(asset: any): boolean;
|
|
896
|
+
export class NEEDLE_persistent_assets implements GLTFLoaderPlugin, IExtensionReferenceResolver {
|
|
964
897
|
get name(): string;
|
|
965
898
|
private parser;
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
private _loading;
|
|
970
|
-
afterRoot(gltf: GLTF): null;
|
|
971
|
-
private static cache;
|
|
972
|
-
private static resolved;
|
|
973
|
-
private static getOrLoadTexture;
|
|
899
|
+
constructor(parser: GLTFParser);
|
|
900
|
+
afterRoot(_result: GLTF): Promise<void>;
|
|
901
|
+
resolve(parser: GLTFParser, path: string): Promise<void> | null | any;
|
|
974
902
|
}
|
|
975
903
|
}
|
|
976
|
-
declare module "engine
|
|
977
|
-
import {
|
|
978
|
-
import
|
|
979
|
-
import {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
}
|
|
990
|
-
class
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
private getMaterial;
|
|
904
|
+
declare module "engine/engine_serialization_core" {
|
|
905
|
+
import { GLTF } from "three/examples/jsm/loaders/GLTFLoader";
|
|
906
|
+
import { Object3D } from "three";
|
|
907
|
+
import { Context } from "engine/engine_setup";
|
|
908
|
+
import { SourceIdentifier } from "engine/engine_gltf";
|
|
909
|
+
export type Constructor<T> = {
|
|
910
|
+
new (...args: any[]): T;
|
|
911
|
+
};
|
|
912
|
+
export type NodeToObjectMap = {
|
|
913
|
+
[nodeId: string]: Object3D;
|
|
914
|
+
};
|
|
915
|
+
export type ObjectToNodeMap = {
|
|
916
|
+
[uuid: string]: number;
|
|
917
|
+
};
|
|
918
|
+
class SerializationHelper {
|
|
919
|
+
register(type: string, ser: ITypeSerializer): void;
|
|
920
|
+
typeMap: {
|
|
921
|
+
[type: string]: ITypeSerializer;
|
|
922
|
+
};
|
|
923
|
+
getSerializer(type: string): ITypeSerializer | undefined;
|
|
924
|
+
getSerializerForConstructor(type: any, level?: number): ITypeSerializer | undefined;
|
|
998
925
|
}
|
|
999
|
-
export
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
lightmapScaleOffset: THREE.Vector4;
|
|
1004
|
-
enableInstancing: boolean[] | undefined;
|
|
1005
|
-
renderOrder: number[] | undefined;
|
|
1006
|
-
allowOcclusionWhenDynamic: boolean;
|
|
1007
|
-
private _lightmaps?;
|
|
1008
|
-
get material(): THREE.Material;
|
|
1009
|
-
set material(mat: THREE.Material);
|
|
1010
|
-
private _sharedMaterials;
|
|
1011
|
-
get sharedMaterials(): SharedMaterialArray;
|
|
1012
|
-
static get shouldSuppressInstancing(): string | boolean;
|
|
1013
|
-
private _lightmapTextureOverride;
|
|
1014
|
-
get lightmap(): Texture | null;
|
|
1015
|
-
set lightmap(tex: Texture | null | undefined);
|
|
1016
|
-
get hasLightmap(): boolean;
|
|
1017
|
-
awake(): void;
|
|
1018
|
-
private _isInstancingEnabled;
|
|
1019
|
-
private handles;
|
|
1020
|
-
private prevLayers;
|
|
1021
|
-
private clearInstancingState;
|
|
1022
|
-
setInstancingEnabled(enabled: boolean): boolean;
|
|
1023
|
-
start(): void;
|
|
1024
|
-
onEnable(): void;
|
|
1025
|
-
onDisable(): void;
|
|
1026
|
-
onDestroy(): void;
|
|
1027
|
-
applyStencil(): void;
|
|
1028
|
-
onBeforeRenderThree(_renderer: any, _scene: any, _camera: any, _geometry: any, material: any, _group: any): void;
|
|
1029
|
-
onBeforeRender(): void;
|
|
1030
|
-
onAfterRender(): void;
|
|
1031
|
-
private applySettings;
|
|
926
|
+
export const helper: SerializationHelper;
|
|
927
|
+
export interface ITypeSerializer {
|
|
928
|
+
onSerialize(data: any, context: SerializationContext): any;
|
|
929
|
+
onDeserialize(data: any, context: SerializationContext): any;
|
|
1032
930
|
}
|
|
1033
|
-
|
|
931
|
+
/**
|
|
932
|
+
* implement and call super(<type string or array>) with the type names this serializer can handle
|
|
933
|
+
* for example:
|
|
934
|
+
* class ColorSerializer extends TypeSerializer {
|
|
935
|
+
* constructor() {
|
|
936
|
+
* super("Color")
|
|
937
|
+
* }
|
|
938
|
+
* }
|
|
939
|
+
*/
|
|
940
|
+
export abstract class TypeSerializer implements ITypeSerializer {
|
|
941
|
+
constructor(type: Constructor<any> | Constructor<any>[]);
|
|
942
|
+
abstract onSerialize(data: any, context: SerializationContext): any | void;
|
|
943
|
+
abstract onDeserialize(data: any, context: SerializationContext): any | void;
|
|
1034
944
|
}
|
|
1035
|
-
export
|
|
1036
|
-
|
|
945
|
+
export interface ITypeInformation {
|
|
946
|
+
type?: Constructor<any>;
|
|
1037
947
|
}
|
|
1038
|
-
export
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
948
|
+
export class SerializationContext {
|
|
949
|
+
root: THREE.Object3D;
|
|
950
|
+
gltf?: GLTF;
|
|
951
|
+
gltfId?: SourceIdentifier;
|
|
952
|
+
object: THREE.Object3D;
|
|
953
|
+
target?: object;
|
|
954
|
+
nodeId?: number;
|
|
955
|
+
nodeToObject?: NodeToObjectMap;
|
|
956
|
+
objectToNode?: ObjectToNodeMap;
|
|
957
|
+
context?: Context;
|
|
958
|
+
path?: string;
|
|
959
|
+
constructor(root: THREE.Object3D);
|
|
1043
960
|
}
|
|
1044
|
-
export
|
|
1045
|
-
|
|
961
|
+
export interface ISerializable {
|
|
962
|
+
$serializedTypes?: {
|
|
963
|
+
[key: string]: Constructor<any> | ITypeInformation | null;
|
|
964
|
+
};
|
|
965
|
+
onBeforeDeserialize?(data: any, context: SerializationContext): void | undefined | boolean;
|
|
966
|
+
onBeforeDeserializeMember?(key: string, data: any, context: SerializationContext): void | undefined | boolean;
|
|
967
|
+
onAfterDeserializeMember?(key: string, data: any, context: SerializationContext): void;
|
|
968
|
+
onAfterDeserialize?(data: any, context: SerializationContext): void;
|
|
1046
969
|
}
|
|
970
|
+
export function serializeObject(obj: ISerializable, context: SerializationContext): object | null;
|
|
971
|
+
export function deserializeObject(obj: ISerializable, serializedData: object, context: SerializationContext): boolean;
|
|
972
|
+
/** Object.assign behaviour but check if property is writeable (e.g. getter only properties are skipped) */
|
|
973
|
+
export function assign(target: any, source: any): void;
|
|
1047
974
|
}
|
|
1048
|
-
declare module "engine/
|
|
1049
|
-
import * as CANNON from 'cannon-es';
|
|
975
|
+
declare module "engine/engine_input" {
|
|
1050
976
|
import * as THREE from 'three';
|
|
1051
977
|
import { Context } from "engine/engine_setup";
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
export class CollisionData {
|
|
1066
|
-
obj: THREE.Object3D | null;
|
|
1067
|
-
contact: CANNON.ContactEquation;
|
|
1068
|
-
target: THREE.Object3D | null;
|
|
1069
|
-
type: string;
|
|
1070
|
-
constructor(contact: CANNON.ContactEquation, type: string);
|
|
1071
|
-
}
|
|
1072
|
-
export class RaycastOptions {
|
|
1073
|
-
ray: THREE.Ray | undefined;
|
|
1074
|
-
cam: THREE.Camera | undefined | null;
|
|
1075
|
-
screenPoint: THREE.Vector2 | undefined;
|
|
1076
|
-
raycaster: THREE.Raycaster | undefined;
|
|
1077
|
-
results: Array<THREE.Intersection> | undefined;
|
|
1078
|
-
targets: Array<THREE.Object3D> | undefined;
|
|
1079
|
-
recursive: boolean | undefined;
|
|
1080
|
-
minDistance: number | undefined;
|
|
1081
|
-
maxDistance: number | undefined;
|
|
1082
|
-
lineThreshold: number | undefined;
|
|
1083
|
-
layerMask: THREE.Layers | number | undefined;
|
|
1084
|
-
ignore: THREE.Object3D[] | undefined;
|
|
1085
|
-
screenPointFromOffset(ox: number, oy: number): void;
|
|
1086
|
-
setMask(mask: number): void;
|
|
1087
|
-
static AllLayers: number;
|
|
1088
|
-
}
|
|
1089
|
-
export class SphereIntersection implements THREE.Intersection {
|
|
1090
|
-
distance: number;
|
|
1091
|
-
point: THREE.Vector3;
|
|
1092
|
-
object: THREE.Object3D;
|
|
1093
|
-
constructor(object: THREE.Object3D, distance: number, point: THREE.Vector3);
|
|
978
|
+
export type PointerEventArgs = {
|
|
979
|
+
button: number;
|
|
980
|
+
clientX: number;
|
|
981
|
+
clientY: number;
|
|
982
|
+
pointerId?: number;
|
|
983
|
+
pointerType: string;
|
|
984
|
+
source?: Event;
|
|
985
|
+
};
|
|
986
|
+
export class KeyEventArgs {
|
|
987
|
+
key: string;
|
|
988
|
+
keyType: string;
|
|
989
|
+
source?: Event;
|
|
990
|
+
constructor(evt: KeyboardEvent);
|
|
1094
991
|
}
|
|
1095
|
-
export
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
get
|
|
1108
|
-
|
|
992
|
+
export enum InputEvents {
|
|
993
|
+
PointerDown = "pointerdown",
|
|
994
|
+
PointerUp = "pointerup",
|
|
995
|
+
PointerMove = "pointermove",
|
|
996
|
+
KeyDown = "keydown",
|
|
997
|
+
KeyUp = "keyup",
|
|
998
|
+
KeyPressed = "keypress"
|
|
999
|
+
}
|
|
1000
|
+
export class Input extends EventTarget {
|
|
1001
|
+
_doubleClickTimeThreshold: number;
|
|
1002
|
+
_longPressTimeThreshold: number;
|
|
1003
|
+
get mousePosition(): THREE.Vector2;
|
|
1004
|
+
get mousePositionRC(): THREE.Vector2;
|
|
1005
|
+
get mouseDown(): boolean;
|
|
1006
|
+
get mouseUp(): boolean;
|
|
1007
|
+
get mouseClick(): boolean;
|
|
1008
|
+
get mouseDoubleClick(): boolean;
|
|
1009
|
+
get mousePressed(): boolean;
|
|
1010
|
+
get mouseWheelChanged(): boolean;
|
|
1011
|
+
private _specialCursorTrigger;
|
|
1012
|
+
setCursorPointer(): void;
|
|
1013
|
+
setCursorNormal(): void;
|
|
1014
|
+
getPointerPressedCount(): number;
|
|
1015
|
+
getPointerPosition(i: number): THREE.Vector2 | null;
|
|
1016
|
+
getPointerPositionLastFrame(i: number): THREE.Vector2 | null;
|
|
1017
|
+
getPointerPositionDelta(i: number): THREE.Vector2 | null;
|
|
1018
|
+
getPointerPositionRC(i: number): THREE.Vector2 | null;
|
|
1019
|
+
getPointerDown(i: number): boolean;
|
|
1020
|
+
getPointerUp(i: number): boolean;
|
|
1021
|
+
getPointerPressed(i: number): boolean;
|
|
1022
|
+
getPointerClicked(i: number): boolean;
|
|
1023
|
+
getPointerDoubleClicked(i: number): boolean;
|
|
1024
|
+
getPointerDownTime(i: number): number;
|
|
1025
|
+
getPointerUpTime(i: number): number;
|
|
1026
|
+
getPointerLongPress(i: number): boolean;
|
|
1027
|
+
getIsMouse(i: number): boolean;
|
|
1028
|
+
getIsTouch(i: number): boolean;
|
|
1029
|
+
getTouchesPressedCount(): number;
|
|
1030
|
+
getMouseWheelChanged(i?: number): boolean;
|
|
1031
|
+
getPointerEvent(i: number): Event | undefined;
|
|
1109
1032
|
private context;
|
|
1110
|
-
private
|
|
1111
|
-
private
|
|
1112
|
-
private
|
|
1113
|
-
private
|
|
1033
|
+
private _pointerDown;
|
|
1034
|
+
private _pointerUp;
|
|
1035
|
+
private _pointerClick;
|
|
1036
|
+
private _pointerDoubleClick;
|
|
1037
|
+
private _pointerPressed;
|
|
1038
|
+
private _pointerPositions;
|
|
1039
|
+
private _pointerPositionsLastFrame;
|
|
1040
|
+
private _pointerPositionsDelta;
|
|
1041
|
+
private _pointerPositionsRC;
|
|
1042
|
+
private _pointerPositionDown;
|
|
1043
|
+
private _pointerDownTime;
|
|
1044
|
+
private _pointerUpTime;
|
|
1045
|
+
private _pointerIds;
|
|
1046
|
+
private _pointerTypes;
|
|
1047
|
+
private _mouseWheelChanged;
|
|
1048
|
+
private _pointerEvent;
|
|
1049
|
+
getKeyDown(): string | null;
|
|
1050
|
+
getKeyPressed(): string | null;
|
|
1051
|
+
isKeyDown(keyCode: number): boolean;
|
|
1052
|
+
isKeyUp(keyCode: number): boolean;
|
|
1053
|
+
isKeyPressed(keyCode: number): boolean;
|
|
1054
|
+
createPointerDown(args: PointerEventArgs): void;
|
|
1055
|
+
createPointerMove(args: PointerEventArgs): void;
|
|
1056
|
+
createPointerUp(args: PointerEventArgs): void;
|
|
1114
1057
|
constructor(context: Context);
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
private
|
|
1128
|
-
private
|
|
1129
|
-
|
|
1130
|
-
private
|
|
1131
|
-
private
|
|
1132
|
-
|
|
1133
|
-
private
|
|
1134
|
-
private
|
|
1135
|
-
private
|
|
1136
|
-
|
|
1058
|
+
private onLostFocus;
|
|
1059
|
+
private onEndOfFrame;
|
|
1060
|
+
private keysPressed;
|
|
1061
|
+
private onKeyDown;
|
|
1062
|
+
private onKeyPressed;
|
|
1063
|
+
private onKeyUp;
|
|
1064
|
+
private onMouseWheel;
|
|
1065
|
+
private onTouchMove;
|
|
1066
|
+
private onTouchUp;
|
|
1067
|
+
private onPointerDown;
|
|
1068
|
+
private onPointerMove;
|
|
1069
|
+
private onPointerUp;
|
|
1070
|
+
private isInRect;
|
|
1071
|
+
private onDown;
|
|
1072
|
+
private onMove;
|
|
1073
|
+
private onUp;
|
|
1074
|
+
private updatePointerPosition;
|
|
1075
|
+
private getPointerIndex;
|
|
1076
|
+
private setPointerState;
|
|
1077
|
+
private setPointerStateT;
|
|
1078
|
+
private onDispatchEvent;
|
|
1079
|
+
}
|
|
1080
|
+
export enum KeyCode {
|
|
1081
|
+
BACKSPACE = 8,
|
|
1082
|
+
TAB = 9,
|
|
1083
|
+
ENTER = 13,
|
|
1084
|
+
SHIFT = 16,
|
|
1085
|
+
CTRL = 17,
|
|
1086
|
+
ALT = 18,
|
|
1087
|
+
PAUSE = 19,
|
|
1088
|
+
CAPS_LOCK = 20,
|
|
1089
|
+
ESCAPE = 27,
|
|
1090
|
+
SPACE = 32,
|
|
1091
|
+
PAGE_UP = 33,
|
|
1092
|
+
PAGE_DOWN = 34,
|
|
1093
|
+
END = 35,
|
|
1094
|
+
HOME = 36,
|
|
1095
|
+
LEFT_ARROW = 37,
|
|
1096
|
+
UP_ARROW = 38,
|
|
1097
|
+
RIGHT_ARROW = 39,
|
|
1098
|
+
DOWN_ARROW = 40,
|
|
1099
|
+
INSERT = 45,
|
|
1100
|
+
DELETE = 46,
|
|
1101
|
+
KEY_0 = 48,
|
|
1102
|
+
KEY_1 = 49,
|
|
1103
|
+
KEY_2 = 50,
|
|
1104
|
+
KEY_3 = 51,
|
|
1105
|
+
KEY_4 = 52,
|
|
1106
|
+
KEY_5 = 53,
|
|
1107
|
+
KEY_6 = 54,
|
|
1108
|
+
KEY_7 = 55,
|
|
1109
|
+
KEY_8 = 56,
|
|
1110
|
+
KEY_9 = 57,
|
|
1111
|
+
KEY_A = 65,
|
|
1112
|
+
KEY_B = 66,
|
|
1113
|
+
KEY_C = 67,
|
|
1114
|
+
KEY_D = 68,
|
|
1115
|
+
KEY_E = 69,
|
|
1116
|
+
KEY_F = 70,
|
|
1117
|
+
KEY_G = 71,
|
|
1118
|
+
KEY_H = 72,
|
|
1119
|
+
KEY_I = 73,
|
|
1120
|
+
KEY_J = 74,
|
|
1121
|
+
KEY_K = 75,
|
|
1122
|
+
KEY_L = 76,
|
|
1123
|
+
KEY_M = 77,
|
|
1124
|
+
KEY_N = 78,
|
|
1125
|
+
KEY_O = 79,
|
|
1126
|
+
KEY_P = 80,
|
|
1127
|
+
KEY_Q = 81,
|
|
1128
|
+
KEY_R = 82,
|
|
1129
|
+
KEY_S = 83,
|
|
1130
|
+
KEY_T = 84,
|
|
1131
|
+
KEY_U = 85,
|
|
1132
|
+
KEY_V = 86,
|
|
1133
|
+
KEY_W = 87,
|
|
1134
|
+
KEY_X = 88,
|
|
1135
|
+
KEY_Y = 89,
|
|
1136
|
+
KEY_Z = 90,
|
|
1137
|
+
LEFT_META = 91,
|
|
1138
|
+
RIGHT_META = 92,
|
|
1139
|
+
SELECT = 93,
|
|
1140
|
+
NUMPAD_0 = 96,
|
|
1141
|
+
NUMPAD_1 = 97,
|
|
1142
|
+
NUMPAD_2 = 98,
|
|
1143
|
+
NUMPAD_3 = 99,
|
|
1144
|
+
NUMPAD_4 = 100,
|
|
1145
|
+
NUMPAD_5 = 101,
|
|
1146
|
+
NUMPAD_6 = 102,
|
|
1147
|
+
NUMPAD_7 = 103,
|
|
1148
|
+
NUMPAD_8 = 104,
|
|
1149
|
+
NUMPAD_9 = 105,
|
|
1150
|
+
MULTIPLY = 106,
|
|
1151
|
+
ADD = 107,
|
|
1152
|
+
SUBTRACT = 109,
|
|
1153
|
+
DECIMAL = 110,
|
|
1154
|
+
DIVIDE = 111,
|
|
1155
|
+
F1 = 112,
|
|
1156
|
+
F2 = 113,
|
|
1157
|
+
F3 = 114,
|
|
1158
|
+
F4 = 115,
|
|
1159
|
+
F5 = 116,
|
|
1160
|
+
F6 = 117,
|
|
1161
|
+
F7 = 118,
|
|
1162
|
+
F8 = 119,
|
|
1163
|
+
F9 = 120,
|
|
1164
|
+
F10 = 121,
|
|
1165
|
+
F11 = 122,
|
|
1166
|
+
F12 = 123,
|
|
1167
|
+
NUM_LOCK = 144,
|
|
1168
|
+
SCROLL_LOCK = 145,
|
|
1169
|
+
SEMICOLON = 186,
|
|
1170
|
+
EQUALS = 187,
|
|
1171
|
+
COMMA = 188,
|
|
1172
|
+
DASH = 189,
|
|
1173
|
+
PERIOD = 190,
|
|
1174
|
+
FORWARD_SLASH = 191,
|
|
1175
|
+
GRAVE_ACCENT = 192,
|
|
1176
|
+
OPEN_BRACKET = 219,
|
|
1177
|
+
BACK_SLASH = 220,
|
|
1178
|
+
CLOSE_BRACKET = 221,
|
|
1179
|
+
SINGLE_QUOTE = 222
|
|
1137
1180
|
}
|
|
1138
1181
|
}
|
|
1139
1182
|
declare module "engine/engine_time" {
|
|
@@ -3344,29 +3387,6 @@ declare module "engine-components/BoxHelperComponent" {
|
|
|
3344
3387
|
showHelper(col?: THREE.ColorRepresentation | null, force?: boolean): void;
|
|
3345
3388
|
}
|
|
3346
3389
|
}
|
|
3347
|
-
declare module "engine-components/Collider" {
|
|
3348
|
-
import { Behaviour } from "engine-components/Component";
|
|
3349
|
-
import { Rigidbody } from "engine-components/Rigidbody";
|
|
3350
|
-
import { Shape } from "cannon-es";
|
|
3351
|
-
export class Collider extends Behaviour {
|
|
3352
|
-
attachedRigidbody: Rigidbody | null;
|
|
3353
|
-
isTrigger: boolean;
|
|
3354
|
-
protected _shape: Shape | null;
|
|
3355
|
-
awake(): void;
|
|
3356
|
-
onEnable(): void;
|
|
3357
|
-
onDisable(): void;
|
|
3358
|
-
}
|
|
3359
|
-
export class SphereCollider extends Collider {
|
|
3360
|
-
radius: number;
|
|
3361
|
-
center: THREE.Vector3;
|
|
3362
|
-
onEnable(): void;
|
|
3363
|
-
}
|
|
3364
|
-
export class BoxCollider extends Collider {
|
|
3365
|
-
size: THREE.Vector3;
|
|
3366
|
-
center: THREE.Vector3;
|
|
3367
|
-
onEnable(): void;
|
|
3368
|
-
}
|
|
3369
|
-
}
|
|
3370
3390
|
declare module "engine-components/ComponentExtensions" {
|
|
3371
3391
|
export class UnityObject {
|
|
3372
3392
|
}
|
|
@@ -3764,6 +3784,7 @@ declare module "engine/engine_input_utils" {
|
|
|
3764
3784
|
declare module "engine-components/VideoPlayer" {
|
|
3765
3785
|
import { Behaviour } from "engine-components/Component";
|
|
3766
3786
|
import * as THREE from "three";
|
|
3787
|
+
import { Object3D } from "three";
|
|
3767
3788
|
export enum VideoSource {
|
|
3768
3789
|
VideoClip = 0,
|
|
3769
3790
|
Url = 1
|
|
@@ -3810,6 +3831,7 @@ declare module "engine-components/VideoPlayer" {
|
|
|
3810
3831
|
private videoMaterial;
|
|
3811
3832
|
private _isPlaying;
|
|
3812
3833
|
private wasPlaying;
|
|
3834
|
+
setVideo(video: MediaStream): void;
|
|
3813
3835
|
setClipURL(url: string): void;
|
|
3814
3836
|
awake(): void;
|
|
3815
3837
|
onEnable(): void;
|
|
@@ -3821,6 +3843,8 @@ declare module "engine-components/VideoPlayer" {
|
|
|
3821
3843
|
stop(): void;
|
|
3822
3844
|
pause(): void;
|
|
3823
3845
|
create(playAutomatically: boolean): void;
|
|
3846
|
+
private _targetObjects;
|
|
3847
|
+
getTargetObjects(): Array<Object3D>;
|
|
3824
3848
|
private createVideoElement;
|
|
3825
3849
|
private handleBeginPlaying;
|
|
3826
3850
|
private updateVideoElementSettings;
|
|
@@ -3829,14 +3853,43 @@ declare module "engine-components/VideoPlayer" {
|
|
|
3829
3853
|
}
|
|
3830
3854
|
declare module "engine-components/ScreenCapture" {
|
|
3831
3855
|
import { Behaviour } from "engine-components/Component";
|
|
3832
|
-
|
|
3833
|
-
|
|
3856
|
+
import { IPointerClickHandler } from "engine-components/ui/PointerEvents";
|
|
3857
|
+
export enum ScreenCaptureDevice {
|
|
3858
|
+
Screen = 0,
|
|
3859
|
+
Camera = 1
|
|
3860
|
+
}
|
|
3861
|
+
export enum ScreenCaptureMode {
|
|
3862
|
+
Idle = 0,
|
|
3863
|
+
Sending = 1,
|
|
3864
|
+
Receiving = 2
|
|
3865
|
+
}
|
|
3866
|
+
export enum AspectMode {
|
|
3867
|
+
None = 0,
|
|
3868
|
+
AdjustHeight = 1,
|
|
3869
|
+
AdjustWidth = 2
|
|
3870
|
+
}
|
|
3871
|
+
export class ScreenCapture extends Behaviour implements IPointerClickHandler {
|
|
3872
|
+
onPointerClick(): void;
|
|
3873
|
+
device: ScreenCaptureDevice;
|
|
3874
|
+
aspectMode: AspectMode;
|
|
3875
|
+
get isSending(): boolean | null;
|
|
3876
|
+
get isReceiving(): boolean | null;
|
|
3877
|
+
private _net?;
|
|
3878
|
+
private _video?;
|
|
3879
|
+
private _requestOpen;
|
|
3880
|
+
private _currentStream;
|
|
3881
|
+
private _currentMode;
|
|
3882
|
+
awake(): void;
|
|
3834
3883
|
start(): void;
|
|
3835
|
-
|
|
3836
|
-
private captureStream;
|
|
3837
|
-
open(force?: boolean): Promise<void>;
|
|
3884
|
+
share(): Promise<void>;
|
|
3838
3885
|
close(): void;
|
|
3839
|
-
private
|
|
3886
|
+
private setVideo;
|
|
3887
|
+
private onReceiveVideo;
|
|
3888
|
+
private tryShareUserCamera;
|
|
3889
|
+
private _targetObjects?;
|
|
3890
|
+
private updateAspect;
|
|
3891
|
+
private _updateAspectRoutineId;
|
|
3892
|
+
private updateAspectImpl;
|
|
3840
3893
|
}
|
|
3841
3894
|
}
|
|
3842
3895
|
declare module "engine-components/ShadowCatcher" {
|
|
@@ -5065,6 +5118,7 @@ declare module "needle-engine" {
|
|
|
5065
5118
|
import "engine/engine_setup";
|
|
5066
5119
|
export { GameObject, Behaviour } from "engine-components/Component";
|
|
5067
5120
|
export { serializeable } from "engine/engine_serialization_decorator";
|
|
5121
|
+
export { Collision } from "engine/engine_physics";
|
|
5068
5122
|
export * from "engine-components/codegen/exports";
|
|
5069
5123
|
}
|
|
5070
5124
|
declare module "engine/debug/error_overlay" {
|