@needle-tools/engine 2.36.0-pre → 2.37.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 +12 -0
- package/dist/needle-engine.d.ts +171 -141
- package/dist/needle-engine.js +451 -437
- package/dist/needle-engine.js.map +4 -4
- package/dist/needle-engine.min.js +82 -82
- package/dist/needle-engine.min.js.map +4 -4
- package/lib/engine/api.d.ts +1 -0
- package/lib/engine/api.js +1 -0
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/debug/debug.d.ts +1 -0
- package/lib/engine/debug/debug.js +3 -0
- package/lib/engine/debug/debug.js.map +1 -1
- package/lib/engine/engine_gameobject.js +2 -1
- package/lib/engine/engine_gameobject.js.map +1 -1
- package/lib/engine/engine_physics.d.ts +33 -42
- package/lib/engine/engine_physics.js +431 -383
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/engine_physics.types.d.ts +16 -0
- package/lib/engine/engine_physics.types.js +19 -0
- package/lib/engine/engine_physics.types.js.map +1 -0
- package/lib/engine/engine_serialization_core.d.ts +3 -0
- package/lib/engine/engine_serialization_core.js +5 -0
- package/lib/engine/engine_serialization_core.js.map +1 -1
- package/lib/engine/engine_setup.js +3 -1
- package/lib/engine/engine_setup.js.map +1 -1
- package/lib/engine/engine_types.d.ts +45 -26
- package/lib/engine/engine_types.js +24 -37
- package/lib/engine/engine_types.js.map +1 -1
- package/lib/engine/engine_util_decorator.d.ts +6 -0
- package/lib/engine/engine_util_decorator.js +54 -0
- package/lib/engine/engine_util_decorator.js.map +1 -0
- package/lib/engine/engine_utils.d.ts +1 -1
- package/lib/engine/engine_utils.js +1 -1
- package/lib/engine/engine_utils.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_gameobject_data.js +2 -0
- package/lib/engine/extensions/NEEDLE_gameobject_data.js.map +1 -1
- package/lib/engine-components/Animation.d.ts +6 -5
- package/lib/engine-components/Animation.js +0 -7
- package/lib/engine-components/Animation.js.map +1 -1
- package/lib/engine-components/BoxHelperComponent.js +1 -0
- package/lib/engine-components/BoxHelperComponent.js.map +1 -1
- package/lib/engine-components/Collider.d.ts +7 -2
- package/lib/engine-components/Collider.js +27 -15
- package/lib/engine-components/Collider.js.map +1 -1
- package/lib/engine-components/Component.d.ts +6 -15
- package/lib/engine-components/Component.js +7 -112
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/DragControls.js +9 -6
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/NavMesh.d.ts +0 -5
- package/lib/engine-components/NavMesh.js +100 -10
- package/lib/engine-components/NavMesh.js.map +1 -1
- package/lib/engine-components/NestedGltf.js +2 -0
- package/lib/engine-components/NestedGltf.js.map +1 -1
- package/lib/engine-components/RigidBody.d.ts +40 -25
- package/lib/engine-components/RigidBody.js +253 -142
- package/lib/engine-components/RigidBody.js.map +1 -1
- package/lib/engine-components/SpatialTrigger.js +1 -1
- package/lib/engine-components/SpatialTrigger.js.map +1 -1
- package/lib/engine-components/SpectatorCamera.d.ts +1 -0
- package/lib/engine-components/SpectatorCamera.js +9 -2
- package/lib/engine-components/SpectatorCamera.js.map +1 -1
- package/lib/engine-components/SpringJoint.d.ts +0 -13
- package/lib/engine-components/SpringJoint.js +42 -41
- package/lib/engine-components/SpringJoint.js.map +1 -1
- package/lib/engine-components/VideoPlayer.js.map +1 -1
- package/lib/engine-components/WebXR.d.ts +1 -0
- package/lib/engine-components/WebXR.js +10 -2
- package/lib/engine-components/WebXR.js.map +1 -1
- package/lib/engine-components/WebXRController.js +12 -6
- package/lib/engine-components/WebXRController.js.map +1 -1
- package/lib/engine-components/codegen/components.d.ts +1 -3
- package/lib/engine-components/codegen/components.js +1 -3
- package/lib/engine-components/codegen/components.js.map +1 -1
- package/package.json +3 -4
- package/src/engine/api.ts +2 -1
- package/src/engine/codegen/register_types.js +4 -12
- package/src/engine/debug/debug.ts +4 -0
- package/src/engine/engine_gameobject.ts +4 -4
- package/src/engine/engine_physics.ts +460 -421
- package/src/engine/engine_physics.types.ts +19 -0
- package/src/engine/engine_serialization_core.ts +8 -1
- package/src/engine/engine_setup.ts +5 -1
- package/src/engine/engine_types.ts +82 -56
- package/src/engine/engine_util_decorator.ts +69 -0
- package/src/engine/engine_utils.ts +3 -3
- package/src/engine/extensions/NEEDLE_gameobject_data.ts +2 -0
- package/src/engine-components/Animation.ts +10 -12
- package/src/engine-components/BoxHelperComponent.ts +1 -0
- package/src/engine-components/Collider.ts +29 -29
- package/src/engine-components/Component.ts +15 -130
- package/src/engine-components/DragControls.ts +9 -5
- package/src/engine-components/NavMesh.ts +114 -115
- package/src/engine-components/NestedGltf.ts +2 -0
- package/src/engine-components/RigidBody.ts +258 -149
- package/src/engine-components/SpatialTrigger.ts +1 -1
- package/src/engine-components/SpectatorCamera.ts +10 -2
- package/src/engine-components/SpringJoint.ts +41 -41
- package/src/engine-components/VideoPlayer.ts +1 -2
- package/src/engine-components/WebXR.ts +12 -2
- package/src/engine-components/WebXRController.ts +16 -7
- package/src/engine-components/codegen/components.ts +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ 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.37.0-pre] - 2022-10-28
|
|
8
|
+
- Add: rapier physics backend and overall improved physics system like constraint support, fixed physics collider updates and synchronization between rendering and physics world or animation of physical bodies
|
|
9
|
+
- Remove: cannon-es
|
|
10
|
+
- Add basic mesh collider support
|
|
11
|
+
- Add ``@validate`` decorator and ``onValidate`` event method that can be used to automatically get callbacks when marked properties are being written to (for example internally this is used on the Rigidbody to update the physics body when values on the Rigidbody component are being updated)
|
|
12
|
+
- Change: assign nested gltf layers
|
|
13
|
+
- Change: reworked Rigidbody api
|
|
14
|
+
- Fix: allow Draco and KRTX compression on custom hand models
|
|
15
|
+
- Fix: applying Unity layers to threejs objects
|
|
16
|
+
- Fix: BoxHelper stopped working with SpatialTrigger
|
|
17
|
+
- Fix: AR reticle showing up in wrong position with transformed WebARSessionRoot
|
|
18
|
+
|
|
7
19
|
## [2.36.0-pre] - 2022-10-26
|
|
8
20
|
- Add: Expose WebXR hand model path
|
|
9
21
|
- Add: Animation component can now be configured with random time scale and offset
|
package/dist/needle-engine.d.ts
CHANGED
|
@@ -23,10 +23,28 @@ declare module "engine-components/js-extensions/RGBAColor" {
|
|
|
23
23
|
multiply(color: Color): this;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
+
declare module "engine/engine_physics.types" {
|
|
27
|
+
export enum CollisionDetectionMode {
|
|
28
|
+
Discrete = 0,
|
|
29
|
+
Continuous = 1
|
|
30
|
+
}
|
|
31
|
+
export enum RigidbodyConstraints {
|
|
32
|
+
None = 0,
|
|
33
|
+
FreezePositionX = 2,
|
|
34
|
+
FreezePositionY = 4,
|
|
35
|
+
FreezePositionZ = 8,
|
|
36
|
+
FreezePosition = 14,
|
|
37
|
+
FreezeRotationX = 16,
|
|
38
|
+
FreezeRotationY = 32,
|
|
39
|
+
FreezeRotationZ = 64,
|
|
40
|
+
FreezeRotation = 112,
|
|
41
|
+
FreezeAll = 126
|
|
42
|
+
}
|
|
43
|
+
}
|
|
26
44
|
declare module "engine/engine_types" {
|
|
27
|
-
import { Camera, Color, Material, Object3D, Vector3 } from "three";
|
|
28
|
-
import { Body, ContactEquation } from "cannon-es";
|
|
45
|
+
import { Camera, Color, Material, Object3D, Vector3, Quaternion } from "three";
|
|
29
46
|
import { RGBAColor } from "engine-components/js-extensions/RGBAColor";
|
|
47
|
+
import { CollisionDetectionMode, RigidbodyConstraints } from "engine/engine_physics.types";
|
|
30
48
|
/** used to find data registered via gltf files e.g. find lightmaps for a Renderer component that were shipped inside a gltf */
|
|
31
49
|
export type SourceIdentifier = string;
|
|
32
50
|
export type Constructor<T> = abstract new (...args: any[]) => T;
|
|
@@ -68,6 +86,8 @@ declare module "engine/engine_types" {
|
|
|
68
86
|
onEnable(): any;
|
|
69
87
|
onDisable(): any;
|
|
70
88
|
onDestroy(): any;
|
|
89
|
+
/** called for properties decorated with the @validate decorator */
|
|
90
|
+
onValidate?(property?: string): any;
|
|
71
91
|
start?(): void;
|
|
72
92
|
earlyUpdate?(): void;
|
|
73
93
|
update?(): void;
|
|
@@ -76,14 +96,13 @@ declare module "engine/engine_types" {
|
|
|
76
96
|
onAfterRender?(): void;
|
|
77
97
|
onCollisionEnter?(col: Collision): any;
|
|
78
98
|
onCollisionExit?(col: Collision): any;
|
|
79
|
-
onCollisionExitRaw?(col: Collision): any;
|
|
80
99
|
onCollisionStay?(col: Collision): any;
|
|
81
|
-
onTriggerEnter?(col:
|
|
82
|
-
onTriggerStay?(col:
|
|
83
|
-
onTriggerExit?(col:
|
|
84
|
-
__internalHandleCollision(col: Collision, isTriggerCollision: boolean): any;
|
|
85
|
-
__internalHandleExitCollisionEvent(obj: Object3D, isTriggerCollision: boolean): any;
|
|
100
|
+
onTriggerEnter?(col: ICollider): any;
|
|
101
|
+
onTriggerStay?(col: ICollider): any;
|
|
102
|
+
onTriggerExit?(col: ICollider): any;
|
|
86
103
|
get forward(): Vector3;
|
|
104
|
+
get worldPosition(): Vector3;
|
|
105
|
+
get worldQuaternion(): Quaternion;
|
|
87
106
|
}
|
|
88
107
|
export interface ICamera extends IComponent {
|
|
89
108
|
applyClearFlagsIfIsActiveCamera(): unknown;
|
|
@@ -114,33 +133,51 @@ declare module "engine/engine_types" {
|
|
|
114
133
|
isTrigger: boolean;
|
|
115
134
|
}
|
|
116
135
|
export interface IRigidbody extends IComponent {
|
|
117
|
-
|
|
118
|
-
|
|
136
|
+
constraints: RigidbodyConstraints;
|
|
137
|
+
isKinematic: boolean;
|
|
138
|
+
mass: number;
|
|
139
|
+
drag: number;
|
|
140
|
+
angularDrag: number;
|
|
141
|
+
useGravity: boolean;
|
|
142
|
+
collisionDetectionMode: CollisionDetectionMode;
|
|
143
|
+
lockPositionX: boolean;
|
|
144
|
+
lockPositionY: boolean;
|
|
145
|
+
lockPositionZ: boolean;
|
|
146
|
+
lockRotationX: boolean;
|
|
147
|
+
lockRotationY: boolean;
|
|
148
|
+
lockRotationZ: boolean;
|
|
119
149
|
}
|
|
120
150
|
export const $physicsKey: unique symbol;
|
|
121
|
-
export type CannonCollision = {
|
|
122
|
-
body: Body;
|
|
123
|
-
contact: ContactEquation;
|
|
124
|
-
target: Body;
|
|
125
|
-
type: string;
|
|
126
|
-
};
|
|
127
151
|
export type ICollisionContext = {
|
|
128
152
|
getCollider(obj: Object3D): ICollider;
|
|
129
153
|
};
|
|
154
|
+
export type Vec3 = {
|
|
155
|
+
x: number;
|
|
156
|
+
y: number;
|
|
157
|
+
z: number;
|
|
158
|
+
};
|
|
159
|
+
export type Vec2 = {
|
|
160
|
+
x: number;
|
|
161
|
+
y: number;
|
|
162
|
+
};
|
|
163
|
+
export class ContactPoint {
|
|
164
|
+
readonly localPoint: Vec3;
|
|
165
|
+
readonly distance: number;
|
|
166
|
+
readonly normal: Vec3;
|
|
167
|
+
constructor(localPt: Vec3, dist: number, normal: Vec3);
|
|
168
|
+
}
|
|
130
169
|
export class Collision {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
private readonly invert;
|
|
134
|
-
private readonly collision;
|
|
135
|
-
private readonly targetBody;
|
|
136
|
-
private readonly context;
|
|
170
|
+
private readonly contacts;
|
|
171
|
+
constructor(obj: Object3D, otherCollider: ICollider, contacts: ContactPoint[]);
|
|
137
172
|
readonly me: Object3D;
|
|
138
|
-
private
|
|
139
|
-
|
|
140
|
-
private _collider?;
|
|
173
|
+
private _collider;
|
|
174
|
+
/** the collider the collision happened with */
|
|
141
175
|
get collider(): ICollider;
|
|
176
|
+
/** the object the collision happened with */
|
|
177
|
+
private _gameObject;
|
|
142
178
|
get gameObject(): Object3D;
|
|
143
|
-
|
|
179
|
+
/** the rigidbody we hit, null if none attached */
|
|
180
|
+
get rigidBody(): IRigidbody | null;
|
|
144
181
|
}
|
|
145
182
|
}
|
|
146
183
|
declare module "engine/engine_utils" {
|
|
@@ -164,7 +201,7 @@ declare module "engine/engine_utils" {
|
|
|
164
201
|
export function deepClone(obj: any, predicate?: deepClonePredicate): any;
|
|
165
202
|
export function delay(milliseconds: number): Promise<void>;
|
|
166
203
|
export function getPath(source: SourceIdentifier | undefined, uri: string): string;
|
|
167
|
-
export type WriteCallback = (data: any) => void;
|
|
204
|
+
export type WriteCallback = (data: any, prop: string) => void;
|
|
168
205
|
export interface IWatch {
|
|
169
206
|
subscribeWrite(callback: WriteCallback): any;
|
|
170
207
|
apply(): any;
|
|
@@ -254,6 +291,7 @@ declare module "engine/debug/debug" {
|
|
|
254
291
|
import { LogType } from "engine/debug/debug_overlay";
|
|
255
292
|
export { LogType };
|
|
256
293
|
export function showBalloonMessage(text: string, logType?: LogType): void;
|
|
294
|
+
export function showBalloonWarning(text: string): void;
|
|
257
295
|
}
|
|
258
296
|
declare module "engine/engine_serialization_core" {
|
|
259
297
|
import { GLTF } from "three/examples/jsm/loaders/GLTFLoader";
|
|
@@ -323,6 +361,9 @@ declare module "engine/engine_serialization_core" {
|
|
|
323
361
|
}
|
|
324
362
|
export function serializeObject(obj: ISerializable, context: SerializationContext): object | null;
|
|
325
363
|
export function deserializeObject(obj: ISerializable, serializedData: object, context: SerializationContext): boolean;
|
|
364
|
+
/** set to true while assigning properties during instantiation.
|
|
365
|
+
* Used for validate decorator to not invoke callbacks on components that are currently in the process of being built */
|
|
366
|
+
export const $isAssigningProperties: unique symbol;
|
|
326
367
|
/** Object.assign behaviour but check if property is writeable (e.g. getter only properties are skipped) */
|
|
327
368
|
export function assign(target: any, source: any): void;
|
|
328
369
|
}
|
|
@@ -685,19 +726,11 @@ declare module "engine/engine_gameobject" {
|
|
|
685
726
|
export function instantiate(instance: GameObject | Object3D | null, opts?: InstantiateOptions | null): GameObject | null;
|
|
686
727
|
}
|
|
687
728
|
declare module "engine/engine_physics" {
|
|
688
|
-
import {
|
|
689
|
-
import { Camera, Intersection, Layers, Object3D, Ray, Raycaster, Vector2, Vector3 } from 'three';
|
|
729
|
+
import { Camera, Intersection, Layers, Mesh, Object3D, Ray, Raycaster, Vector2, Vector3 } from 'three';
|
|
690
730
|
import { Context } from "engine/engine_setup";
|
|
691
|
-
import {
|
|
692
|
-
import {
|
|
693
|
-
export
|
|
694
|
-
mass: number;
|
|
695
|
-
kinematic: boolean;
|
|
696
|
-
physicsEvents: boolean;
|
|
697
|
-
drag: number;
|
|
698
|
-
angularDrag: number;
|
|
699
|
-
sleepThreshold: number;
|
|
700
|
-
}
|
|
731
|
+
import { IComponent, ICollider, IRigidbody } from "engine/engine_types";
|
|
732
|
+
import RAPIER, { RigidBody } from '@dimforge/rapier3d-compat';
|
|
733
|
+
export type Rapier = typeof RAPIER;
|
|
701
734
|
export class RaycastOptions {
|
|
702
735
|
ray: Ray | undefined;
|
|
703
736
|
cam: Camera | undefined | null;
|
|
@@ -733,41 +766,40 @@ declare module "engine/engine_physics" {
|
|
|
733
766
|
private onSphereOverlap;
|
|
734
767
|
raycastFromRay(ray: Ray, options?: RaycastOptions | null): Array<Intersection>;
|
|
735
768
|
raycast(options?: RaycastOptions | null): Array<Intersection>;
|
|
736
|
-
|
|
769
|
+
private _tempPosition;
|
|
770
|
+
private _tempQuaternion;
|
|
771
|
+
private _tempMatrix;
|
|
772
|
+
private static _didLoadPhysicsEngine;
|
|
737
773
|
private _isUpdatingPhysicsWorld;
|
|
774
|
+
get isUpdating(): boolean;
|
|
738
775
|
private context;
|
|
739
|
-
private world
|
|
776
|
+
private world?;
|
|
777
|
+
private _hasCreatedWorld;
|
|
778
|
+
private eventQueue?;
|
|
779
|
+
private collisionHandler?;
|
|
740
780
|
private objects;
|
|
741
|
-
private
|
|
742
|
-
private tempQuaternion;
|
|
781
|
+
private bodies;
|
|
743
782
|
constructor(context: Context);
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
removeBody(
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
private
|
|
758
|
-
private readonly tempMat2;
|
|
759
|
-
private addShape;
|
|
760
|
-
step(deltaTime: number): void;
|
|
761
|
-
private temp;
|
|
762
|
-
private tempQuat;
|
|
783
|
+
createWorld(): Promise<void>;
|
|
784
|
+
addBoxCollider(collider: ICollider, center: Vector3, size: Vector3): void;
|
|
785
|
+
addSphereCollider(collider: ICollider, center: Vector3, radius: number): void;
|
|
786
|
+
addMeshCollider(collider: ICollider, mesh: Mesh, convex: boolean): void;
|
|
787
|
+
private createCollider;
|
|
788
|
+
private getRigidbody;
|
|
789
|
+
removeBody(obj: IComponent): void;
|
|
790
|
+
updateBody(comp: ICollider | IRigidbody, translation: boolean, rotation: boolean): void;
|
|
791
|
+
updateProperties(rigidbody: IRigidbody): void;
|
|
792
|
+
internal_getRigidbody(rb: IRigidbody): RigidBody | null;
|
|
793
|
+
private internalUpdateProperties;
|
|
794
|
+
private lines?;
|
|
795
|
+
step(_deltaTime?: number): void;
|
|
796
|
+
private updateDebugRendering;
|
|
763
797
|
postStep(): void;
|
|
764
|
-
|
|
765
|
-
private
|
|
766
|
-
private
|
|
767
|
-
private
|
|
768
|
-
private
|
|
769
|
-
private raiseCollisionEvents;
|
|
770
|
-
private onEndContact;
|
|
798
|
+
/** sync rendered objects with physics world (except for colliders without rigidbody) */
|
|
799
|
+
private syncObjects;
|
|
800
|
+
private syncPhysicsBody;
|
|
801
|
+
private static _matricesBuffer;
|
|
802
|
+
private getRigidbodyRelativeMatrix;
|
|
771
803
|
}
|
|
772
804
|
export interface IColliderProvider {
|
|
773
805
|
getCollider(obj: Object3D): ICollider;
|
|
@@ -1150,7 +1182,7 @@ declare module "engine-components/Component" {
|
|
|
1150
1182
|
import * as THREE from "three";
|
|
1151
1183
|
import { Context, FrameEvent } from "engine/engine_setup";
|
|
1152
1184
|
import { Object3D } from "three";
|
|
1153
|
-
import { ConstructorConcrete, SourceIdentifier, IComponent, IGameObject, Constructor, GuidsMap, Collision } from "engine/engine_types";
|
|
1185
|
+
import { ConstructorConcrete, SourceIdentifier, IComponent, IGameObject, Constructor, GuidsMap, Collision, ICollider } from "engine/engine_types";
|
|
1154
1186
|
import { InstantiateOptions, HideFlags } from "engine/engine_gameobject";
|
|
1155
1187
|
abstract class GameObject extends THREE.Object3D implements THREE.Object3D, IGameObject {
|
|
1156
1188
|
guid: string | undefined;
|
|
@@ -1226,6 +1258,7 @@ declare module "engine-components/Component" {
|
|
|
1226
1258
|
onEnable(): void;
|
|
1227
1259
|
onDisable(): void;
|
|
1228
1260
|
onDestroy(): void;
|
|
1261
|
+
onValidate?(prop?: string): void;
|
|
1229
1262
|
start?(): void;
|
|
1230
1263
|
earlyUpdate?(): void;
|
|
1231
1264
|
update?(): void;
|
|
@@ -1234,11 +1267,10 @@ declare module "engine-components/Component" {
|
|
|
1234
1267
|
onAfterRender?(): void;
|
|
1235
1268
|
onCollisionEnter?(col: Collision): any;
|
|
1236
1269
|
onCollisionExit?(col: Collision): any;
|
|
1237
|
-
onCollisionExitRaw?(col: Collision): any;
|
|
1238
1270
|
onCollisionStay?(col: Collision): any;
|
|
1239
|
-
onTriggerEnter?(col:
|
|
1240
|
-
onTriggerStay?(col:
|
|
1241
|
-
onTriggerExit?(col:
|
|
1271
|
+
onTriggerEnter?(col: ICollider): any;
|
|
1272
|
+
onTriggerStay?(col: ICollider): any;
|
|
1273
|
+
onTriggerExit?(col: ICollider): any;
|
|
1242
1274
|
startCoroutine(routine: Generator, evt?: FrameEvent): Generator;
|
|
1243
1275
|
stopCoroutine(routine: Generator, evt?: FrameEvent): void;
|
|
1244
1276
|
get destroyed(): boolean;
|
|
@@ -1249,6 +1281,7 @@ declare module "engine-components/Component" {
|
|
|
1249
1281
|
protected __isEnabled: boolean | undefined;
|
|
1250
1282
|
private __destroyed;
|
|
1251
1283
|
get __internalDidAwakeAndStart(): boolean;
|
|
1284
|
+
constructor();
|
|
1252
1285
|
__internalNewInstanceCreated(): void;
|
|
1253
1286
|
__internalAwake(): void;
|
|
1254
1287
|
__internalStart(): void;
|
|
@@ -1257,16 +1290,6 @@ declare module "engine-components/Component" {
|
|
|
1257
1290
|
__internalDestroy(): void;
|
|
1258
1291
|
get enabled(): boolean;
|
|
1259
1292
|
set enabled(val: boolean);
|
|
1260
|
-
constructor();
|
|
1261
|
-
private _collisionExitRoutine;
|
|
1262
|
-
private _collisions;
|
|
1263
|
-
private _triggerExitRoutine;
|
|
1264
|
-
private _triggerCollisions;
|
|
1265
|
-
get collisionsCount(): number;
|
|
1266
|
-
private __internalResetsCachedPhysicsData;
|
|
1267
|
-
__internalHandleCollision(col: Collision, isTriggerCollision: boolean): void;
|
|
1268
|
-
__internalHandleExitCollisionEvent(obj: Object3D, isTriggerCollision: boolean): void;
|
|
1269
|
-
private __waitForCollisionExit;
|
|
1270
1293
|
private static _worldPositionBuffer;
|
|
1271
1294
|
private static _worldQuaternionBuffer;
|
|
1272
1295
|
private static _worldEulerBuffer;
|
|
@@ -2006,7 +2029,8 @@ declare module "engine-components/Animator" {
|
|
|
2006
2029
|
declare module "engine-components/Animation" {
|
|
2007
2030
|
import { Behaviour } from "engine-components/Component";
|
|
2008
2031
|
import * as THREE from 'three';
|
|
2009
|
-
import { AnimationAction, AnimationClip
|
|
2032
|
+
import { AnimationAction, AnimationClip } from "three";
|
|
2033
|
+
import { Vec2 } from "engine/engine_types";
|
|
2010
2034
|
export class PlayOptions {
|
|
2011
2035
|
fadeDuration?: number;
|
|
2012
2036
|
loop?: boolean;
|
|
@@ -2014,14 +2038,14 @@ declare module "engine-components/Animation" {
|
|
|
2014
2038
|
startTime?: number;
|
|
2015
2039
|
endTime?: number;
|
|
2016
2040
|
clampWhenFinished?: boolean;
|
|
2017
|
-
minMaxSpeed?:
|
|
2018
|
-
minMaxOffsetNormalized?:
|
|
2041
|
+
minMaxSpeed?: Vec2;
|
|
2042
|
+
minMaxOffsetNormalized?: Vec2;
|
|
2019
2043
|
}
|
|
2020
2044
|
export class Animation extends Behaviour {
|
|
2021
2045
|
playAutomatically: boolean;
|
|
2022
2046
|
randomStartTime: boolean;
|
|
2023
|
-
minMaxSpeed?:
|
|
2024
|
-
minMaxOffsetNormalized?:
|
|
2047
|
+
minMaxSpeed?: Vec2;
|
|
2048
|
+
minMaxOffsetNormalized?: Vec2;
|
|
2025
2049
|
private _tempAnimationClipBeforeGameObjectExisted;
|
|
2026
2050
|
get clip(): AnimationClip | null;
|
|
2027
2051
|
set clip(val: AnimationClip | null);
|
|
@@ -2313,6 +2337,13 @@ declare module "engine/engine_element" {
|
|
|
2313
2337
|
private onBeforeBeginLoading;
|
|
2314
2338
|
}
|
|
2315
2339
|
}
|
|
2340
|
+
declare module "engine/engine_util_decorator" {
|
|
2341
|
+
import { IComponent } from "engine/engine_types";
|
|
2342
|
+
type setter = (v: any) => void;
|
|
2343
|
+
type getter = () => any;
|
|
2344
|
+
/** create accessor callbacks for a field */
|
|
2345
|
+
export const validate: (set?: setter, get?: getter) => (target: IComponent | any, propertyKey: string, descriptor?: undefined) => void;
|
|
2346
|
+
}
|
|
2316
2347
|
declare module "engine/api" {
|
|
2317
2348
|
export { InstancingUtil } from "engine/engine_instancing";
|
|
2318
2349
|
export * from "engine/engine_gameobject";
|
|
@@ -2320,6 +2351,7 @@ declare module "engine/api" {
|
|
|
2320
2351
|
export { AssetReference } from "engine/engine_addressables";
|
|
2321
2352
|
export { FrameEvent } from "engine/engine_setup";
|
|
2322
2353
|
export * from "engine/debug/debug";
|
|
2354
|
+
export { validate } from "engine/engine_util_decorator";
|
|
2323
2355
|
}
|
|
2324
2356
|
declare module "engine-components/AlignmentConstraint" {
|
|
2325
2357
|
import { Behaviour } from "engine-components/Component";
|
|
@@ -2529,65 +2561,79 @@ declare module "engine-components/BoxHelperComponent" {
|
|
|
2529
2561
|
}
|
|
2530
2562
|
declare module "engine-components/RigidBody" {
|
|
2531
2563
|
import { Behaviour } from "engine-components/Component";
|
|
2532
|
-
import * as CANNON from 'cannon-es';
|
|
2533
2564
|
import * as THREE from 'three';
|
|
2534
2565
|
import { Vector3 } from "three";
|
|
2535
2566
|
import { IRigidbody } from "engine/engine_types";
|
|
2567
|
+
import { CollisionDetectionMode, RigidbodyConstraints } from "engine/engine_physics.types";
|
|
2536
2568
|
export class Rigidbody extends Behaviour implements IRigidbody {
|
|
2537
2569
|
mass: number;
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2570
|
+
useGravity: boolean;
|
|
2571
|
+
constraints: RigidbodyConstraints;
|
|
2572
|
+
isKinematic: boolean;
|
|
2541
2573
|
drag: number;
|
|
2542
2574
|
angularDrag: number;
|
|
2543
2575
|
detectCollisions: boolean;
|
|
2544
2576
|
sleepThreshold: number;
|
|
2545
|
-
|
|
2577
|
+
collisionDetectionMode: CollisionDetectionMode;
|
|
2578
|
+
get lockPositionX(): boolean;
|
|
2579
|
+
get lockPositionY(): boolean;
|
|
2580
|
+
get lockPositionZ(): boolean;
|
|
2581
|
+
get lockRotationX(): boolean;
|
|
2582
|
+
get lockRotationY(): boolean;
|
|
2583
|
+
get lockRotationZ(): boolean;
|
|
2584
|
+
set lockPositionX(v: boolean);
|
|
2585
|
+
set lockPositionY(v: boolean);
|
|
2586
|
+
set lockPositionZ(v: boolean);
|
|
2587
|
+
set lockRotationX(v: boolean);
|
|
2588
|
+
set lockRotationY(v: boolean);
|
|
2589
|
+
set lockRotationZ(v: boolean);
|
|
2590
|
+
private _propertiesChanged;
|
|
2546
2591
|
private static tempPosition;
|
|
2547
|
-
private
|
|
2548
|
-
private currentVelocity;
|
|
2592
|
+
private _currentVelocity;
|
|
2549
2593
|
private _smoothedVelocity;
|
|
2550
|
-
private
|
|
2551
|
-
private
|
|
2552
|
-
private
|
|
2553
|
-
private _positionWatch?;
|
|
2554
|
-
private _matrixWatch?;
|
|
2555
|
-
private _setMatrix;
|
|
2556
|
-
constructor();
|
|
2594
|
+
private _smoothedVelocityGetter;
|
|
2595
|
+
private _lastPosition;
|
|
2596
|
+
private _watch?;
|
|
2557
2597
|
awake(): void;
|
|
2558
2598
|
onEnable(): void;
|
|
2559
2599
|
onDisable(): void;
|
|
2560
2600
|
onDestroy(): void;
|
|
2561
|
-
|
|
2562
|
-
|
|
2601
|
+
onValidate(): void;
|
|
2602
|
+
earlyUpdate(): void;
|
|
2603
|
+
private get body();
|
|
2604
|
+
resetForces(): void;
|
|
2605
|
+
resetTorques(): void;
|
|
2606
|
+
resetVelocities(): void;
|
|
2607
|
+
resetForcesAndTorques(): void;
|
|
2563
2608
|
wakeUp(): void;
|
|
2564
|
-
applyForce(vec:
|
|
2609
|
+
applyForce(vec: Vector3, _rel?: THREE.Vector3): void;
|
|
2610
|
+
applyImpulse(vec: Vector3): void;
|
|
2565
2611
|
setForce(x: number, y: number, z: number): void;
|
|
2566
|
-
getVelocity():
|
|
2567
|
-
setVelocity(x: number | Vector3, y
|
|
2568
|
-
|
|
2612
|
+
getVelocity(): Vector3;
|
|
2613
|
+
setVelocity(x: number | Vector3, y?: number, z?: number): void;
|
|
2614
|
+
setAngularVelocity(x: number | Vector3, y?: number, z?: number): void;
|
|
2569
2615
|
setTorque(x: number | Vector3, y: number, z: number): void;
|
|
2570
|
-
get smoothedVelocity():
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2616
|
+
get smoothedVelocity(): Vector3;
|
|
2617
|
+
/**d
|
|
2618
|
+
* @deprecated not used anymore
|
|
2619
|
+
*/
|
|
2620
|
+
setBodyFromGameObject(_velocity?: THREE.Vector3 | null | {
|
|
2574
2621
|
x: number;
|
|
2575
2622
|
y: number;
|
|
2576
2623
|
z: number;
|
|
2577
2624
|
}): void;
|
|
2578
|
-
private
|
|
2625
|
+
private captureVelocity;
|
|
2579
2626
|
}
|
|
2580
2627
|
}
|
|
2581
2628
|
declare module "engine-components/Collider" {
|
|
2582
2629
|
import { Behaviour } from "engine-components/Component";
|
|
2583
2630
|
import { Rigidbody } from "engine-components/RigidBody";
|
|
2584
|
-
import {
|
|
2631
|
+
import { Mesh } from "three";
|
|
2585
2632
|
import { ICollider } from "engine/engine_types";
|
|
2586
2633
|
export class Collider extends Behaviour implements ICollider {
|
|
2587
2634
|
get isCollider(): any;
|
|
2588
2635
|
attachedRigidbody: Rigidbody | null;
|
|
2589
2636
|
isTrigger: boolean;
|
|
2590
|
-
protected _shape: Shape | null;
|
|
2591
2637
|
awake(): void;
|
|
2592
2638
|
start(): void;
|
|
2593
2639
|
onEnable(): void;
|
|
@@ -2603,6 +2649,12 @@ declare module "engine-components/Collider" {
|
|
|
2603
2649
|
center: THREE.Vector3;
|
|
2604
2650
|
onEnable(): void;
|
|
2605
2651
|
}
|
|
2652
|
+
export class MeshCollider extends Collider {
|
|
2653
|
+
sharedMesh?: Mesh;
|
|
2654
|
+
convex: boolean;
|
|
2655
|
+
awake(): void;
|
|
2656
|
+
onEnable(): void;
|
|
2657
|
+
}
|
|
2606
2658
|
}
|
|
2607
2659
|
declare module "engine-components/ui/PointerEvents" {
|
|
2608
2660
|
export interface IInputEventArgs {
|
|
@@ -3554,6 +3606,7 @@ declare module "engine-components/WebXR" {
|
|
|
3554
3606
|
get webxr(): WebXR;
|
|
3555
3607
|
private _webxr;
|
|
3556
3608
|
private reticle;
|
|
3609
|
+
private reticleParent;
|
|
3557
3610
|
private hitTestSource;
|
|
3558
3611
|
private reticleActive;
|
|
3559
3612
|
private previousBackground;
|
|
@@ -3882,13 +3935,6 @@ declare module "engine-components/LODGroup" {
|
|
|
3882
3935
|
distanceFactor(factor: number): void;
|
|
3883
3936
|
}
|
|
3884
3937
|
}
|
|
3885
|
-
declare module "engine-components/NavMesh" {
|
|
3886
|
-
import { Behaviour } from "engine-components/Component";
|
|
3887
|
-
export class NavMesh extends Behaviour {
|
|
3888
|
-
}
|
|
3889
|
-
export class NavMeshAgent extends Behaviour {
|
|
3890
|
-
}
|
|
3891
|
-
}
|
|
3892
3938
|
declare module "engine-components/NestedGltf" {
|
|
3893
3939
|
import { Behaviour } from "engine-components/Component";
|
|
3894
3940
|
import { AssetReference, ProgressCallback } from "engine/engine_addressables";
|
|
@@ -4323,6 +4369,7 @@ declare module "engine-components/SpectatorCamera" {
|
|
|
4323
4369
|
/** list of other users that are following me */
|
|
4324
4370
|
get followers(): string[];
|
|
4325
4371
|
stopSpectating(): void;
|
|
4372
|
+
private get localId();
|
|
4326
4373
|
/** player view to follow */
|
|
4327
4374
|
set target(target: PlayerView | undefined);
|
|
4328
4375
|
get target(): PlayerView | undefined;
|
|
@@ -4347,21 +4394,6 @@ declare module "engine-components/SpectatorCamera" {
|
|
|
4347
4394
|
private resetAvatarFlags;
|
|
4348
4395
|
}
|
|
4349
4396
|
}
|
|
4350
|
-
declare module "engine-components/SpringJoint" {
|
|
4351
|
-
import { Behaviour } from "engine-components/Component";
|
|
4352
|
-
import { Rigidbody } from "engine-components/RigidBody";
|
|
4353
|
-
import { Vector3 } from "three";
|
|
4354
|
-
export class SpringJoint extends Behaviour {
|
|
4355
|
-
anchor: Vector3 | null;
|
|
4356
|
-
connectedBody: Rigidbody | null;
|
|
4357
|
-
connectedAnchor: Vector3 | null;
|
|
4358
|
-
spring: number;
|
|
4359
|
-
damper: number;
|
|
4360
|
-
private rb;
|
|
4361
|
-
awake(): void;
|
|
4362
|
-
update(): void;
|
|
4363
|
-
}
|
|
4364
|
-
}
|
|
4365
4397
|
declare module "engine-components/SpriteRenderer" {
|
|
4366
4398
|
import { Behaviour } from "engine-components/Component";
|
|
4367
4399
|
import * as THREE from "three";
|
|
@@ -5303,6 +5335,7 @@ declare module "engine-components/codegen/components" {
|
|
|
5303
5335
|
export { Collider } from "engine-components/Collider";
|
|
5304
5336
|
export { SphereCollider } from "engine-components/Collider";
|
|
5305
5337
|
export { BoxCollider } from "engine-components/Collider";
|
|
5338
|
+
export { MeshCollider } from "engine-components/Collider";
|
|
5306
5339
|
export { DeleteBox } from "engine-components/DeleteBox";
|
|
5307
5340
|
export { Deletable } from "engine-components/DeleteBox";
|
|
5308
5341
|
export { DeviceFlag } from "engine-components/DeviceFlag";
|
|
@@ -5325,8 +5358,6 @@ declare module "engine-components/codegen/components" {
|
|
|
5325
5358
|
export { LODModel } from "engine-components/LODGroup";
|
|
5326
5359
|
export { LODGroup } from "engine-components/LODGroup";
|
|
5327
5360
|
export { LookAtConstraint } from "engine-components/LookAtConstraint";
|
|
5328
|
-
export { NavMesh } from "engine-components/NavMesh";
|
|
5329
|
-
export { NavMeshAgent } from "engine-components/NavMesh";
|
|
5330
5361
|
export { NestedGltf } from "engine-components/NestedGltf";
|
|
5331
5362
|
export { Networking } from "engine-components/Networking";
|
|
5332
5363
|
export { OffsetConstraint } from "engine-components/OffsetConstraint";
|
|
@@ -5351,7 +5382,6 @@ declare module "engine-components/codegen/components" {
|
|
|
5351
5382
|
export { SpatialTriggerReceiver } from "engine-components/SpatialTrigger";
|
|
5352
5383
|
export { SpatialTrigger } from "engine-components/SpatialTrigger";
|
|
5353
5384
|
export { SpectatorCamera } from "engine-components/SpectatorCamera";
|
|
5354
|
-
export { SpringJoint } from "engine-components/SpringJoint";
|
|
5355
5385
|
export { Sprite } from "engine-components/SpriteRenderer";
|
|
5356
5386
|
export { SpriteRenderer } from "engine-components/SpriteRenderer";
|
|
5357
5387
|
export { SyncedCamera } from "engine-components/SyncedCamera";
|