@needle-tools/engine 2.39.0-pre → 2.41.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 +17 -0
- package/dist/needle-engine.d.ts +359 -130
- package/dist/needle-engine.js +389 -389
- package/dist/needle-engine.js.map +4 -4
- package/dist/needle-engine.min.js +71 -71
- 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/engine_gizmos.d.ts +25 -0
- package/lib/engine/engine_gizmos.js +109 -5
- package/lib/engine/engine_gizmos.js.map +1 -1
- package/lib/engine/engine_input.d.ts +2 -0
- package/lib/engine/engine_input.js +9 -2
- package/lib/engine/engine_input.js.map +1 -1
- package/lib/engine/engine_math.d.ts +9 -6
- package/lib/engine/engine_math.js +9 -0
- package/lib/engine/engine_math.js.map +1 -1
- package/lib/engine/engine_networking.d.ts +1 -0
- package/lib/engine/engine_networking.js +9 -0
- package/lib/engine/engine_networking.js.map +1 -1
- package/lib/engine/engine_physics.d.ts +20 -2
- package/lib/engine/engine_physics.js +141 -16
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/engine_serialization_core.js +2 -0
- package/lib/engine/engine_serialization_core.js.map +1 -1
- package/lib/engine/engine_three_utils.js +1 -22
- package/lib/engine/engine_three_utils.js.map +1 -1
- package/lib/engine/engine_types.d.ts +12 -6
- package/lib/engine/engine_types.js +22 -5
- package/lib/engine/engine_types.js.map +1 -1
- package/lib/engine/engine_utils.d.ts +9 -0
- package/lib/engine/engine_utils.js +25 -0
- package/lib/engine/engine_utils.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_lightmaps.js +1 -1
- package/lib/engine/extensions/NEEDLE_lightmaps.js.map +1 -1
- package/lib/engine-components/AnimationCurve.js +20 -5
- package/lib/engine-components/AnimationCurve.js.map +1 -1
- package/lib/engine-components/Component.d.ts +18 -0
- package/lib/engine-components/Component.js +15 -2
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/Joints.d.ts +5 -1
- package/lib/engine-components/Joints.js +17 -7
- package/lib/engine-components/Joints.js.map +1 -1
- package/lib/engine-components/Light.d.ts +2 -0
- package/lib/engine-components/Light.js +33 -9
- package/lib/engine-components/Light.js.map +1 -1
- package/lib/engine-components/ParticleSystem.d.ts +15 -26
- package/lib/engine-components/ParticleSystem.js +251 -184
- package/lib/engine-components/ParticleSystem.js.map +1 -1
- package/lib/engine-components/ParticleSystemModules.d.ts +208 -63
- package/lib/engine-components/ParticleSystemModules.js +640 -153
- package/lib/engine-components/ParticleSystemModules.js.map +1 -1
- package/lib/engine-components/WebXR.js +8 -3
- package/lib/engine-components/WebXR.js.map +1 -1
- package/lib/engine-components/codegen/components.d.ts +7 -0
- package/lib/engine-components/codegen/components.js +7 -0
- package/lib/engine-components/codegen/components.js.map +1 -1
- package/package.json +3 -1
- package/src/engine/api.ts +2 -1
- package/src/engine/codegen/register_types.js +28 -0
- package/src/engine/engine_gizmos.ts +132 -5
- package/src/engine/engine_input.ts +12 -2
- package/src/engine/engine_math.ts +19 -6
- package/src/engine/engine_networking.ts +10 -0
- package/src/engine/engine_physics.ts +169 -17
- package/src/engine/engine_serialization_core.ts +1 -0
- package/src/engine/engine_three_utils.ts +1 -29
- package/src/engine/engine_types.ts +33 -14
- package/src/engine/engine_utils.ts +32 -0
- package/src/engine/extensions/NEEDLE_lightmaps.ts +1 -1
- package/src/engine-components/AnimationCurve.ts +25 -11
- package/src/engine-components/Component.ts +30 -4
- package/src/engine-components/Joints.ts +19 -7
- package/src/engine-components/Light.ts +39 -8
- package/src/engine-components/ParticleSystem.ts +314 -194
- package/src/engine-components/ParticleSystemModules.ts +537 -154
- package/src/engine-components/WebXR.ts +11 -8
- package/src/engine-components/codegen/components.ts +7 -0
- package/src/engine/dist/engine_physics.js +0 -739
- package/src/engine/dist/engine_setup.js +0 -777
- package/src/engine-components/dist/CharacterController.js +0 -123
- package/src/engine-components/dist/RigidBody.js +0 -458
package/dist/needle-engine.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
declare module "engine/engine_math" {
|
|
2
2
|
class MathHelper {
|
|
3
3
|
random(): number;
|
|
4
|
-
clamp(value:
|
|
5
|
-
clamp01(value:
|
|
6
|
-
lerp(value1:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
clamp(value: number, min: number, max: number): number;
|
|
5
|
+
clamp01(value: number): number;
|
|
6
|
+
lerp(value1: number, value2: number, amount: number): number;
|
|
7
|
+
remap(value: number, min1: number, max1: number, min2: number, max2: number): number;
|
|
8
|
+
moveTowards(value1: number, value2: number, amount: number): number;
|
|
9
|
+
toDegrees(radians: number): number;
|
|
10
|
+
toRadians(degrees: number): number;
|
|
11
|
+
gammaToLinear(gamma: number): number;
|
|
12
|
+
linearToGamma(linear: number): number;
|
|
10
13
|
}
|
|
11
14
|
const Mathf: MathHelper;
|
|
12
15
|
export { Mathf };
|
|
@@ -48,6 +51,28 @@ declare module "engine/engine_physics.types" {
|
|
|
48
51
|
All = -1
|
|
49
52
|
}
|
|
50
53
|
}
|
|
54
|
+
declare module "engine/engine_three_utils" {
|
|
55
|
+
import * as THREE from "three";
|
|
56
|
+
import { Vector3 } from "three";
|
|
57
|
+
export function lookAtInverse(obj: THREE.Object3D, target: Vector3): void;
|
|
58
|
+
export function getWorldPosition(obj: THREE.Object3D, vec?: THREE.Vector3 | null, updateParents?: boolean): THREE.Vector3;
|
|
59
|
+
export function setWorldPosition(obj: THREE.Object3D, val: THREE.Vector3): void;
|
|
60
|
+
export function setWorldPositionXYZ(obj: THREE.Object3D, x: number, y: number, z: number): void;
|
|
61
|
+
export function getWorldQuaternion(obj: THREE.Object3D, target?: THREE.Quaternion | null): THREE.Quaternion;
|
|
62
|
+
export function setWorldQuaternion(obj: THREE.Object3D, val: THREE.Quaternion): void;
|
|
63
|
+
export function setWorldQuaternionXYZW(obj: THREE.Object3D, x: number, y: number, z: number, w: number): void;
|
|
64
|
+
export function getWorldScale(obj: THREE.Object3D, vec?: THREE.Vector3 | null): THREE.Vector3;
|
|
65
|
+
export function setWorldScale(obj: THREE.Object3D, vec: THREE.Vector3): void;
|
|
66
|
+
export function forward(obj: THREE.Object3D): THREE.Vector3;
|
|
67
|
+
export function getWorldEuler(obj: THREE.Object3D): THREE.Euler;
|
|
68
|
+
export function setWorldEuler(obj: THREE.Object3D, val: THREE.Euler): void;
|
|
69
|
+
export function getWorldRotation(obj: THREE.Object3D): THREE.Vector3;
|
|
70
|
+
export function setWorldRotation(obj: THREE.Object3D, val: THREE.Vector3): void;
|
|
71
|
+
export function setWorldRotationXYZ(obj: THREE.Object3D, x: number, y: number, z: number, degrees?: boolean): void;
|
|
72
|
+
export function logHierarchy(root: THREE.Object3D | null | undefined, collapsible?: boolean): void;
|
|
73
|
+
export function copyTexture(texture: THREE.Texture): THREE.Texture;
|
|
74
|
+
export function textureToCanvas(texture: THREE.Texture, force?: boolean): HTMLCanvasElement | null;
|
|
75
|
+
}
|
|
51
76
|
declare module "engine/engine_types" {
|
|
52
77
|
import { Camera, Color, Material, Object3D, Vector3, Quaternion } from "three";
|
|
53
78
|
import { RGBAColor } from "engine-components/js-extensions/RGBAColor";
|
|
@@ -160,20 +185,26 @@ declare module "engine/engine_types" {
|
|
|
160
185
|
export type ICollisionContext = {
|
|
161
186
|
getCollider(obj: Object3D): ICollider;
|
|
162
187
|
};
|
|
163
|
-
export type
|
|
188
|
+
export type Vec2 = {
|
|
164
189
|
x: number;
|
|
165
190
|
y: number;
|
|
166
|
-
z: number;
|
|
167
191
|
};
|
|
168
|
-
export type
|
|
192
|
+
export type Vec3 = {
|
|
169
193
|
x: number;
|
|
170
194
|
y: number;
|
|
195
|
+
z: number;
|
|
171
196
|
};
|
|
172
197
|
export class ContactPoint {
|
|
173
|
-
readonly
|
|
198
|
+
private readonly _point;
|
|
199
|
+
private readonly _normal;
|
|
174
200
|
readonly distance: number;
|
|
175
|
-
readonly
|
|
176
|
-
|
|
201
|
+
readonly impulse: number;
|
|
202
|
+
readonly friction: number;
|
|
203
|
+
/** worldspace point */
|
|
204
|
+
get point(): Vector3;
|
|
205
|
+
/** worldspace normal */
|
|
206
|
+
get normal(): Vector3;
|
|
207
|
+
constructor(point: Vec3, dist: number, normal: Vec3, impulse: number, friction: number);
|
|
177
208
|
}
|
|
178
209
|
export class Collision {
|
|
179
210
|
readonly contacts: ContactPoint[];
|
|
@@ -194,6 +225,14 @@ declare module "engine/engine_utils" {
|
|
|
194
225
|
export const nameofFactory: <T>() => (name: keyof T) => keyof T;
|
|
195
226
|
export function nameof<T>(name: keyof T): keyof T;
|
|
196
227
|
export function isDebugMode(): boolean;
|
|
228
|
+
export class CircularBuffer<T> {
|
|
229
|
+
private _factory;
|
|
230
|
+
private _cache;
|
|
231
|
+
private _maxSize;
|
|
232
|
+
private _index;
|
|
233
|
+
constructor(factory: () => T, maxSize: number);
|
|
234
|
+
get(): T;
|
|
235
|
+
}
|
|
197
236
|
export function getUrlParams(): URLSearchParams;
|
|
198
237
|
export function getParam(paramName: string): string | boolean;
|
|
199
238
|
export function setParam(paramName: string, paramValue: string): void;
|
|
@@ -225,6 +264,7 @@ declare module "engine/engine_utils" {
|
|
|
225
264
|
revoke(): void;
|
|
226
265
|
dispose(): void;
|
|
227
266
|
}
|
|
267
|
+
export function isMobileDevice(): boolean;
|
|
228
268
|
}
|
|
229
269
|
declare module "engine/extensions/extension_resolver" {
|
|
230
270
|
import { GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
@@ -389,6 +429,7 @@ declare module "engine/engine_serialization_core" {
|
|
|
389
429
|
declare module "engine/engine_input" {
|
|
390
430
|
import * as THREE from 'three';
|
|
391
431
|
import { Context } from "engine/engine_setup";
|
|
432
|
+
import { Vec2 } from "engine/engine_types";
|
|
392
433
|
export type PointerEventArgs = {
|
|
393
434
|
button: number;
|
|
394
435
|
clientX: number;
|
|
@@ -470,6 +511,7 @@ declare module "engine/engine_input" {
|
|
|
470
511
|
createPointerDown(args: PointerEventArgs): void;
|
|
471
512
|
createPointerMove(args: PointerEventArgs): void;
|
|
472
513
|
createPointerUp(args: PointerEventArgs): void;
|
|
514
|
+
convertScreenspaceToRaycastSpace(vec2: Vec2): void;
|
|
473
515
|
constructor(context: Context);
|
|
474
516
|
private onLostFocus;
|
|
475
517
|
private onEndOfFrame;
|
|
@@ -580,28 +622,6 @@ declare module "engine/engine_input" {
|
|
|
580
622
|
F12 = "F12"
|
|
581
623
|
}
|
|
582
624
|
}
|
|
583
|
-
declare module "engine/engine_three_utils" {
|
|
584
|
-
import * as THREE from "three";
|
|
585
|
-
import { Vector3 } from "three";
|
|
586
|
-
export function lookAtInverse(obj: THREE.Object3D, target: Vector3): void;
|
|
587
|
-
export function getWorldPosition(obj: THREE.Object3D, vec?: THREE.Vector3 | null, updateParents?: boolean): THREE.Vector3;
|
|
588
|
-
export function setWorldPosition(obj: THREE.Object3D, val: THREE.Vector3): void;
|
|
589
|
-
export function setWorldPositionXYZ(obj: THREE.Object3D, x: number, y: number, z: number): void;
|
|
590
|
-
export function getWorldQuaternion(obj: THREE.Object3D, target?: THREE.Quaternion | null): THREE.Quaternion;
|
|
591
|
-
export function setWorldQuaternion(obj: THREE.Object3D, val: THREE.Quaternion): void;
|
|
592
|
-
export function setWorldQuaternionXYZW(obj: THREE.Object3D, x: number, y: number, z: number, w: number): void;
|
|
593
|
-
export function getWorldScale(obj: THREE.Object3D, vec?: THREE.Vector3 | null): THREE.Vector3;
|
|
594
|
-
export function setWorldScale(obj: THREE.Object3D, vec: THREE.Vector3): void;
|
|
595
|
-
export function forward(obj: THREE.Object3D): THREE.Vector3;
|
|
596
|
-
export function getWorldEuler(obj: THREE.Object3D): THREE.Euler;
|
|
597
|
-
export function setWorldEuler(obj: THREE.Object3D, val: THREE.Euler): void;
|
|
598
|
-
export function getWorldRotation(obj: THREE.Object3D): THREE.Vector3;
|
|
599
|
-
export function setWorldRotation(obj: THREE.Object3D, val: THREE.Vector3): void;
|
|
600
|
-
export function setWorldRotationXYZ(obj: THREE.Object3D, x: number, y: number, z: number, degrees?: boolean): void;
|
|
601
|
-
export function logHierarchy(root: THREE.Object3D | null | undefined, collapsible?: boolean): void;
|
|
602
|
-
export function copyTexture(texture: THREE.Texture): THREE.Texture;
|
|
603
|
-
export function textureToCanvas(texture: THREE.Texture, force?: boolean): HTMLCanvasElement | null;
|
|
604
|
-
}
|
|
605
625
|
declare module "engine/engine_instancing" {
|
|
606
626
|
export const NEED_UPDATE_INSTANCE_KEY: unique symbol;
|
|
607
627
|
export class InstancingUtil {
|
|
@@ -746,10 +766,39 @@ declare module "engine/engine_gameobject" {
|
|
|
746
766
|
export function foreachComponent(instance: THREE.Object3D, cb: (comp: Component) => any, recursive?: boolean): any;
|
|
747
767
|
export function instantiate(instance: GameObject | Object3D | null, opts?: InstantiateOptions | null): GameObject | null;
|
|
748
768
|
}
|
|
769
|
+
declare module "engine/engine_gizmos" {
|
|
770
|
+
import * as THREE from 'three';
|
|
771
|
+
import { ColorRepresentation } from 'three';
|
|
772
|
+
import { Vec3 } from "engine/engine_types";
|
|
773
|
+
export class Gizmos {
|
|
774
|
+
static DrawRay(origin: Vec3, dir: Vec3, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
775
|
+
static DrawDirection(pt: Vec3, direction: Vec3, color?: ColorRepresentation, duration?: number, depthTest?: boolean, lengthFactor?: number): void;
|
|
776
|
+
static DrawLine(pt0: {
|
|
777
|
+
x: number;
|
|
778
|
+
y: number;
|
|
779
|
+
z: number;
|
|
780
|
+
}, pt1: {
|
|
781
|
+
x: number;
|
|
782
|
+
y: number;
|
|
783
|
+
z: number;
|
|
784
|
+
}, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
785
|
+
static DrawWireSphere(center: {
|
|
786
|
+
x: number;
|
|
787
|
+
y: number;
|
|
788
|
+
z: number;
|
|
789
|
+
}, radius: number, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
790
|
+
static DrawSphere(center: {
|
|
791
|
+
x: number;
|
|
792
|
+
y: number;
|
|
793
|
+
z: number;
|
|
794
|
+
}, radius: number, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
795
|
+
}
|
|
796
|
+
export function CreateWireCube(col?: THREE.ColorRepresentation | null): THREE.LineSegments;
|
|
797
|
+
}
|
|
749
798
|
declare module "engine/engine_physics" {
|
|
750
799
|
import { Camera, Intersection, Layers, Mesh, Object3D, Ray, Raycaster, Vector2, Vector3 } from 'three';
|
|
751
800
|
import { Context } from "engine/engine_setup";
|
|
752
|
-
import { IComponent, ICollider, IRigidbody } from "engine/engine_types";
|
|
801
|
+
import { IComponent, ICollider, IRigidbody, Vec3, Vec2 } from "engine/engine_types";
|
|
753
802
|
import RAPIER, { RigidBody } from '@dimforge/rapier3d-compat';
|
|
754
803
|
export type Rapier = typeof RAPIER;
|
|
755
804
|
export class RaycastOptions {
|
|
@@ -786,7 +835,19 @@ declare module "engine/engine_physics" {
|
|
|
786
835
|
private tempBoundingBox;
|
|
787
836
|
private onSphereOverlap;
|
|
788
837
|
raycastFromRay(ray: Ray, options?: RaycastOptions | null): Array<Intersection>;
|
|
838
|
+
/** raycast against rendered three objects. This might be very slow depending on your scene complexity.
|
|
839
|
+
* We recommend setting objects to IgnoreRaycast layer (2) when you don't need them to be raycasted.
|
|
840
|
+
* Raycasting SkinnedMeshes is specially expensive.
|
|
841
|
+
*/
|
|
789
842
|
raycast(options?: RaycastOptions | null): Array<Intersection>;
|
|
843
|
+
private rapierRay;
|
|
844
|
+
private raycastVectorsBuffer;
|
|
845
|
+
/** raycast against colliders */
|
|
846
|
+
raycastPhysicsFast(origin: Vec2 | Vec3, direction?: Vec3 | undefined, maxDistance?: number, solid?: boolean): null | {
|
|
847
|
+
point: Vector3;
|
|
848
|
+
collider: ICollider;
|
|
849
|
+
};
|
|
850
|
+
private getPhysicsRay;
|
|
790
851
|
private _tempPosition;
|
|
791
852
|
private _tempQuaternion;
|
|
792
853
|
private _tempScale;
|
|
@@ -827,11 +888,17 @@ declare module "engine/engine_physics" {
|
|
|
827
888
|
private getRigidbodyRelativeMatrix;
|
|
828
889
|
private static centerConnectionPos;
|
|
829
890
|
private static centerConnectionRot;
|
|
830
|
-
addFixedJoint(body1: IRigidbody, body2: IRigidbody
|
|
891
|
+
addFixedJoint(body1: IRigidbody, body2: IRigidbody): void;
|
|
892
|
+
addHingeJoint(body1: IRigidbody, body2: IRigidbody, anchor: {
|
|
893
|
+
x: number;
|
|
894
|
+
y: number;
|
|
895
|
+
z: number;
|
|
896
|
+
}, axis: {
|
|
831
897
|
x: number;
|
|
832
898
|
y: number;
|
|
833
899
|
z: number;
|
|
834
900
|
}): void;
|
|
901
|
+
private calculateJointRelativeMatrices;
|
|
835
902
|
}
|
|
836
903
|
}
|
|
837
904
|
declare module "engine/engine_time" {
|
|
@@ -1024,6 +1091,7 @@ declare module "engine/engine_networking" {
|
|
|
1024
1091
|
leaveRoom(room?: string | null): void;
|
|
1025
1092
|
send(key: string | OwnershipEvent, data?: IModel | object | boolean | null | string | number, queue?: SendQueue): void;
|
|
1026
1093
|
sendDeleteRemoteState(guid: string): void;
|
|
1094
|
+
sendDeleteRemoteStateAll(): void;
|
|
1027
1095
|
sendBinary(bin: Uint8Array): void;
|
|
1028
1096
|
private _defaultMessagesBuffer;
|
|
1029
1097
|
private _defaultMessagesBufferArray;
|
|
@@ -1282,10 +1350,15 @@ declare module "engine-components/Component" {
|
|
|
1282
1350
|
sourceId?: SourceIdentifier;
|
|
1283
1351
|
/** 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) */
|
|
1284
1352
|
resolveGuids?(guidsMap: GuidsMap): void;
|
|
1353
|
+
/** called once when the component becomes active for the first time */
|
|
1285
1354
|
awake(): void;
|
|
1355
|
+
/** called every time when the component gets enabled (this is invoked after awake and before start) */
|
|
1286
1356
|
onEnable(): void;
|
|
1287
1357
|
onDisable(): void;
|
|
1288
1358
|
onDestroy(): void;
|
|
1359
|
+
/** called when you decorate fields with the @validate() decorator
|
|
1360
|
+
* @param field the name of the field that was changed
|
|
1361
|
+
*/
|
|
1289
1362
|
onValidate?(prop?: string): void;
|
|
1290
1363
|
start?(): void;
|
|
1291
1364
|
earlyUpdate?(): void;
|
|
@@ -1303,18 +1376,31 @@ declare module "engine-components/Component" {
|
|
|
1303
1376
|
stopCoroutine(routine: Generator, evt?: FrameEvent): void;
|
|
1304
1377
|
get destroyed(): boolean;
|
|
1305
1378
|
destroy(): void;
|
|
1379
|
+
/** @internal */
|
|
1306
1380
|
protected __didAwake: boolean;
|
|
1381
|
+
/** @internal */
|
|
1307
1382
|
private __didStart;
|
|
1383
|
+
/** @internal */
|
|
1308
1384
|
protected __didEnable: boolean;
|
|
1385
|
+
/** @internal */
|
|
1309
1386
|
protected __isEnabled: boolean | undefined;
|
|
1387
|
+
/** @internal */
|
|
1310
1388
|
private __destroyed;
|
|
1389
|
+
/** @internal */
|
|
1311
1390
|
get __internalDidAwakeAndStart(): boolean;
|
|
1391
|
+
/** @internal */
|
|
1312
1392
|
constructor();
|
|
1393
|
+
/** @internal */
|
|
1313
1394
|
__internalNewInstanceCreated(): void;
|
|
1395
|
+
/** @internal */
|
|
1314
1396
|
__internalAwake(): void;
|
|
1397
|
+
/** @internal */
|
|
1315
1398
|
__internalStart(): void;
|
|
1399
|
+
/** @internal */
|
|
1316
1400
|
__internalEnable(): boolean;
|
|
1401
|
+
/** @internal */
|
|
1317
1402
|
__internalDisable(): void;
|
|
1403
|
+
/** @internal */
|
|
1318
1404
|
__internalDestroy(): void;
|
|
1319
1405
|
get enabled(): boolean;
|
|
1320
1406
|
set enabled(val: boolean);
|
|
@@ -2389,6 +2475,7 @@ declare module "engine/api" {
|
|
|
2389
2475
|
export { FrameEvent } from "engine/engine_setup";
|
|
2390
2476
|
export * from "engine/debug/debug";
|
|
2391
2477
|
export { validate } from "engine/engine_util_decorator";
|
|
2478
|
+
export { Gizmos } from "engine/engine_gizmos";
|
|
2392
2479
|
}
|
|
2393
2480
|
declare module "engine-components/AlignmentConstraint" {
|
|
2394
2481
|
import { Behaviour } from "engine-components/Component";
|
|
@@ -2576,10 +2663,6 @@ declare module "engine-components/BasicIKConstraint" {
|
|
|
2576
2663
|
update(): void;
|
|
2577
2664
|
}
|
|
2578
2665
|
}
|
|
2579
|
-
declare module "engine/engine_gizmos" {
|
|
2580
|
-
import * as THREE from 'three';
|
|
2581
|
-
export function CreateWireCube(col?: THREE.ColorRepresentation | null): THREE.LineSegments;
|
|
2582
|
-
}
|
|
2583
2666
|
declare module "engine-components/BoxHelperComponent" {
|
|
2584
2667
|
import { Behaviour } from "engine-components/Component";
|
|
2585
2668
|
import * as THREE from "three";
|
|
@@ -3927,7 +4010,6 @@ declare module "engine-components/Joints" {
|
|
|
3927
4010
|
connectedBody?: Rigidbody;
|
|
3928
4011
|
get rigidBody(): Rigidbody | null;
|
|
3929
4012
|
private _rigidBody;
|
|
3930
|
-
connectedAnchor?: Vector3;
|
|
3931
4013
|
onEnable(): void;
|
|
3932
4014
|
private create;
|
|
3933
4015
|
protected abstract createJoint(self: Rigidbody, other: Rigidbody): any;
|
|
@@ -3935,6 +4017,11 @@ declare module "engine-components/Joints" {
|
|
|
3935
4017
|
export class FixedJoint extends Joint {
|
|
3936
4018
|
protected createJoint(self: Rigidbody, other: Rigidbody): void;
|
|
3937
4019
|
}
|
|
4020
|
+
export class HingeJoint extends Joint {
|
|
4021
|
+
anchor?: Vector3;
|
|
4022
|
+
axis?: Vector3;
|
|
4023
|
+
protected createJoint(self: Rigidbody, other: Rigidbody): void;
|
|
4024
|
+
}
|
|
3938
4025
|
}
|
|
3939
4026
|
declare module "engine-components/Light" {
|
|
3940
4027
|
import { Behaviour } from "engine-components/Component";
|
|
@@ -4006,6 +4093,8 @@ declare module "engine-components/Light" {
|
|
|
4006
4093
|
private onWebXREnded;
|
|
4007
4094
|
createLight(): void;
|
|
4008
4095
|
updateMainLightRoutine(): Generator<undefined, void, unknown>;
|
|
4096
|
+
static allowChangingRendererShadowMapType: boolean;
|
|
4097
|
+
private updateShadowSoftHard;
|
|
4009
4098
|
private setDirectionalLight;
|
|
4010
4099
|
}
|
|
4011
4100
|
}
|
|
@@ -4069,62 +4158,178 @@ declare module "engine-components/OffsetConstraint" {
|
|
|
4069
4158
|
}
|
|
4070
4159
|
declare module "engine-components/ParticleSystemModules" {
|
|
4071
4160
|
import * as THREE from "three";
|
|
4161
|
+
import { Object3D, Vector3 } from "three";
|
|
4162
|
+
import { RGBAColor } from "engine-components/js-extensions/RGBAColor";
|
|
4163
|
+
import { AnimationCurve } from "engine-components/AnimationCurve";
|
|
4164
|
+
import { Vec3 } from "engine/engine_types";
|
|
4165
|
+
type Color4 = {
|
|
4166
|
+
r: number;
|
|
4167
|
+
g: number;
|
|
4168
|
+
b: number;
|
|
4169
|
+
a: number;
|
|
4170
|
+
};
|
|
4171
|
+
type ColorKey = {
|
|
4172
|
+
time: number;
|
|
4173
|
+
color: Color4;
|
|
4174
|
+
};
|
|
4175
|
+
type AlphaKey = {
|
|
4176
|
+
time: number;
|
|
4177
|
+
alpha: number;
|
|
4178
|
+
};
|
|
4179
|
+
export class Gradient {
|
|
4180
|
+
alphaKeys: Array<AlphaKey>;
|
|
4181
|
+
colorKeys: Array<ColorKey>;
|
|
4182
|
+
get duration(): number;
|
|
4183
|
+
evaluate(time: number, target: RGBAColor): RGBAColor;
|
|
4184
|
+
}
|
|
4185
|
+
export enum ParticleSystemCurveMode {
|
|
4186
|
+
Constant = 0,
|
|
4187
|
+
Curve = 1,
|
|
4188
|
+
TwoCurves = 2,
|
|
4189
|
+
TwoConstants = 3
|
|
4190
|
+
}
|
|
4191
|
+
export enum ParticleSystemGradientMode {
|
|
4192
|
+
Color = 0,
|
|
4193
|
+
Gradient = 1,
|
|
4194
|
+
TwoColors = 2,
|
|
4195
|
+
TwoGradients = 3,
|
|
4196
|
+
RandomColor = 4
|
|
4197
|
+
}
|
|
4198
|
+
export enum ParticleSystemSimulationSpace {
|
|
4199
|
+
Local = 0,
|
|
4200
|
+
World = 1,
|
|
4201
|
+
Custom = 2
|
|
4202
|
+
}
|
|
4203
|
+
export enum ParticleSystemShapeType {
|
|
4204
|
+
Sphere = 0,
|
|
4205
|
+
SphereShell = 1,
|
|
4206
|
+
Hemisphere = 2,
|
|
4207
|
+
HemisphereShell = 3,
|
|
4208
|
+
Cone = 4,
|
|
4209
|
+
Box = 5,
|
|
4210
|
+
Mesh = 6,
|
|
4211
|
+
ConeShell = 7,
|
|
4212
|
+
ConeVolume = 8,
|
|
4213
|
+
ConeVolumeShell = 9,
|
|
4214
|
+
Circle = 10,
|
|
4215
|
+
CircleEdge = 11,
|
|
4216
|
+
SingleSidedEdge = 12,
|
|
4217
|
+
MeshRenderer = 13,
|
|
4218
|
+
SkinnedMeshRenderer = 14,
|
|
4219
|
+
BoxShell = 15,
|
|
4220
|
+
BoxEdge = 16,
|
|
4221
|
+
Donut = 17,
|
|
4222
|
+
Rectangle = 18,
|
|
4223
|
+
Sprite = 19,
|
|
4224
|
+
SpriteRenderer = 20
|
|
4225
|
+
}
|
|
4226
|
+
export class MinMaxCurve {
|
|
4227
|
+
mode: ParticleSystemCurveMode;
|
|
4228
|
+
constant: number;
|
|
4229
|
+
constantMin: number;
|
|
4230
|
+
constantMax: number;
|
|
4231
|
+
curve?: AnimationCurve;
|
|
4232
|
+
curveMin?: AnimationCurve;
|
|
4233
|
+
curveMax?: AnimationCurve;
|
|
4234
|
+
curveMultiplier?: number;
|
|
4235
|
+
evaluate(t01: number, lerpFactor?: number): number;
|
|
4236
|
+
}
|
|
4237
|
+
export class MinMaxGradient {
|
|
4238
|
+
mode: ParticleSystemGradientMode;
|
|
4239
|
+
color: RGBAColor;
|
|
4240
|
+
colorMin: RGBAColor;
|
|
4241
|
+
colorMax: RGBAColor;
|
|
4242
|
+
gradient: Gradient;
|
|
4243
|
+
gradientMin: Gradient;
|
|
4244
|
+
gradientMax: Gradient;
|
|
4245
|
+
private _temp;
|
|
4246
|
+
evaluate(t01: number, lerpFactor?: number): RGBAColor;
|
|
4247
|
+
}
|
|
4248
|
+
type ParticleSystemScalingMode = {
|
|
4249
|
+
Hierarchy: number;
|
|
4250
|
+
Local: number;
|
|
4251
|
+
Shape: number;
|
|
4252
|
+
};
|
|
4072
4253
|
export class MainModule {
|
|
4073
|
-
|
|
4254
|
+
cullingMode: number;
|
|
4074
4255
|
duration: number;
|
|
4256
|
+
emitterVelocityMode: number;
|
|
4257
|
+
flipRotation: number;
|
|
4258
|
+
gravityModifier: MinMaxCurve;
|
|
4259
|
+
gravityModifierMultiplier: number;
|
|
4075
4260
|
loop: boolean;
|
|
4261
|
+
maxParticles: number;
|
|
4262
|
+
playOnAwake: boolean;
|
|
4076
4263
|
prewarm: boolean;
|
|
4077
|
-
|
|
4264
|
+
ringBufferLoopRange: {
|
|
4265
|
+
x: number;
|
|
4266
|
+
y: number;
|
|
4267
|
+
};
|
|
4268
|
+
ringBufferMode: boolean;
|
|
4269
|
+
scalingMode: ParticleSystemScalingMode;
|
|
4270
|
+
simulationSpace: ParticleSystemSimulationSpace;
|
|
4271
|
+
simulationSpeed: number;
|
|
4272
|
+
startColor: MinMaxGradient;
|
|
4273
|
+
startDelay: MinMaxCurve;
|
|
4078
4274
|
startDelayMultiplier: number;
|
|
4079
|
-
startLifetime:
|
|
4275
|
+
startLifetime: MinMaxCurve;
|
|
4080
4276
|
startLifetimeMultiplier: number;
|
|
4081
|
-
|
|
4082
|
-
|
|
4277
|
+
startRotation: MinMaxCurve;
|
|
4278
|
+
startRotationMultiplier: number;
|
|
4279
|
+
startRotation3D: boolean;
|
|
4280
|
+
startRotationX: MinMaxCurve;
|
|
4281
|
+
startRotationXMultiplier: number;
|
|
4282
|
+
startRotationY: MinMaxCurve;
|
|
4283
|
+
startRotationYMultiplier: number;
|
|
4284
|
+
startRotationZ: MinMaxCurve;
|
|
4285
|
+
startRotationZMultiplier: number;
|
|
4286
|
+
startSize: MinMaxCurve;
|
|
4083
4287
|
startSize3D: boolean;
|
|
4084
|
-
startSize: undefined;
|
|
4085
4288
|
startSizeMultiplier: number;
|
|
4086
|
-
startSizeX:
|
|
4289
|
+
startSizeX: MinMaxCurve;
|
|
4087
4290
|
startSizeXMultiplier: number;
|
|
4088
|
-
startSizeY:
|
|
4291
|
+
startSizeY: MinMaxCurve;
|
|
4089
4292
|
startSizeYMultiplier: number;
|
|
4090
|
-
startSizeZ:
|
|
4293
|
+
startSizeZ: MinMaxCurve;
|
|
4091
4294
|
startSizeZMultiplier: number;
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
startRotationMultiplier: number;
|
|
4095
|
-
startRotationX: undefined;
|
|
4096
|
-
startRotationXMultiplier: number;
|
|
4097
|
-
startRotationY: undefined;
|
|
4098
|
-
startRotationYMultiplier: number;
|
|
4099
|
-
startRotationZ: undefined;
|
|
4100
|
-
startRotationZMultiplier: number;
|
|
4101
|
-
flipRotation: number;
|
|
4102
|
-
startColor: THREE.Color;
|
|
4103
|
-
startColor1: THREE.Color | undefined;
|
|
4104
|
-
gravityModifier: undefined;
|
|
4105
|
-
gravityModifierMultiplier: number;
|
|
4106
|
-
simulationSpace: number;
|
|
4107
|
-
customSimulationSpace: null;
|
|
4108
|
-
simulationSpeed: number;
|
|
4109
|
-
useUnscaledTime: boolean;
|
|
4110
|
-
scalingMode: number;
|
|
4111
|
-
playOnAwake: boolean;
|
|
4112
|
-
maxParticles: number;
|
|
4113
|
-
emitterVelocityMode: number;
|
|
4295
|
+
startSpeed: MinMaxCurve;
|
|
4296
|
+
startSpeedMultiplier: number;
|
|
4114
4297
|
stopAction: number;
|
|
4115
|
-
|
|
4116
|
-
ringBufferLoopRange: THREE.Vector2;
|
|
4117
|
-
cullingMode: number;
|
|
4298
|
+
useUnscaledTime: boolean;
|
|
4118
4299
|
}
|
|
4119
4300
|
export class EmissionModule {
|
|
4120
4301
|
burstCount: number;
|
|
4121
4302
|
enabled: boolean;
|
|
4122
|
-
|
|
4123
|
-
rateMutliplier: number;
|
|
4124
|
-
rateOverDistance: number;
|
|
4125
|
-
rateOverDistanceMultiplier: number;
|
|
4126
|
-
rateOverTime: number;
|
|
4303
|
+
rateOverTime: MinMaxCurve;
|
|
4127
4304
|
rateOverTimeMultiplier: number;
|
|
4305
|
+
rateOverDistance: MinMaxCurve;
|
|
4306
|
+
rateOverDistanceMultiplier: number;
|
|
4307
|
+
currentParticles: number;
|
|
4308
|
+
maxParticles: number;
|
|
4309
|
+
private _time;
|
|
4310
|
+
private _summed;
|
|
4311
|
+
/** called by nebula */
|
|
4312
|
+
init(): void;
|
|
4313
|
+
/** called by nebula */
|
|
4314
|
+
getValue(deltaTime: number): number;
|
|
4315
|
+
}
|
|
4316
|
+
export class ColorOverLifetimeModule {
|
|
4317
|
+
enabled: boolean;
|
|
4318
|
+
color: MinMaxGradient;
|
|
4319
|
+
}
|
|
4320
|
+
export class SizeOverLifetimeModule {
|
|
4321
|
+
enabled: boolean;
|
|
4322
|
+
separateAxes: boolean;
|
|
4323
|
+
size: MinMaxCurve;
|
|
4324
|
+
sizeMultiplier: number;
|
|
4325
|
+
sizeX: MinMaxCurve;
|
|
4326
|
+
sizeXMultiplier: number;
|
|
4327
|
+
sizeY: MinMaxCurve;
|
|
4328
|
+
sizeYMultiplier: number;
|
|
4329
|
+
sizeZ: MinMaxCurve;
|
|
4330
|
+
sizeZMultiplier: number;
|
|
4331
|
+
private _time;
|
|
4332
|
+
evaluate(t01: number, target: Vec3): Vec3;
|
|
4128
4333
|
}
|
|
4129
4334
|
export class ShapeModule {
|
|
4130
4335
|
shapeType: ParticleSystemShapeType;
|
|
@@ -4133,68 +4338,85 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4133
4338
|
angle: number;
|
|
4134
4339
|
arc: number;
|
|
4135
4340
|
arcmode: number;
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
scale: THREE.Vector3;
|
|
4341
|
+
boxThickness: Vector3;
|
|
4342
|
+
position: Vector3;
|
|
4343
|
+
rotation: Vector3;
|
|
4344
|
+
scale: Vector3;
|
|
4141
4345
|
radius: number;
|
|
4346
|
+
radiusThickness: number;
|
|
4142
4347
|
sphericalDirectionAmount: number;
|
|
4348
|
+
private _space?;
|
|
4349
|
+
private readonly _worldSpacePosition;
|
|
4350
|
+
update(_context: Context, simulationSpace: ParticleSystemSimulationSpace, obj: Object3D): void;
|
|
4351
|
+
/** nebula implementations: */
|
|
4352
|
+
/** initializer implementation */
|
|
4353
|
+
private _vector;
|
|
4354
|
+
private _temp;
|
|
4355
|
+
/** called by nebula on initialize */
|
|
4356
|
+
get vector(): THREE.Vector3;
|
|
4357
|
+
/** called by nebula */
|
|
4358
|
+
getPosition(): void;
|
|
4359
|
+
private _dir;
|
|
4360
|
+
getDirection(position: any): Vec3;
|
|
4143
4361
|
}
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4362
|
+
import { Context } from "engine/engine_setup";
|
|
4363
|
+
export class NoiseModule {
|
|
4364
|
+
damping: boolean;
|
|
4365
|
+
enabled: boolean;
|
|
4366
|
+
frequency: number;
|
|
4367
|
+
octaveCount: number;
|
|
4368
|
+
octaveMultiplier: number;
|
|
4369
|
+
octaveScale: number;
|
|
4370
|
+
positionAmount: MinMaxCurve;
|
|
4371
|
+
quality: number;
|
|
4372
|
+
remap: MinMaxCurve;
|
|
4373
|
+
remapEnabled: boolean;
|
|
4374
|
+
remapMultiplier: number;
|
|
4375
|
+
remapX: MinMaxCurve;
|
|
4376
|
+
remapXMultiplier: number;
|
|
4377
|
+
remapY: MinMaxCurve;
|
|
4378
|
+
remapYMultiplier: number;
|
|
4379
|
+
remapZ: MinMaxCurve;
|
|
4380
|
+
remapZMultiplier: number;
|
|
4381
|
+
scrollSpeedMultiplier: number;
|
|
4382
|
+
separateAxes: boolean;
|
|
4383
|
+
strengthMultiplier: number;
|
|
4384
|
+
strengthX: MinMaxCurve;
|
|
4385
|
+
strengthXMultiplier: number;
|
|
4386
|
+
strengthY: MinMaxCurve;
|
|
4387
|
+
strengthYMultiplier: number;
|
|
4388
|
+
strengthZ: MinMaxCurve;
|
|
4389
|
+
strengthZMultiplier: number;
|
|
4390
|
+
private _noise?;
|
|
4391
|
+
private _time;
|
|
4392
|
+
update(context: Context): void;
|
|
4393
|
+
/** nebula implementations: */
|
|
4394
|
+
private _temp;
|
|
4395
|
+
applyNoise(index: number, pos: Vec3, vel: Vec3, deltaTime: number, age: number, life: number): void;
|
|
4163
4396
|
}
|
|
4164
4397
|
}
|
|
4165
4398
|
declare module "engine-components/ParticleSystem" {
|
|
4166
4399
|
import { Behaviour } from "engine-components/Component";
|
|
4167
|
-
import
|
|
4168
|
-
import
|
|
4400
|
+
import { MainModule, EmissionModule, ShapeModule, ColorOverLifetimeModule, SizeOverLifetimeModule, NoiseModule } from "engine-components/ParticleSystemModules";
|
|
4401
|
+
import { SpriteMaterial } from "three";
|
|
4169
4402
|
export class ParticleSystemRenderer extends Behaviour {
|
|
4170
|
-
|
|
4171
|
-
getMesh(_index: number): THREE.Mesh | null;
|
|
4172
|
-
private sharedMaterial?;
|
|
4173
|
-
private mesh?;
|
|
4174
|
-
awake(): void;
|
|
4403
|
+
particleMaterial?: SpriteMaterial;
|
|
4175
4404
|
}
|
|
4176
4405
|
export class ParticleSystem extends Behaviour {
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
private
|
|
4185
|
-
private
|
|
4186
|
-
private
|
|
4187
|
-
private activeCount;
|
|
4188
|
-
private shapeRotation;
|
|
4189
|
-
private tempVec3;
|
|
4190
|
-
private tempQuat;
|
|
4406
|
+
colorOverLifetime: ColorOverLifetimeModule;
|
|
4407
|
+
main: MainModule;
|
|
4408
|
+
emission: EmissionModule;
|
|
4409
|
+
sizeOverLifetime: SizeOverLifetimeModule;
|
|
4410
|
+
shape: ShapeModule;
|
|
4411
|
+
noise: NoiseModule;
|
|
4412
|
+
renderer: ParticleSystemRenderer;
|
|
4413
|
+
private _system;
|
|
4414
|
+
private _emitter;
|
|
4415
|
+
private _size;
|
|
4191
4416
|
awake(): void;
|
|
4192
4417
|
onEnable(): void;
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
private updateOverLifetime;
|
|
4196
|
-
private assignPosition;
|
|
4197
|
-
private assignVelocity;
|
|
4418
|
+
onDisable(): void;
|
|
4419
|
+
onBeforeRender(): void;
|
|
4198
4420
|
}
|
|
4199
4421
|
}
|
|
4200
4422
|
declare module "engine/engine_coroutine" {
|
|
@@ -5463,6 +5685,7 @@ declare module "engine-components/codegen/components" {
|
|
|
5463
5685
|
export { Interactable } from "engine-components/Interactable";
|
|
5464
5686
|
export { UsageMarker } from "engine-components/Interactable";
|
|
5465
5687
|
export { FixedJoint } from "engine-components/Joints";
|
|
5688
|
+
export { HingeJoint } from "engine-components/Joints";
|
|
5466
5689
|
export { Light } from "engine-components/Light";
|
|
5467
5690
|
export { LODModel } from "engine-components/LODGroup";
|
|
5468
5691
|
export { LODGroup } from "engine-components/LODGroup";
|
|
@@ -5473,9 +5696,15 @@ declare module "engine-components/codegen/components" {
|
|
|
5473
5696
|
export { OrbitControls } from "engine-components/OrbitControls";
|
|
5474
5697
|
export { ParticleSystemRenderer } from "engine-components/ParticleSystem";
|
|
5475
5698
|
export { ParticleSystem } from "engine-components/ParticleSystem";
|
|
5699
|
+
export { Gradient } from "engine-components/ParticleSystemModules";
|
|
5700
|
+
export { MinMaxCurve } from "engine-components/ParticleSystemModules";
|
|
5701
|
+
export { MinMaxGradient } from "engine-components/ParticleSystemModules";
|
|
5476
5702
|
export { MainModule } from "engine-components/ParticleSystemModules";
|
|
5477
5703
|
export { EmissionModule } from "engine-components/ParticleSystemModules";
|
|
5704
|
+
export { ColorOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
5705
|
+
export { SizeOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
5478
5706
|
export { ShapeModule } from "engine-components/ParticleSystemModules";
|
|
5707
|
+
export { NoiseModule } from "engine-components/ParticleSystemModules";
|
|
5479
5708
|
export { PlayerColor } from "engine-components/PlayerColor";
|
|
5480
5709
|
export { ReflectionProbe } from "engine-components/ReflectionProbe";
|
|
5481
5710
|
export { FieldWithDefault } from "engine-components/Renderer";
|