@needle-tools/engine 2.32.0-pre → 2.34.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 +15 -0
- package/dist/needle-engine.d.ts +195 -164
- package/dist/needle-engine.js +394 -344
- package/dist/needle-engine.js.map +4 -4
- package/dist/needle-engine.min.js +70 -20
- package/dist/needle-engine.min.js.map +4 -4
- package/lib/engine/engine_create_objects.d.ts +11 -0
- package/lib/engine/engine_create_objects.js +20 -0
- package/lib/engine/engine_create_objects.js.map +1 -0
- package/lib/engine/engine_instancing.d.ts +5 -0
- package/lib/engine/engine_instancing.js +22 -0
- package/lib/engine/engine_instancing.js.map +1 -0
- package/lib/engine/engine_physics.d.ts +2 -0
- package/lib/engine/engine_physics.js +7 -1
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_components.js +2 -0
- package/lib/engine/extensions/NEEDLE_components.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_techniques_webgl.d.ts +1 -0
- package/lib/engine/extensions/NEEDLE_techniques_webgl.js +26 -0
- package/lib/engine/extensions/NEEDLE_techniques_webgl.js.map +1 -1
- package/lib/engine-components/Animation.js +1 -1
- package/lib/engine-components/Animation.js.map +1 -1
- package/lib/engine-components/Collider.d.ts +1 -0
- package/lib/engine-components/Collider.js +6 -2
- package/lib/engine-components/Collider.js.map +1 -1
- package/lib/engine-components/Component.js +4 -51
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/DragControls.js +1 -1
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/Renderer.d.ts +0 -3
- package/lib/engine-components/Renderer.js +1 -20
- package/lib/engine-components/Renderer.js.map +1 -1
- package/lib/engine-components/ScreenCapture.d.ts +8 -14
- package/lib/engine-components/ScreenCapture.js +62 -74
- package/lib/engine-components/ScreenCapture.js.map +1 -1
- package/lib/engine-components/SyncedCamera.js +1 -1
- package/lib/engine-components/SyncedCamera.js.map +1 -1
- package/lib/engine-components/SyncedTransform.js +1 -1
- package/lib/engine-components/SyncedTransform.js.map +1 -1
- package/lib/engine-components/VideoPlayer.d.ts +14 -3
- package/lib/engine-components/VideoPlayer.js +390 -47
- package/lib/engine-components/VideoPlayer.js.map +1 -1
- package/lib/engine-components/WebARSessionRoot.js +1 -1
- package/lib/engine-components/WebARSessionRoot.js.map +1 -1
- package/lib/engine-components/WebXRAvatar.js +1 -1
- package/lib/engine-components/WebXRAvatar.js.map +1 -1
- package/lib/engine-components/WebXRController.d.ts +1 -0
- package/lib/engine-components/WebXRController.js +12 -1
- package/lib/engine-components/WebXRController.js.map +1 -1
- package/lib/engine-components/codegen/{exports.d.ts → components.d.ts} +2 -2
- package/{src/engine-components/codegen/exports.ts → lib/engine-components/codegen/components.js} +3 -2
- package/lib/engine-components/codegen/components.js.map +1 -0
- package/lib/engine-components/js-extensions/Object3D.d.ts +2 -0
- package/lib/engine-components/js-extensions/Object3D.js +75 -0
- package/lib/engine-components/js-extensions/Object3D.js.map +1 -0
- package/lib/engine-components/ui/EventSystem.d.ts +3 -0
- package/lib/engine-components/ui/EventSystem.js +17 -8
- package/lib/engine-components/ui/EventSystem.js.map +1 -1
- package/lib/needle-engine.d.ts +2 -1
- package/lib/needle-engine.js +3 -2
- package/lib/needle-engine.js.map +1 -1
- package/package.json +2 -2
- package/src/engine/codegen/register_types.js +2 -4
- package/src/engine/engine_create_objects.ts +27 -0
- package/src/engine/engine_instancing.ts +25 -0
- package/src/engine/engine_physics.ts +9 -1
- package/src/engine/extensions/NEEDLE_components.ts +3 -0
- package/src/engine/extensions/NEEDLE_techniques_webgl.ts +34 -2
- package/src/engine-components/Animation.ts +1 -1
- package/src/engine-components/Collider.ts +7 -2
- package/src/engine-components/Component.ts +4 -64
- package/src/engine-components/DragControls.ts +1 -1
- package/src/engine-components/Renderer.ts +2 -20
- package/src/engine-components/ScreenCapture.ts +62 -75
- package/src/engine-components/SyncedCamera.ts +1 -1
- package/src/engine-components/SyncedTransform.ts +1 -1
- package/src/engine-components/VideoPlayer.ts +401 -48
- package/src/engine-components/WebARSessionRoot.ts +1 -1
- package/src/engine-components/WebXRAvatar.ts +1 -1
- package/src/engine-components/WebXRController.ts +11 -1
- package/{lib/engine-components/codegen/exports.js → src/engine-components/codegen/components.ts} +1 -3
- package/src/engine-components/js-extensions/Object3D.ts +91 -0
- package/src/engine-components/ui/EventSystem.ts +19 -10
- package/src/needle-engine.ts +3 -3
- package/lib/engine-components/ComponentExtensions.d.ts +0 -2
- package/lib/engine-components/ComponentExtensions.js +0 -3
- package/lib/engine-components/ComponentExtensions.js.map +0 -1
- package/lib/engine-components/codegen/exports.js.map +0 -1
- package/src/engine-components/ComponentExtensions.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [2.34.0-pre] - 2022-10-17
|
|
8
|
+
- Add: start adding support for 2D video overlay mode
|
|
9
|
+
- Change: Install threejs from @needle-tools/npm - this removes the requirement to have git installed and should fix a case where pulling the package from github would fail
|
|
10
|
+
- Change: Move Screensharing aspect mode settings into VideoPlayer component
|
|
11
|
+
- Change: Move ``InstancingUtils`` into ``engine/engine_instancing.ts``
|
|
12
|
+
- Change: BoxCollider now checks if ``attachedRigidBody`` is assigned at start
|
|
13
|
+
- Change: Collision now exposes internal cannon data via ``__internalCollision`` property
|
|
14
|
+
- Fix: EventSystem now properly unsubscribes WebXRController events
|
|
15
|
+
|
|
16
|
+
## [2.33.0-pre] - 2022-10-17
|
|
17
|
+
- Add: ScreenCapture has mode for capturing webgl canvas (unfortunately it doesnt seem to work well in Chrome or Firefox yet)
|
|
18
|
+
- Change: move threejs prototype extensions into own file and make available to vanilla js builds
|
|
19
|
+
- Change: ScreenCapture component has explicit VideoPlayer component reference
|
|
20
|
+
- Fix: animating properties on custom shaders
|
|
21
|
+
|
|
7
22
|
## [2.32.0-pre] - 2022-10-15
|
|
8
23
|
- Add: start implementing trigger callbacks for ``onTriggerEnter``, ``onTriggerExit`` and ``onTriggerStay``
|
|
9
24
|
- Change: ``GameObject.setActive`` now updates ``isActiveAndEnabled`` state and executes ``awake`` and ``onEnable`` calls when the object was activated for the first time (e.g. when instantiating from an previously inactive prefab)
|
package/dist/needle-engine.d.ts
CHANGED
|
@@ -414,145 +414,6 @@ declare module "engine-components/Rigidbody" {
|
|
|
414
414
|
private updateVelocity;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
declare module "engine-components/RendererLightmap" {
|
|
418
|
-
import { GameObject } from "engine-components/Component";
|
|
419
|
-
import * as THREE from "three";
|
|
420
|
-
import { Texture } from "three";
|
|
421
|
-
import { Context } from "engine/engine_setup";
|
|
422
|
-
export class RendererLightmap {
|
|
423
|
-
get lightmap(): Texture | null;
|
|
424
|
-
set lightmap(tex: Texture | null);
|
|
425
|
-
lightmapIndex: number;
|
|
426
|
-
lightmapScaleOffset: THREE.Vector4;
|
|
427
|
-
private context;
|
|
428
|
-
private gameObject;
|
|
429
|
-
private lightmapTexture;
|
|
430
|
-
private lightmapScaleOffsetUniform;
|
|
431
|
-
private lightmapUniform;
|
|
432
|
-
private beforeRenderCallback?;
|
|
433
|
-
constructor(gameObject: GameObject, context: Context);
|
|
434
|
-
init(lightmapIndex: number, lightmapScaleOffset: THREE.Vector4, lightmapTexture: THREE.Texture, debug?: boolean): void;
|
|
435
|
-
bindOnBeforeRender(): void;
|
|
436
|
-
private onBeforeRenderThreeComplete;
|
|
437
|
-
private setupLightmap;
|
|
438
|
-
onBeforeRenderThree(material: THREE.Material): void;
|
|
439
|
-
private setLightmapDebugMaterial;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
declare module "engine/extensions/NEEDLE_render_objects" {
|
|
443
|
-
import { SourceIdentifier } from "engine/engine_gltf";
|
|
444
|
-
import { GLTF, GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
445
|
-
import { Renderer } from "engine-components/Renderer";
|
|
446
|
-
export class NEEDLE_render_objects implements GLTFLoaderPlugin {
|
|
447
|
-
private static stencils;
|
|
448
|
-
static applyStencil(obj?: Renderer | null): void;
|
|
449
|
-
private parser;
|
|
450
|
-
private source;
|
|
451
|
-
constructor(parser: GLTFParser, source: SourceIdentifier);
|
|
452
|
-
afterRoot(_result: GLTF): Promise<void> | null;
|
|
453
|
-
}
|
|
454
|
-
export const EXTENSION_NAME = "NEEDLE_render_objects";
|
|
455
|
-
}
|
|
456
|
-
declare module "engine/engine_loaders" {
|
|
457
|
-
import { Context } from "engine/engine_setup";
|
|
458
|
-
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
459
|
-
export function setDracoDecoderPath(path: string | undefined): void;
|
|
460
|
-
export function setDracoDecoderType(type: string | undefined): void;
|
|
461
|
-
export function setKtx2TranscoderPath(path: string): void;
|
|
462
|
-
export function addDracoAndKTX2Loaders(loader: GLTFLoader, context: Context): void;
|
|
463
|
-
}
|
|
464
|
-
declare module "engine/extensions/NEEDLE_deferred_texture" {
|
|
465
|
-
import { Material } from "three";
|
|
466
|
-
import { GLTF, GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
467
|
-
import { SourceIdentifier } from "engine/engine_gltf";
|
|
468
|
-
import { Context } from "engine/engine_setup";
|
|
469
|
-
export const EXTENSION_NAME = "NEEDLE_deferred_texture";
|
|
470
|
-
export class NEEDLE_deferred_texture implements GLTFLoaderPlugin {
|
|
471
|
-
static assignTextureLOD(context: Context, source: SourceIdentifier | undefined, material: Material, level?: number): void;
|
|
472
|
-
get name(): string;
|
|
473
|
-
private parser;
|
|
474
|
-
private sourceId;
|
|
475
|
-
private context;
|
|
476
|
-
constructor(parser: GLTFParser, sourceId: SourceIdentifier, context: Context);
|
|
477
|
-
private _loading;
|
|
478
|
-
afterRoot(gltf: GLTF): null;
|
|
479
|
-
private static cache;
|
|
480
|
-
private static resolved;
|
|
481
|
-
private static getOrLoadTexture;
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
declare module "engine-components/Renderer" {
|
|
485
|
-
import { Behaviour } from "engine-components/Component";
|
|
486
|
-
import * as THREE from "three";
|
|
487
|
-
import { Texture } from "three";
|
|
488
|
-
export class FieldWithDefault {
|
|
489
|
-
path: string | null;
|
|
490
|
-
asset: object | null;
|
|
491
|
-
default: any;
|
|
492
|
-
}
|
|
493
|
-
export enum RenderState {
|
|
494
|
-
Both = 0,
|
|
495
|
-
Back = 1,
|
|
496
|
-
Front = 2
|
|
497
|
-
}
|
|
498
|
-
class SharedMaterialArray {
|
|
499
|
-
private _renderer;
|
|
500
|
-
private _targets;
|
|
501
|
-
is(renderer: Renderer): boolean;
|
|
502
|
-
constructor(renderer: Renderer);
|
|
503
|
-
get length(): number;
|
|
504
|
-
private setMaterial;
|
|
505
|
-
private getMaterial;
|
|
506
|
-
}
|
|
507
|
-
export class Renderer extends Behaviour {
|
|
508
|
-
receiveShadows: boolean;
|
|
509
|
-
shadowCastingMode: ShadowCastingMode;
|
|
510
|
-
lightmapIndex: number;
|
|
511
|
-
lightmapScaleOffset: THREE.Vector4;
|
|
512
|
-
enableInstancing: boolean[] | undefined;
|
|
513
|
-
renderOrder: number[] | undefined;
|
|
514
|
-
allowOcclusionWhenDynamic: boolean;
|
|
515
|
-
private _lightmaps?;
|
|
516
|
-
get material(): THREE.Material;
|
|
517
|
-
set material(mat: THREE.Material);
|
|
518
|
-
private _sharedMaterials;
|
|
519
|
-
get sharedMaterials(): SharedMaterialArray;
|
|
520
|
-
static get shouldSuppressInstancing(): string | boolean;
|
|
521
|
-
private _lightmapTextureOverride;
|
|
522
|
-
get lightmap(): Texture | null;
|
|
523
|
-
set lightmap(tex: Texture | null | undefined);
|
|
524
|
-
get hasLightmap(): boolean;
|
|
525
|
-
awake(): void;
|
|
526
|
-
private _isInstancingEnabled;
|
|
527
|
-
private handles;
|
|
528
|
-
private prevLayers;
|
|
529
|
-
private clearInstancingState;
|
|
530
|
-
setInstancingEnabled(enabled: boolean): boolean;
|
|
531
|
-
start(): void;
|
|
532
|
-
onEnable(): void;
|
|
533
|
-
onDisable(): void;
|
|
534
|
-
onDestroy(): void;
|
|
535
|
-
applyStencil(): void;
|
|
536
|
-
onBeforeRenderThree(_renderer: any, _scene: any, _camera: any, _geometry: any, material: any, _group: any): void;
|
|
537
|
-
onBeforeRender(): void;
|
|
538
|
-
onAfterRender(): void;
|
|
539
|
-
private applySettings;
|
|
540
|
-
}
|
|
541
|
-
export class MeshRenderer extends Renderer {
|
|
542
|
-
}
|
|
543
|
-
export class SkinnedMeshRenderer extends MeshRenderer {
|
|
544
|
-
awake(): void;
|
|
545
|
-
}
|
|
546
|
-
export enum ShadowCastingMode {
|
|
547
|
-
Off = 0,
|
|
548
|
-
On = 1,
|
|
549
|
-
TwoSided = 2,
|
|
550
|
-
ShadowsOnly = 3
|
|
551
|
-
}
|
|
552
|
-
export class InstancingUtil {
|
|
553
|
-
static markDirty(go: THREE.Object3D | null, recursive?: boolean): void;
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
417
|
declare module "engine-components/Collider" {
|
|
557
418
|
import { Behaviour } from "engine-components/Component";
|
|
558
419
|
import { Rigidbody } from "engine-components/Rigidbody";
|
|
@@ -562,6 +423,7 @@ declare module "engine-components/Collider" {
|
|
|
562
423
|
isTrigger: boolean;
|
|
563
424
|
protected _shape: Shape | null;
|
|
564
425
|
awake(): void;
|
|
426
|
+
start(): void;
|
|
565
427
|
onEnable(): void;
|
|
566
428
|
onDisable(): void;
|
|
567
429
|
}
|
|
@@ -576,6 +438,13 @@ declare module "engine-components/Collider" {
|
|
|
576
438
|
onEnable(): void;
|
|
577
439
|
}
|
|
578
440
|
}
|
|
441
|
+
declare module "engine/engine_instancing" {
|
|
442
|
+
export const NEED_UPDATE_INSTANCE_KEY: unique symbol;
|
|
443
|
+
export class InstancingUtil {
|
|
444
|
+
static isUsingInstancing(instance: THREE.Object3D): boolean;
|
|
445
|
+
static markDirty(go: THREE.Object3D | null, recursive?: boolean): void;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
579
448
|
declare module "engine/engine_physics" {
|
|
580
449
|
import * as CANNON from 'cannon-es';
|
|
581
450
|
import * as THREE from 'three';
|
|
@@ -669,6 +538,8 @@ declare module "engine/engine_physics" {
|
|
|
669
538
|
private onEndContact;
|
|
670
539
|
}
|
|
671
540
|
export class Collision {
|
|
541
|
+
get __internalCollision(): CannonCollision;
|
|
542
|
+
get __internalInvertedSourceReceiver(): boolean;
|
|
672
543
|
private readonly invert;
|
|
673
544
|
private readonly collision;
|
|
674
545
|
private readonly targetBody;
|
|
@@ -681,6 +552,10 @@ declare module "engine/engine_physics" {
|
|
|
681
552
|
constructor(obj: Object3D, collision: CannonCollision, invert?: boolean);
|
|
682
553
|
}
|
|
683
554
|
}
|
|
555
|
+
declare module "engine-components/js-extensions/Object3D" {
|
|
556
|
+
import { Object3D } from "three";
|
|
557
|
+
export function apply(object: Object3D): void;
|
|
558
|
+
}
|
|
684
559
|
declare module "engine-components/Component" {
|
|
685
560
|
import * as THREE from "three";
|
|
686
561
|
import { Context, FrameEvent } from "engine/engine_setup";
|
|
@@ -1659,6 +1534,14 @@ declare module "engine/engine_gltf_builtin_components" {
|
|
|
1659
1534
|
export function writeBuiltinComponentData(comp: Component, context: SerializationContext): object | null;
|
|
1660
1535
|
export function createBuiltinComponents(context: Context, gltfId: SourceIdentifier, gltf: any, seed?: number | null | UIDProvider, extension?: NEEDLE_components): Promise<void>;
|
|
1661
1536
|
}
|
|
1537
|
+
declare module "engine/engine_loaders" {
|
|
1538
|
+
import { Context } from "engine/engine_setup";
|
|
1539
|
+
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
1540
|
+
export function setDracoDecoderPath(path: string | undefined): void;
|
|
1541
|
+
export function setDracoDecoderType(type: string | undefined): void;
|
|
1542
|
+
export function setKtx2TranscoderPath(path: string): void;
|
|
1543
|
+
export function addDracoAndKTX2Loaders(loader: GLTFLoader, context: Context): void;
|
|
1544
|
+
}
|
|
1662
1545
|
declare module "engine/shaders/shaderData" {
|
|
1663
1546
|
export class ShaderData {
|
|
1664
1547
|
programs: Array<ShaderProgram>;
|
|
@@ -2321,6 +2204,7 @@ declare module "engine-components/WebXRController" {
|
|
|
2321
2204
|
private static CreateRaycastHitPoint;
|
|
2322
2205
|
static Create(owner: WebXR, index: number, addTo: GameObject, type: ControllerType): WebXRController;
|
|
2323
2206
|
static addEventListener(evt: ControllerEvents, callback: (controller: WebXRController, args: any) => void): void;
|
|
2207
|
+
static removeEventListener(evt: ControllerEvents, callback: (controller: WebXRController, args: any) => void): void;
|
|
2324
2208
|
private static eventSubs;
|
|
2325
2209
|
webXR: WebXR;
|
|
2326
2210
|
index: number;
|
|
@@ -2651,6 +2535,7 @@ declare module "engine/extensions/NEEDLE_techniques_webgl" {
|
|
|
2651
2535
|
export class CustomShader extends RawShaderMaterial {
|
|
2652
2536
|
private identifier;
|
|
2653
2537
|
private onBeforeRenderSceneCallback;
|
|
2538
|
+
clone(): this;
|
|
2654
2539
|
constructor(identifier: SourceIdentifier, ...args: any[]);
|
|
2655
2540
|
dispose(): void;
|
|
2656
2541
|
waitForLighting(): Promise<void>;
|
|
@@ -2824,6 +2709,134 @@ declare module "engine/extensions/NEEDLE_lighting_settings" {
|
|
|
2824
2709
|
onDisable(): void;
|
|
2825
2710
|
}
|
|
2826
2711
|
}
|
|
2712
|
+
declare module "engine-components/RendererLightmap" {
|
|
2713
|
+
import { GameObject } from "engine-components/Component";
|
|
2714
|
+
import * as THREE from "three";
|
|
2715
|
+
import { Texture } from "three";
|
|
2716
|
+
import { Context } from "engine/engine_setup";
|
|
2717
|
+
export class RendererLightmap {
|
|
2718
|
+
get lightmap(): Texture | null;
|
|
2719
|
+
set lightmap(tex: Texture | null);
|
|
2720
|
+
lightmapIndex: number;
|
|
2721
|
+
lightmapScaleOffset: THREE.Vector4;
|
|
2722
|
+
private context;
|
|
2723
|
+
private gameObject;
|
|
2724
|
+
private lightmapTexture;
|
|
2725
|
+
private lightmapScaleOffsetUniform;
|
|
2726
|
+
private lightmapUniform;
|
|
2727
|
+
private beforeRenderCallback?;
|
|
2728
|
+
constructor(gameObject: GameObject, context: Context);
|
|
2729
|
+
init(lightmapIndex: number, lightmapScaleOffset: THREE.Vector4, lightmapTexture: THREE.Texture, debug?: boolean): void;
|
|
2730
|
+
bindOnBeforeRender(): void;
|
|
2731
|
+
private onBeforeRenderThreeComplete;
|
|
2732
|
+
private setupLightmap;
|
|
2733
|
+
onBeforeRenderThree(material: THREE.Material): void;
|
|
2734
|
+
private setLightmapDebugMaterial;
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
declare module "engine/extensions/NEEDLE_deferred_texture" {
|
|
2738
|
+
import { Material } from "three";
|
|
2739
|
+
import { GLTF, GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
2740
|
+
import { SourceIdentifier } from "engine/engine_gltf";
|
|
2741
|
+
import { Context } from "engine/engine_setup";
|
|
2742
|
+
export const EXTENSION_NAME = "NEEDLE_deferred_texture";
|
|
2743
|
+
export class NEEDLE_deferred_texture implements GLTFLoaderPlugin {
|
|
2744
|
+
static assignTextureLOD(context: Context, source: SourceIdentifier | undefined, material: Material, level?: number): void;
|
|
2745
|
+
get name(): string;
|
|
2746
|
+
private parser;
|
|
2747
|
+
private sourceId;
|
|
2748
|
+
private context;
|
|
2749
|
+
constructor(parser: GLTFParser, sourceId: SourceIdentifier, context: Context);
|
|
2750
|
+
private _loading;
|
|
2751
|
+
afterRoot(gltf: GLTF): null;
|
|
2752
|
+
private static cache;
|
|
2753
|
+
private static resolved;
|
|
2754
|
+
private static getOrLoadTexture;
|
|
2755
|
+
}
|
|
2756
|
+
}
|
|
2757
|
+
declare module "engine-components/Renderer" {
|
|
2758
|
+
import { Behaviour } from "engine-components/Component";
|
|
2759
|
+
import * as THREE from "three";
|
|
2760
|
+
import { Texture } from "three";
|
|
2761
|
+
export class FieldWithDefault {
|
|
2762
|
+
path: string | null;
|
|
2763
|
+
asset: object | null;
|
|
2764
|
+
default: any;
|
|
2765
|
+
}
|
|
2766
|
+
export enum RenderState {
|
|
2767
|
+
Both = 0,
|
|
2768
|
+
Back = 1,
|
|
2769
|
+
Front = 2
|
|
2770
|
+
}
|
|
2771
|
+
class SharedMaterialArray {
|
|
2772
|
+
private _renderer;
|
|
2773
|
+
private _targets;
|
|
2774
|
+
is(renderer: Renderer): boolean;
|
|
2775
|
+
constructor(renderer: Renderer);
|
|
2776
|
+
get length(): number;
|
|
2777
|
+
private setMaterial;
|
|
2778
|
+
private getMaterial;
|
|
2779
|
+
}
|
|
2780
|
+
export class Renderer extends Behaviour {
|
|
2781
|
+
receiveShadows: boolean;
|
|
2782
|
+
shadowCastingMode: ShadowCastingMode;
|
|
2783
|
+
lightmapIndex: number;
|
|
2784
|
+
lightmapScaleOffset: THREE.Vector4;
|
|
2785
|
+
enableInstancing: boolean[] | undefined;
|
|
2786
|
+
renderOrder: number[] | undefined;
|
|
2787
|
+
allowOcclusionWhenDynamic: boolean;
|
|
2788
|
+
private _lightmaps?;
|
|
2789
|
+
get material(): THREE.Material;
|
|
2790
|
+
set material(mat: THREE.Material);
|
|
2791
|
+
private _sharedMaterials;
|
|
2792
|
+
get sharedMaterials(): SharedMaterialArray;
|
|
2793
|
+
static get shouldSuppressInstancing(): string | boolean;
|
|
2794
|
+
private _lightmapTextureOverride;
|
|
2795
|
+
get lightmap(): Texture | null;
|
|
2796
|
+
set lightmap(tex: Texture | null | undefined);
|
|
2797
|
+
get hasLightmap(): boolean;
|
|
2798
|
+
awake(): void;
|
|
2799
|
+
private _isInstancingEnabled;
|
|
2800
|
+
private handles;
|
|
2801
|
+
private prevLayers;
|
|
2802
|
+
private clearInstancingState;
|
|
2803
|
+
setInstancingEnabled(enabled: boolean): boolean;
|
|
2804
|
+
start(): void;
|
|
2805
|
+
onEnable(): void;
|
|
2806
|
+
onDisable(): void;
|
|
2807
|
+
onDestroy(): void;
|
|
2808
|
+
applyStencil(): void;
|
|
2809
|
+
onBeforeRenderThree(_renderer: any, _scene: any, _camera: any, _geometry: any, material: any, _group: any): void;
|
|
2810
|
+
onBeforeRender(): void;
|
|
2811
|
+
onAfterRender(): void;
|
|
2812
|
+
private applySettings;
|
|
2813
|
+
}
|
|
2814
|
+
export class MeshRenderer extends Renderer {
|
|
2815
|
+
}
|
|
2816
|
+
export class SkinnedMeshRenderer extends MeshRenderer {
|
|
2817
|
+
awake(): void;
|
|
2818
|
+
}
|
|
2819
|
+
export enum ShadowCastingMode {
|
|
2820
|
+
Off = 0,
|
|
2821
|
+
On = 1,
|
|
2822
|
+
TwoSided = 2,
|
|
2823
|
+
ShadowsOnly = 3
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
declare module "engine/extensions/NEEDLE_render_objects" {
|
|
2827
|
+
import { SourceIdentifier } from "engine/engine_gltf";
|
|
2828
|
+
import { GLTF, GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
2829
|
+
import { Renderer } from "engine-components/Renderer";
|
|
2830
|
+
export class NEEDLE_render_objects implements GLTFLoaderPlugin {
|
|
2831
|
+
private static stencils;
|
|
2832
|
+
static applyStencil(obj?: Renderer | null): void;
|
|
2833
|
+
private parser;
|
|
2834
|
+
private source;
|
|
2835
|
+
constructor(parser: GLTFParser, source: SourceIdentifier);
|
|
2836
|
+
afterRoot(_result: GLTF): Promise<void> | null;
|
|
2837
|
+
}
|
|
2838
|
+
export const EXTENSION_NAME = "NEEDLE_render_objects";
|
|
2839
|
+
}
|
|
2827
2840
|
declare module "engine/extensions/extensions" {
|
|
2828
2841
|
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
|
|
2829
2842
|
import { NEEDLE_components } from "engine/extensions/NEEDLE_components";
|
|
@@ -2934,6 +2947,9 @@ declare module "engine-components/ui/EventSystem" {
|
|
|
2934
2947
|
start(): void;
|
|
2935
2948
|
register(rc: Raycaster): void;
|
|
2936
2949
|
unregister(rc: Raycaster): void;
|
|
2950
|
+
private _selectStartFn?;
|
|
2951
|
+
private _selectEndFn?;
|
|
2952
|
+
private _selectUpdateFn?;
|
|
2937
2953
|
onEnable(): void;
|
|
2938
2954
|
onDisable(): void;
|
|
2939
2955
|
onPointerDown(): void;
|
|
@@ -3373,10 +3389,6 @@ declare module "engine-components/BoxHelperComponent" {
|
|
|
3373
3389
|
showHelper(col?: THREE.ColorRepresentation | null, force?: boolean): void;
|
|
3374
3390
|
}
|
|
3375
3391
|
}
|
|
3376
|
-
declare module "engine-components/ComponentExtensions" {
|
|
3377
|
-
export class UnityObject {
|
|
3378
|
-
}
|
|
3379
|
-
}
|
|
3380
3392
|
declare module "engine-components/DeleteBox" {
|
|
3381
3393
|
import { BoxHelperComponent } from "engine-components/BoxHelperComponent";
|
|
3382
3394
|
import { Behaviour } from "engine-components/Component";
|
|
@@ -3767,10 +3779,27 @@ declare module "engine/engine_input_utils" {
|
|
|
3767
3779
|
export function awaitInputAsync(): Promise<void>;
|
|
3768
3780
|
export function awaitInput(cb: any): Promise<void>;
|
|
3769
3781
|
}
|
|
3782
|
+
declare module "engine/engine_create_objects" {
|
|
3783
|
+
import { Mesh, Material } from "three";
|
|
3784
|
+
export enum PrimitiveType {
|
|
3785
|
+
Quad = 0
|
|
3786
|
+
}
|
|
3787
|
+
export type ObjectOptions = {
|
|
3788
|
+
name?: string;
|
|
3789
|
+
material?: Material;
|
|
3790
|
+
};
|
|
3791
|
+
export class ObjectUtils {
|
|
3792
|
+
static createPrimitive(type: PrimitiveType, opts?: ObjectOptions): Mesh;
|
|
3793
|
+
}
|
|
3794
|
+
}
|
|
3770
3795
|
declare module "engine-components/VideoPlayer" {
|
|
3771
3796
|
import { Behaviour } from "engine-components/Component";
|
|
3772
3797
|
import * as THREE from "three";
|
|
3773
|
-
|
|
3798
|
+
export enum AspectMode {
|
|
3799
|
+
None = 0,
|
|
3800
|
+
AdjustHeight = 1,
|
|
3801
|
+
AdjustWidth = 2
|
|
3802
|
+
}
|
|
3774
3803
|
export enum VideoSource {
|
|
3775
3804
|
VideoClip = 0,
|
|
3776
3805
|
Url = 1
|
|
@@ -3791,6 +3820,7 @@ declare module "engine-components/VideoPlayer" {
|
|
|
3791
3820
|
renderer: THREE.Object3D | null;
|
|
3792
3821
|
playOnAwake: boolean;
|
|
3793
3822
|
playOnEnable?: boolean;
|
|
3823
|
+
aspectMode: AspectMode;
|
|
3794
3824
|
private renderMode?;
|
|
3795
3825
|
private targetMaterialProperty?;
|
|
3796
3826
|
private targetMaterialRenderer?;
|
|
@@ -3807,13 +3837,14 @@ declare module "engine-components/VideoPlayer" {
|
|
|
3807
3837
|
get isPlaying(): boolean;
|
|
3808
3838
|
get crossOrigin(): string | null;
|
|
3809
3839
|
set crossOrigin(val: string | null);
|
|
3840
|
+
get videoTexture(): THREE.VideoTexture | null;
|
|
3810
3841
|
private _crossOrigin;
|
|
3811
3842
|
private audioOutputMode;
|
|
3812
3843
|
private source;
|
|
3813
3844
|
private clip?;
|
|
3814
3845
|
private url?;
|
|
3815
3846
|
private videoElement;
|
|
3816
|
-
private
|
|
3847
|
+
private _videoTexture;
|
|
3817
3848
|
private videoMaterial;
|
|
3818
3849
|
private _isPlaying;
|
|
3819
3850
|
private wasPlaying;
|
|
@@ -3829,39 +3860,42 @@ declare module "engine-components/VideoPlayer" {
|
|
|
3829
3860
|
stop(): void;
|
|
3830
3861
|
pause(): void;
|
|
3831
3862
|
create(playAutomatically: boolean): void;
|
|
3863
|
+
updateAspect(): void;
|
|
3864
|
+
private _overlay;
|
|
3865
|
+
get screenspace(): boolean;
|
|
3866
|
+
set screenspace(val: boolean);
|
|
3832
3867
|
private _targetObjects;
|
|
3833
|
-
getTargetObjects(): Array<Object3D>;
|
|
3834
3868
|
private createVideoElement;
|
|
3835
3869
|
private handleBeginPlaying;
|
|
3836
3870
|
private updateVideoElementSettings;
|
|
3837
3871
|
private updateVideoElementStyles;
|
|
3872
|
+
private _updateAspectRoutineId;
|
|
3873
|
+
private updateAspectImpl;
|
|
3838
3874
|
}
|
|
3839
3875
|
}
|
|
3840
3876
|
declare module "engine-components/ScreenCapture" {
|
|
3841
3877
|
import { Behaviour } from "engine-components/Component";
|
|
3878
|
+
import { VideoPlayer } from "engine-components/VideoPlayer";
|
|
3842
3879
|
import { IPointerClickHandler } from "engine-components/ui/PointerEvents";
|
|
3843
3880
|
export enum ScreenCaptureDevice {
|
|
3844
3881
|
Screen = 0,
|
|
3845
|
-
Camera = 1
|
|
3882
|
+
Camera = 1,
|
|
3883
|
+
Canvas = 2
|
|
3846
3884
|
}
|
|
3847
3885
|
export enum ScreenCaptureMode {
|
|
3848
3886
|
Idle = 0,
|
|
3849
3887
|
Sending = 1,
|
|
3850
3888
|
Receiving = 2
|
|
3851
3889
|
}
|
|
3852
|
-
export enum AspectMode {
|
|
3853
|
-
None = 0,
|
|
3854
|
-
AdjustHeight = 1,
|
|
3855
|
-
AdjustWidth = 2
|
|
3856
|
-
}
|
|
3857
3890
|
export class ScreenCapture extends Behaviour implements IPointerClickHandler {
|
|
3858
3891
|
onPointerClick(): void;
|
|
3892
|
+
videoPlayer?: VideoPlayer;
|
|
3859
3893
|
device: ScreenCaptureDevice;
|
|
3860
|
-
|
|
3861
|
-
get
|
|
3862
|
-
get
|
|
3894
|
+
get currentScream(): MediaStream | null;
|
|
3895
|
+
get currentMode(): ScreenCaptureMode;
|
|
3896
|
+
get isSending(): boolean | undefined;
|
|
3897
|
+
get isReceiving(): boolean;
|
|
3863
3898
|
private _net?;
|
|
3864
|
-
private _video?;
|
|
3865
3899
|
private _requestOpen;
|
|
3866
3900
|
private _currentStream;
|
|
3867
3901
|
private _currentMode;
|
|
@@ -3872,10 +3906,6 @@ declare module "engine-components/ScreenCapture" {
|
|
|
3872
3906
|
private setVideo;
|
|
3873
3907
|
private onReceiveVideo;
|
|
3874
3908
|
private tryShareUserCamera;
|
|
3875
|
-
private _targetObjects?;
|
|
3876
|
-
private updateAspect;
|
|
3877
|
-
private _updateAspectRoutineId;
|
|
3878
|
-
private updateAspectImpl;
|
|
3879
3909
|
}
|
|
3880
3910
|
}
|
|
3881
3911
|
declare module "engine-components/ShadowCatcher" {
|
|
@@ -4979,7 +5009,9 @@ declare module "engine-components/ui/SpatialHtml" {
|
|
|
4979
5009
|
start(): void;
|
|
4980
5010
|
}
|
|
4981
5011
|
}
|
|
4982
|
-
declare module "engine-components/codegen/
|
|
5012
|
+
declare module "engine-components/codegen/components" {
|
|
5013
|
+
export class __Ignore {
|
|
5014
|
+
}
|
|
4983
5015
|
export { AlignmentConstraint } from "engine-components/AlignmentConstraint";
|
|
4984
5016
|
export { Animation } from "engine-components/Animation";
|
|
4985
5017
|
export { AnimationCurve } from "engine-components/AnimationCurve";
|
|
@@ -4997,7 +5029,6 @@ declare module "engine-components/codegen/exports" {
|
|
|
4997
5029
|
export { SphereCollider } from "engine-components/Collider";
|
|
4998
5030
|
export { BoxCollider } from "engine-components/Collider";
|
|
4999
5031
|
export { InstantiateOptions } from "engine-components/Component";
|
|
5000
|
-
export { UnityObject } from "engine-components/ComponentExtensions";
|
|
5001
5032
|
export { DeleteBox } from "engine-components/DeleteBox";
|
|
5002
5033
|
export { Deletable } from "engine-components/DeleteBox";
|
|
5003
5034
|
export { DeviceFlag } from "engine-components/DeviceFlag";
|
|
@@ -5036,7 +5067,6 @@ declare module "engine-components/codegen/exports" {
|
|
|
5036
5067
|
export { Renderer } from "engine-components/Renderer";
|
|
5037
5068
|
export { MeshRenderer } from "engine-components/Renderer";
|
|
5038
5069
|
export { SkinnedMeshRenderer } from "engine-components/Renderer";
|
|
5039
|
-
export { InstancingUtil } from "engine-components/Renderer";
|
|
5040
5070
|
export { RendererLightmap } from "engine-components/RendererLightmap";
|
|
5041
5071
|
export { Rigidbody } from "engine-components/Rigidbody";
|
|
5042
5072
|
export { ScreenCapture } from "engine-components/ScreenCapture";
|
|
@@ -5126,7 +5156,8 @@ declare module "needle-engine" {
|
|
|
5126
5156
|
export { GameObject, Behaviour } from "engine-components/Component";
|
|
5127
5157
|
export { serializeable } from "engine/engine_serialization_decorator";
|
|
5128
5158
|
export { Collision } from "engine/engine_physics";
|
|
5129
|
-
export * from "engine-components/codegen/
|
|
5159
|
+
export * from "engine-components/codegen/components";
|
|
5160
|
+
export * from "engine-components/js-extensions/Object3D";
|
|
5130
5161
|
}
|
|
5131
5162
|
declare module "engine/debug/error_overlay" {
|
|
5132
5163
|
export function makeErrorsVisibleForDevelopment(): void;
|