@needle-tools/engine 2.38.0-pre → 2.38.0-pre.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/needle-engine.d.ts +38 -6
- package/dist/needle-engine.js +351 -351
- package/dist/needle-engine.js.map +4 -4
- package/dist/needle-engine.min.js +19 -19
- package/dist/needle-engine.min.js.map +4 -4
- package/lib/engine/engine_physics.d.ts +9 -0
- package/lib/engine/engine_physics.js +34 -14
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/engine_setup.d.ts +5 -5
- package/lib/engine/engine_setup.js +20 -20
- package/lib/engine/engine_setup.js.map +1 -1
- package/lib/engine/engine_types.d.ts +2 -0
- package/lib/engine/engine_types.js.map +1 -1
- package/lib/engine-components/Camera.d.ts +1 -0
- package/lib/engine-components/Camera.js +7 -1
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/CharacterController.d.ts +3 -0
- package/lib/engine-components/CharacterController.js +13 -1
- package/lib/engine-components/CharacterController.js.map +1 -1
- package/lib/engine-components/Collider.d.ts +0 -1
- package/lib/engine-components/Collider.js +0 -3
- package/lib/engine-components/Collider.js.map +1 -1
- package/lib/engine-components/Joints.d.ts +15 -0
- package/lib/engine-components/Joints.js +42 -0
- package/lib/engine-components/Joints.js.map +1 -0
- package/lib/engine-components/OrbitControls.js +1 -1
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/lib/engine-components/codegen/components.d.ts +1 -0
- package/lib/engine-components/codegen/components.js +1 -0
- package/lib/engine-components/codegen/components.js.map +1 -1
- package/package.json +2 -2
- package/src/engine/codegen/register_types.js +4 -0
- package/src/engine/engine_physics.ts +44 -17
- package/src/engine/engine_setup.ts +27 -28
- package/src/engine/engine_types.ts +2 -0
- package/src/engine-components/Camera.ts +6 -1
- package/src/engine-components/CharacterController.ts +15 -1
- package/src/engine-components/Collider.ts +0 -4
- package/src/engine-components/Joints.ts +40 -0
- package/src/engine-components/OrbitControls.ts +1 -1
- package/src/engine-components/codegen/components.ts +1 -0
- package/src/include/console/ConsoleReroute.js +79 -0
- package/src/include/draco/draco_decoder.js +48 -0
- package/src/include/draco/draco_decoder.wasm +0 -0
- package/src/include/ktx2/basis_transcoder.js +21 -0
- package/src/include/ktx2/basis_transcoder.wasm +0 -0
- package/src/include/three/ARButton.js +208 -0
- package/src/include/three/DragControls.js +232 -0
- package/src/include/three/EXT_mesh_gpu_instancing_exporter.js +67 -0
- package/src/include/three/VRButton.js +196 -0
- package/src/include/three-mesh-ui-assets/backspace.png +0 -0
- package/src/include/three-mesh-ui-assets/enter.png +0 -0
- package/src/include/three-mesh-ui-assets/shift.png +0 -0
package/dist/needle-engine.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ declare module "engine/engine_types" {
|
|
|
80
80
|
get name(): string;
|
|
81
81
|
get layer(): number;
|
|
82
82
|
get destroyed(): boolean;
|
|
83
|
+
get tag(): string;
|
|
83
84
|
context: any;
|
|
84
85
|
get activeAndEnabled(): boolean;
|
|
85
86
|
__internalNewInstanceCreated(): any;
|
|
@@ -112,6 +113,7 @@ declare module "engine/engine_types" {
|
|
|
112
113
|
get worldQuaternion(): Quaternion;
|
|
113
114
|
}
|
|
114
115
|
export interface ICamera extends IComponent {
|
|
116
|
+
get isCamera(): boolean;
|
|
115
117
|
applyClearFlagsIfIsActiveCamera(): unknown;
|
|
116
118
|
buildCamera(): any;
|
|
117
119
|
get cam(): Camera;
|
|
@@ -789,8 +791,10 @@ declare module "engine/engine_physics" {
|
|
|
789
791
|
private collisionHandler?;
|
|
790
792
|
private objects;
|
|
791
793
|
private bodies;
|
|
794
|
+
private _meshCache;
|
|
792
795
|
constructor(context: Context);
|
|
793
796
|
createWorld(): Promise<void>;
|
|
797
|
+
clearCaches(): void;
|
|
794
798
|
addBoxCollider(collider: ICollider, center: Vector3, size: Vector3): void;
|
|
795
799
|
addSphereCollider(collider: ICollider, center: Vector3, radius: number): void;
|
|
796
800
|
addCapsuleCollider(collider: ICollider, center: Vector3, height: number, radius: number): void;
|
|
@@ -811,6 +815,13 @@ declare module "engine/engine_physics" {
|
|
|
811
815
|
private syncPhysicsBody;
|
|
812
816
|
private static _matricesBuffer;
|
|
813
817
|
private getRigidbodyRelativeMatrix;
|
|
818
|
+
private static centerConnectionPos;
|
|
819
|
+
private static centerConnectionRot;
|
|
820
|
+
addFixedJoint(body1: IRigidbody, body2: IRigidbody, rel: {
|
|
821
|
+
x: number;
|
|
822
|
+
y: number;
|
|
823
|
+
z: number;
|
|
824
|
+
}): void;
|
|
814
825
|
}
|
|
815
826
|
}
|
|
816
827
|
declare module "engine/engine_time" {
|
|
@@ -1652,7 +1663,7 @@ declare module "engine/engine_setup" {
|
|
|
1652
1663
|
import { Application } from "engine/engine_application";
|
|
1653
1664
|
import { ILightDataRegistry } from "engine/engine_lightdata";
|
|
1654
1665
|
import { PlayerViewManager } from "engine/engine_playerview";
|
|
1655
|
-
import { ICamera
|
|
1666
|
+
import { ICamera, IComponent, ILight } from "engine/engine_types";
|
|
1656
1667
|
export const build_scene_functions: {
|
|
1657
1668
|
[name: string]: (context: Context) => Promise<void>;
|
|
1658
1669
|
};
|
|
@@ -1731,7 +1742,7 @@ declare module "engine/engine_setup" {
|
|
|
1731
1742
|
[FrameEvent: number]: Array<CoroutineData>;
|
|
1732
1743
|
};
|
|
1733
1744
|
get mainCamera(): THREE.Camera | null;
|
|
1734
|
-
mainCameraComponent:
|
|
1745
|
+
mainCameraComponent: ICamera | undefined;
|
|
1735
1746
|
post_setup_callbacks: Function[];
|
|
1736
1747
|
pre_update_callbacks: Function[];
|
|
1737
1748
|
pre_render_callbacks: Function[];
|
|
@@ -1749,7 +1760,7 @@ declare module "engine/engine_setup" {
|
|
|
1749
1760
|
* @deprecated AssetDataBase is deprecated
|
|
1750
1761
|
*/
|
|
1751
1762
|
assets: AssetDatabase;
|
|
1752
|
-
mainLight:
|
|
1763
|
+
mainLight: ILight | null;
|
|
1753
1764
|
rendererData: RendererData;
|
|
1754
1765
|
addressables: Addressables;
|
|
1755
1766
|
lightmaps: ILightDataRegistry;
|
|
@@ -1766,8 +1777,8 @@ declare module "engine/engine_setup" {
|
|
|
1766
1777
|
unregisterCoroutineUpdate(coroutine: Generator, evt: FrameEvent): void;
|
|
1767
1778
|
stopAllCoroutinesFrom(script: IComponent): void;
|
|
1768
1779
|
private _cameraStack;
|
|
1769
|
-
setCurrentCamera(cam:
|
|
1770
|
-
removeCamera(cam?:
|
|
1780
|
+
setCurrentCamera(cam: ICamera): void;
|
|
1781
|
+
removeCamera(cam?: ICamera | null): void;
|
|
1771
1782
|
private _onBeforeRenderListeners;
|
|
1772
1783
|
/** use this to subscribe to onBeforeRender events on threejs objects */
|
|
1773
1784
|
addBeforeRenderListener(target: THREE.Object3D, callback: OnBeforeRenderCallback): void;
|
|
@@ -2471,6 +2482,7 @@ declare module "engine-components/Camera" {
|
|
|
2471
2482
|
Uninitialized = 4
|
|
2472
2483
|
}
|
|
2473
2484
|
export class Camera extends Behaviour implements ICamera {
|
|
2485
|
+
get isCamera(): boolean;
|
|
2474
2486
|
get aspect(): number;
|
|
2475
2487
|
get fieldOfView(): number;
|
|
2476
2488
|
set fieldOfView(val: number);
|
|
@@ -2674,7 +2686,6 @@ declare module "engine-components/Collider" {
|
|
|
2674
2686
|
export class MeshCollider extends Collider {
|
|
2675
2687
|
sharedMesh?: Mesh;
|
|
2676
2688
|
convex: boolean;
|
|
2677
|
-
awake(): void;
|
|
2678
2689
|
onEnable(): void;
|
|
2679
2690
|
}
|
|
2680
2691
|
export class CapsuleCollider extends Collider {
|
|
@@ -2709,10 +2720,13 @@ declare module "engine-components/CharacterController" {
|
|
|
2709
2720
|
rotationSpeed: number;
|
|
2710
2721
|
jumpForce: number;
|
|
2711
2722
|
animator?: Animator;
|
|
2723
|
+
lookForward: boolean;
|
|
2712
2724
|
private _currentSpeed;
|
|
2713
2725
|
private _currentAngularSpeed;
|
|
2714
2726
|
private _temp;
|
|
2715
2727
|
private _jumpCount;
|
|
2728
|
+
private _currentRotation;
|
|
2729
|
+
awake(): void;
|
|
2716
2730
|
update(): void;
|
|
2717
2731
|
private _raycastOptions;
|
|
2718
2732
|
}
|
|
@@ -3895,6 +3909,23 @@ declare module "engine-components/GroundProjection" {
|
|
|
3895
3909
|
updateProjection(): void;
|
|
3896
3910
|
}
|
|
3897
3911
|
}
|
|
3912
|
+
declare module "engine-components/Joints" {
|
|
3913
|
+
import { Vector3 } from "three";
|
|
3914
|
+
import { Behaviour } from "engine-components/Component";
|
|
3915
|
+
import { Rigidbody } from "engine-components/RigidBody";
|
|
3916
|
+
export abstract class Joint extends Behaviour {
|
|
3917
|
+
connectedBody?: Rigidbody;
|
|
3918
|
+
get rigidBody(): Rigidbody | null;
|
|
3919
|
+
private _rigidBody;
|
|
3920
|
+
connectedAnchor?: Vector3;
|
|
3921
|
+
onEnable(): void;
|
|
3922
|
+
private create;
|
|
3923
|
+
protected abstract createJoint(self: Rigidbody, other: Rigidbody): any;
|
|
3924
|
+
}
|
|
3925
|
+
export class FixedJoint extends Joint {
|
|
3926
|
+
protected createJoint(self: Rigidbody, other: Rigidbody): void;
|
|
3927
|
+
}
|
|
3928
|
+
}
|
|
3898
3929
|
declare module "engine-components/Light" {
|
|
3899
3930
|
import { Behaviour } from "engine-components/Component";
|
|
3900
3931
|
import * as THREE from "three";
|
|
@@ -5421,6 +5452,7 @@ declare module "engine-components/codegen/components" {
|
|
|
5421
5452
|
export { GroundProjectedEnv } from "engine-components/GroundProjection";
|
|
5422
5453
|
export { Interactable } from "engine-components/Interactable";
|
|
5423
5454
|
export { UsageMarker } from "engine-components/Interactable";
|
|
5455
|
+
export { FixedJoint } from "engine-components/Joints";
|
|
5424
5456
|
export { Light } from "engine-components/Light";
|
|
5425
5457
|
export { LODModel } from "engine-components/LODGroup";
|
|
5426
5458
|
export { LODGroup } from "engine-components/LODGroup";
|