@needle-tools/engine 2.40.0-pre → 2.42.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 +18 -0
- package/dist/needle-engine.d.ts +332 -126
- package/dist/needle-engine.js +401 -401
- package/dist/needle-engine.js.map +4 -4
- package/dist/needle-engine.min.js +53 -53
- package/dist/needle-engine.min.js.map +4 -4
- package/lib/engine/engine_element.js +1 -1
- package/lib/engine/engine_element.js.map +1 -1
- package/lib/engine/engine_element_loading.js +6 -1
- package/lib/engine/engine_element_loading.js.map +1 -1
- package/lib/engine/engine_gizmos.d.ts +8 -21
- package/lib/engine/engine_gizmos.js +51 -5
- package/lib/engine/engine_gizmos.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_physics.js +14 -6
- 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_setup.d.ts +3 -0
- package/lib/engine/engine_setup.js +15 -0
- package/lib/engine/engine_setup.js.map +1 -1
- package/lib/engine/engine_three_utils.d.ts +16 -1
- package/lib/engine/engine_three_utils.js +94 -54
- package/lib/engine/engine_three_utils.js.map +1 -1
- package/lib/engine/engine_types.d.ts +6 -0
- package/lib/engine/engine_types.js.map +1 -1
- package/lib/engine/engine_utils.d.ts +1 -0
- package/lib/engine/engine_utils.js +3 -0
- package/lib/engine/engine_utils.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/BoxHelperComponent.js +9 -10
- package/lib/engine-components/BoxHelperComponent.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 +29 -26
- package/lib/engine-components/ParticleSystem.js +349 -187
- package/lib/engine-components/ParticleSystem.js.map +1 -1
- package/lib/engine-components/ParticleSystemModules.d.ts +243 -64
- package/lib/engine-components/ParticleSystemModules.js +722 -153
- package/lib/engine-components/ParticleSystemModules.js.map +1 -1
- package/lib/engine-components/ReflectionProbe.js +29 -11
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/lib/engine-components/Renderer.d.ts +1 -0
- package/lib/engine-components/Renderer.js +4 -2
- package/lib/engine-components/Renderer.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 +4 -2
- package/src/engine/codegen/register_types.js +28 -0
- package/src/engine/dist/engine_three_utils.js +279 -0
- package/src/engine/engine_element.ts +1 -1
- package/src/engine/engine_element_loading.ts +5 -1
- package/src/engine/engine_gizmos.ts +58 -6
- package/src/engine/engine_math.ts +19 -6
- package/src/engine/engine_physics.ts +17 -7
- package/src/engine/engine_serialization_core.ts +1 -0
- package/src/engine/engine_setup.ts +25 -2
- package/src/engine/engine_three_utils.ts +103 -62
- package/src/engine/engine_types.ts +8 -1
- package/src/engine/engine_utils.ts +5 -0
- package/src/engine-components/AnimationCurve.ts +25 -11
- package/src/engine-components/BoxHelperComponent.ts +12 -15
- package/src/engine-components/Light.ts +39 -8
- package/src/engine-components/ParticleSystem.ts +395 -199
- package/src/engine-components/ParticleSystemModules.ts +638 -152
- package/src/engine-components/ReflectionProbe.ts +37 -13
- package/src/engine-components/Renderer.ts +4 -2
- 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/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@ 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.42.0-pre] - 2022-11-09
|
|
8
|
+
- add ``Graphics.copyTexture``
|
|
9
|
+
- add ``Renderer.allowProgressiveLoad``
|
|
10
|
+
- add ``Gizmos.DrawBox`` and ``DrawBox3``
|
|
11
|
+
- add particles burst emission
|
|
12
|
+
- add particles color interpolation between two gradients
|
|
13
|
+
- fix: reflection probe material caching for when material is being changed at certain times outside of animation loop and cache applied wrong material
|
|
14
|
+
- fix: AnimationCurve evaluation when time and keyframe are both exactly 0
|
|
15
|
+
- change: reflection probe now requires anchor override
|
|
16
|
+
- change: bump threejs dependency
|
|
17
|
+
|
|
18
|
+
## [2.41.0-pre] - 2022-11-07
|
|
19
|
+
- Add: start adding particle systems support again
|
|
20
|
+
- Change: update dependency version to needle gltf-transform-extensions package
|
|
21
|
+
- Change: light set to soft shadows now changes renderer shadow mode to ``VSMShadowMap`` (can be disabled by setting ``Light.allowChangingShadowMapType`` to false)
|
|
22
|
+
- Fix: WebXR creating AR button when called from script in awake
|
|
23
|
+
- Fix: ``AnimationCurve.evaluate``
|
|
24
|
+
|
|
7
25
|
## [2.40.0-pre] - 2022-11-05
|
|
8
26
|
- Add support for deleting all room state by calling ``context.connection.sendDeleteRemoteStateAll()`` (requires backend to update ``@needle-tools/needle-tiny-networking-ws`` to ``^1.1.0-pre``)
|
|
9
27
|
- Add Hinge joint
|
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 };
|
|
@@ -50,7 +53,7 @@ declare module "engine/engine_physics.types" {
|
|
|
50
53
|
}
|
|
51
54
|
declare module "engine/engine_three_utils" {
|
|
52
55
|
import * as THREE from "three";
|
|
53
|
-
import { Vector3 } from "three";
|
|
56
|
+
import { Vector3, Texture, ShaderMaterial } from "three";
|
|
54
57
|
export function lookAtInverse(obj: THREE.Object3D, target: Vector3): void;
|
|
55
58
|
export function getWorldPosition(obj: THREE.Object3D, vec?: THREE.Vector3 | null, updateParents?: boolean): THREE.Vector3;
|
|
56
59
|
export function setWorldPosition(obj: THREE.Object3D, val: THREE.Vector3): void;
|
|
@@ -67,7 +70,22 @@ declare module "engine/engine_three_utils" {
|
|
|
67
70
|
export function setWorldRotation(obj: THREE.Object3D, val: THREE.Vector3): void;
|
|
68
71
|
export function setWorldRotationXYZ(obj: THREE.Object3D, x: number, y: number, z: number, degrees?: boolean): void;
|
|
69
72
|
export function logHierarchy(root: THREE.Object3D | null | undefined, collapsible?: boolean): void;
|
|
73
|
+
export class Graphics {
|
|
74
|
+
private static planeGeometry;
|
|
75
|
+
private static renderer;
|
|
76
|
+
private static perspectiveCam;
|
|
77
|
+
private static scene;
|
|
78
|
+
private static readonly vertex;
|
|
79
|
+
private static readonly fragment;
|
|
80
|
+
private static readonly blipMaterial;
|
|
81
|
+
static createBlitMaterial(fragment: string): ShaderMaterial;
|
|
82
|
+
private static readonly mesh;
|
|
83
|
+
static copyTexture(texture: Texture, blitMaterial?: ShaderMaterial): THREE.Texture;
|
|
84
|
+
static textureToCanvas(texture: Texture, force: boolean): HTMLCanvasElement | null;
|
|
85
|
+
}
|
|
86
|
+
/**@obsolete use Graphics.copyTexture */
|
|
70
87
|
export function copyTexture(texture: THREE.Texture): THREE.Texture;
|
|
88
|
+
/**@obsolete use Graphics.textureToCanvas */
|
|
71
89
|
export function textureToCanvas(texture: THREE.Texture, force?: boolean): HTMLCanvasElement | null;
|
|
72
90
|
}
|
|
73
91
|
declare module "engine/engine_types" {
|
|
@@ -191,6 +209,12 @@ declare module "engine/engine_types" {
|
|
|
191
209
|
y: number;
|
|
192
210
|
z: number;
|
|
193
211
|
};
|
|
212
|
+
export type Vec4 = {
|
|
213
|
+
x: number;
|
|
214
|
+
y: number;
|
|
215
|
+
z: number;
|
|
216
|
+
w: number;
|
|
217
|
+
};
|
|
194
218
|
export class ContactPoint {
|
|
195
219
|
private readonly _point;
|
|
196
220
|
private readonly _normal;
|
|
@@ -261,6 +285,7 @@ declare module "engine/engine_utils" {
|
|
|
261
285
|
revoke(): void;
|
|
262
286
|
dispose(): void;
|
|
263
287
|
}
|
|
288
|
+
export function isMobileDevice(): boolean;
|
|
264
289
|
}
|
|
265
290
|
declare module "engine/extensions/extension_resolver" {
|
|
266
291
|
import { GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
@@ -762,6 +787,21 @@ declare module "engine/engine_gameobject" {
|
|
|
762
787
|
export function foreachComponent(instance: THREE.Object3D, cb: (comp: Component) => any, recursive?: boolean): any;
|
|
763
788
|
export function instantiate(instance: GameObject | Object3D | null, opts?: InstantiateOptions | null): GameObject | null;
|
|
764
789
|
}
|
|
790
|
+
declare module "engine/engine_gizmos" {
|
|
791
|
+
import * as THREE from 'three';
|
|
792
|
+
import { ColorRepresentation, Box3 } from 'three';
|
|
793
|
+
import { Vec3, Vec4 } from "engine/engine_types";
|
|
794
|
+
export class Gizmos {
|
|
795
|
+
static DrawRay(origin: Vec3, dir: Vec3, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
796
|
+
static DrawDirection(pt: Vec3, direction: Vec3 | Vec4, color?: ColorRepresentation, duration?: number, depthTest?: boolean, lengthFactor?: number): void;
|
|
797
|
+
static DrawLine(pt0: Vec3, pt1: Vec3, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
798
|
+
static DrawWireSphere(center: Vec3, radius: number, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
799
|
+
static DrawSphere(center: Vec3, radius: number, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
800
|
+
static DrawBox(center: Vec3, size: Vec3, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
801
|
+
static DrawBox3(box: Box3, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
802
|
+
}
|
|
803
|
+
export function CreateWireCube(col?: THREE.ColorRepresentation | null): THREE.LineSegments;
|
|
804
|
+
}
|
|
765
805
|
declare module "engine/engine_physics" {
|
|
766
806
|
import { Camera, Intersection, Layers, Mesh, Object3D, Ray, Raycaster, Vector2, Vector3 } from 'three';
|
|
767
807
|
import { Context } from "engine/engine_setup";
|
|
@@ -1791,6 +1831,9 @@ declare module "engine/engine_setup" {
|
|
|
1791
1831
|
get isInAR(): boolean;
|
|
1792
1832
|
get xrSession(): THREE.XRSession | null;
|
|
1793
1833
|
get arOverlayElement(): HTMLElement;
|
|
1834
|
+
/** Current event of the update cycle */
|
|
1835
|
+
get currentFrameEvent(): FrameEvent;
|
|
1836
|
+
private _currentFrameEvent;
|
|
1794
1837
|
scene: THREE.Scene;
|
|
1795
1838
|
renderer: THREE.WebGLRenderer;
|
|
1796
1839
|
composer: EffectComposer | null;
|
|
@@ -2434,34 +2477,6 @@ declare module "engine/engine_util_decorator" {
|
|
|
2434
2477
|
/** create accessor callbacks for a field */
|
|
2435
2478
|
export const validate: (set?: setter, get?: getter) => (target: IComponent | any, propertyKey: string, descriptor?: undefined) => void;
|
|
2436
2479
|
}
|
|
2437
|
-
declare module "engine/engine_gizmos" {
|
|
2438
|
-
import * as THREE from 'three';
|
|
2439
|
-
import { ColorRepresentation } from 'three';
|
|
2440
|
-
import { Vec3 } from "engine/engine_types";
|
|
2441
|
-
export class Gizmos {
|
|
2442
|
-
static DrawRay(origin: Vec3, dir: Vec3, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
2443
|
-
static DrawLine(pt0: {
|
|
2444
|
-
x: number;
|
|
2445
|
-
y: number;
|
|
2446
|
-
z: number;
|
|
2447
|
-
}, pt1: {
|
|
2448
|
-
x: number;
|
|
2449
|
-
y: number;
|
|
2450
|
-
z: number;
|
|
2451
|
-
}, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
2452
|
-
static DrawWireSphere(center: {
|
|
2453
|
-
x: number;
|
|
2454
|
-
y: number;
|
|
2455
|
-
z: number;
|
|
2456
|
-
}, radius: number, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
2457
|
-
static DrawSphere(center: {
|
|
2458
|
-
x: number;
|
|
2459
|
-
y: number;
|
|
2460
|
-
z: number;
|
|
2461
|
-
}, radius: number, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
2462
|
-
}
|
|
2463
|
-
export function CreateWireCube(col?: THREE.ColorRepresentation | null): THREE.LineSegments;
|
|
2464
|
-
}
|
|
2465
2480
|
declare module "engine/api" {
|
|
2466
2481
|
export { InstancingUtil } from "engine/engine_instancing";
|
|
2467
2482
|
export * from "engine/engine_gameobject";
|
|
@@ -3466,6 +3481,7 @@ declare module "engine-components/Renderer" {
|
|
|
3466
3481
|
get lightmap(): Texture | null;
|
|
3467
3482
|
set lightmap(tex: Texture | null | undefined);
|
|
3468
3483
|
get hasLightmap(): boolean;
|
|
3484
|
+
allowProgressiveLoading: boolean;
|
|
3469
3485
|
awake(): void;
|
|
3470
3486
|
private _isInstancingEnabled;
|
|
3471
3487
|
private handles;
|
|
@@ -4088,6 +4104,8 @@ declare module "engine-components/Light" {
|
|
|
4088
4104
|
private onWebXREnded;
|
|
4089
4105
|
createLight(): void;
|
|
4090
4106
|
updateMainLightRoutine(): Generator<undefined, void, unknown>;
|
|
4107
|
+
static allowChangingRendererShadowMapType: boolean;
|
|
4108
|
+
private updateShadowSoftHard;
|
|
4091
4109
|
private setDirectionalLight;
|
|
4092
4110
|
}
|
|
4093
4111
|
}
|
|
@@ -4151,62 +4169,212 @@ declare module "engine-components/OffsetConstraint" {
|
|
|
4151
4169
|
}
|
|
4152
4170
|
declare module "engine-components/ParticleSystemModules" {
|
|
4153
4171
|
import * as THREE from "three";
|
|
4172
|
+
import { Object3D, Vector3 } from "three";
|
|
4173
|
+
import { RGBAColor } from "engine-components/js-extensions/RGBAColor";
|
|
4174
|
+
import { AnimationCurve } from "engine-components/AnimationCurve";
|
|
4175
|
+
import { Vec3 } from "engine/engine_types";
|
|
4176
|
+
type Color4 = {
|
|
4177
|
+
r: number;
|
|
4178
|
+
g: number;
|
|
4179
|
+
b: number;
|
|
4180
|
+
a: number;
|
|
4181
|
+
};
|
|
4182
|
+
type ColorKey = {
|
|
4183
|
+
time: number;
|
|
4184
|
+
color: Color4;
|
|
4185
|
+
};
|
|
4186
|
+
type AlphaKey = {
|
|
4187
|
+
time: number;
|
|
4188
|
+
alpha: number;
|
|
4189
|
+
};
|
|
4190
|
+
export interface IParticleSystem {
|
|
4191
|
+
get currentParticles(): number;
|
|
4192
|
+
get maxParticles(): number;
|
|
4193
|
+
get time(): number;
|
|
4194
|
+
get duration(): number;
|
|
4195
|
+
readonly main: MainModule;
|
|
4196
|
+
}
|
|
4197
|
+
export enum ParticleSystemRenderMode {
|
|
4198
|
+
Billboard = 0,
|
|
4199
|
+
Mesh = 4
|
|
4200
|
+
}
|
|
4201
|
+
export class Gradient {
|
|
4202
|
+
alphaKeys: Array<AlphaKey>;
|
|
4203
|
+
colorKeys: Array<ColorKey>;
|
|
4204
|
+
get duration(): number;
|
|
4205
|
+
evaluate(time: number, target: RGBAColor): RGBAColor;
|
|
4206
|
+
}
|
|
4207
|
+
export enum ParticleSystemCurveMode {
|
|
4208
|
+
Constant = 0,
|
|
4209
|
+
Curve = 1,
|
|
4210
|
+
TwoCurves = 2,
|
|
4211
|
+
TwoConstants = 3
|
|
4212
|
+
}
|
|
4213
|
+
export enum ParticleSystemGradientMode {
|
|
4214
|
+
Color = 0,
|
|
4215
|
+
Gradient = 1,
|
|
4216
|
+
TwoColors = 2,
|
|
4217
|
+
TwoGradients = 3,
|
|
4218
|
+
RandomColor = 4
|
|
4219
|
+
}
|
|
4220
|
+
export enum ParticleSystemSimulationSpace {
|
|
4221
|
+
Local = 0,
|
|
4222
|
+
World = 1,
|
|
4223
|
+
Custom = 2
|
|
4224
|
+
}
|
|
4225
|
+
export enum ParticleSystemShapeType {
|
|
4226
|
+
Sphere = 0,
|
|
4227
|
+
SphereShell = 1,
|
|
4228
|
+
Hemisphere = 2,
|
|
4229
|
+
HemisphereShell = 3,
|
|
4230
|
+
Cone = 4,
|
|
4231
|
+
Box = 5,
|
|
4232
|
+
Mesh = 6,
|
|
4233
|
+
ConeShell = 7,
|
|
4234
|
+
ConeVolume = 8,
|
|
4235
|
+
ConeVolumeShell = 9,
|
|
4236
|
+
Circle = 10,
|
|
4237
|
+
CircleEdge = 11,
|
|
4238
|
+
SingleSidedEdge = 12,
|
|
4239
|
+
MeshRenderer = 13,
|
|
4240
|
+
SkinnedMeshRenderer = 14,
|
|
4241
|
+
BoxShell = 15,
|
|
4242
|
+
BoxEdge = 16,
|
|
4243
|
+
Donut = 17,
|
|
4244
|
+
Rectangle = 18,
|
|
4245
|
+
Sprite = 19,
|
|
4246
|
+
SpriteRenderer = 20
|
|
4247
|
+
}
|
|
4248
|
+
export class MinMaxCurve {
|
|
4249
|
+
mode: ParticleSystemCurveMode;
|
|
4250
|
+
constant: number;
|
|
4251
|
+
constantMin: number;
|
|
4252
|
+
constantMax: number;
|
|
4253
|
+
curve?: AnimationCurve;
|
|
4254
|
+
curveMin?: AnimationCurve;
|
|
4255
|
+
curveMax?: AnimationCurve;
|
|
4256
|
+
curveMultiplier?: number;
|
|
4257
|
+
evaluate(t01: number, lerpFactor?: number): number;
|
|
4258
|
+
}
|
|
4259
|
+
export class MinMaxGradient {
|
|
4260
|
+
mode: ParticleSystemGradientMode;
|
|
4261
|
+
color: RGBAColor;
|
|
4262
|
+
colorMin: RGBAColor;
|
|
4263
|
+
colorMax: RGBAColor;
|
|
4264
|
+
gradient: Gradient;
|
|
4265
|
+
gradientMin: Gradient;
|
|
4266
|
+
gradientMax: Gradient;
|
|
4267
|
+
private static _temp;
|
|
4268
|
+
private static _temp2;
|
|
4269
|
+
evaluate(t01: number, lerpFactor?: number): RGBAColor;
|
|
4270
|
+
}
|
|
4271
|
+
type ParticleSystemScalingMode = {
|
|
4272
|
+
Hierarchy: number;
|
|
4273
|
+
Local: number;
|
|
4274
|
+
Shape: number;
|
|
4275
|
+
};
|
|
4154
4276
|
export class MainModule {
|
|
4155
|
-
|
|
4277
|
+
cullingMode: number;
|
|
4156
4278
|
duration: number;
|
|
4279
|
+
emitterVelocityMode: number;
|
|
4280
|
+
flipRotation: number;
|
|
4281
|
+
gravityModifier: MinMaxCurve;
|
|
4282
|
+
gravityModifierMultiplier: number;
|
|
4157
4283
|
loop: boolean;
|
|
4284
|
+
maxParticles: number;
|
|
4285
|
+
playOnAwake: boolean;
|
|
4158
4286
|
prewarm: boolean;
|
|
4159
|
-
|
|
4287
|
+
ringBufferLoopRange: {
|
|
4288
|
+
x: number;
|
|
4289
|
+
y: number;
|
|
4290
|
+
};
|
|
4291
|
+
ringBufferMode: boolean;
|
|
4292
|
+
scalingMode: ParticleSystemScalingMode;
|
|
4293
|
+
simulationSpace: ParticleSystemSimulationSpace;
|
|
4294
|
+
simulationSpeed: number;
|
|
4295
|
+
startColor: MinMaxGradient;
|
|
4296
|
+
startDelay: MinMaxCurve;
|
|
4160
4297
|
startDelayMultiplier: number;
|
|
4161
|
-
startLifetime:
|
|
4298
|
+
startLifetime: MinMaxCurve;
|
|
4162
4299
|
startLifetimeMultiplier: number;
|
|
4163
|
-
|
|
4164
|
-
|
|
4300
|
+
startRotation: MinMaxCurve;
|
|
4301
|
+
startRotationMultiplier: number;
|
|
4302
|
+
startRotation3D: boolean;
|
|
4303
|
+
startRotationX: MinMaxCurve;
|
|
4304
|
+
startRotationXMultiplier: number;
|
|
4305
|
+
startRotationY: MinMaxCurve;
|
|
4306
|
+
startRotationYMultiplier: number;
|
|
4307
|
+
startRotationZ: MinMaxCurve;
|
|
4308
|
+
startRotationZMultiplier: number;
|
|
4309
|
+
startSize: MinMaxCurve;
|
|
4165
4310
|
startSize3D: boolean;
|
|
4166
|
-
startSize: undefined;
|
|
4167
4311
|
startSizeMultiplier: number;
|
|
4168
|
-
startSizeX:
|
|
4312
|
+
startSizeX: MinMaxCurve;
|
|
4169
4313
|
startSizeXMultiplier: number;
|
|
4170
|
-
startSizeY:
|
|
4314
|
+
startSizeY: MinMaxCurve;
|
|
4171
4315
|
startSizeYMultiplier: number;
|
|
4172
|
-
startSizeZ:
|
|
4316
|
+
startSizeZ: MinMaxCurve;
|
|
4173
4317
|
startSizeZMultiplier: number;
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
startRotationMultiplier: number;
|
|
4177
|
-
startRotationX: undefined;
|
|
4178
|
-
startRotationXMultiplier: number;
|
|
4179
|
-
startRotationY: undefined;
|
|
4180
|
-
startRotationYMultiplier: number;
|
|
4181
|
-
startRotationZ: undefined;
|
|
4182
|
-
startRotationZMultiplier: number;
|
|
4183
|
-
flipRotation: number;
|
|
4184
|
-
startColor: THREE.Color;
|
|
4185
|
-
startColor1: THREE.Color | undefined;
|
|
4186
|
-
gravityModifier: undefined;
|
|
4187
|
-
gravityModifierMultiplier: number;
|
|
4188
|
-
simulationSpace: number;
|
|
4189
|
-
customSimulationSpace: null;
|
|
4190
|
-
simulationSpeed: number;
|
|
4191
|
-
useUnscaledTime: boolean;
|
|
4192
|
-
scalingMode: number;
|
|
4193
|
-
playOnAwake: boolean;
|
|
4194
|
-
maxParticles: number;
|
|
4195
|
-
emitterVelocityMode: number;
|
|
4318
|
+
startSpeed: MinMaxCurve;
|
|
4319
|
+
startSpeedMultiplier: number;
|
|
4196
4320
|
stopAction: number;
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4321
|
+
useUnscaledTime: boolean;
|
|
4322
|
+
}
|
|
4323
|
+
export class ParticleBurst {
|
|
4324
|
+
cycleCount: number;
|
|
4325
|
+
maxCount: number;
|
|
4326
|
+
minCount: number;
|
|
4327
|
+
probability: number;
|
|
4328
|
+
repeatInterval: number;
|
|
4329
|
+
time: number;
|
|
4330
|
+
count: {
|
|
4331
|
+
constant: number;
|
|
4332
|
+
constantMax: number;
|
|
4333
|
+
constantMin: number;
|
|
4334
|
+
curve?: AnimationCurve;
|
|
4335
|
+
curveMax?: AnimationCurve;
|
|
4336
|
+
curveMin?: AnimationCurve;
|
|
4337
|
+
curveMultiplier?: number;
|
|
4338
|
+
mode: ParticleSystemCurveMode;
|
|
4339
|
+
};
|
|
4340
|
+
private _performed;
|
|
4341
|
+
reset(): void;
|
|
4342
|
+
run(time: number): number;
|
|
4200
4343
|
}
|
|
4201
4344
|
export class EmissionModule {
|
|
4202
|
-
burstCount: number;
|
|
4203
4345
|
enabled: boolean;
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
rateOverDistanceMultiplier: number;
|
|
4208
|
-
rateOverTime: number;
|
|
4346
|
+
get burstCount(): number;
|
|
4347
|
+
bursts: ParticleBurst[];
|
|
4348
|
+
rateOverTime: MinMaxCurve;
|
|
4209
4349
|
rateOverTimeMultiplier: number;
|
|
4350
|
+
rateOverDistance: MinMaxCurve;
|
|
4351
|
+
rateOverDistanceMultiplier: number;
|
|
4352
|
+
/** set from system */
|
|
4353
|
+
system: IParticleSystem;
|
|
4354
|
+
get time(): number;
|
|
4355
|
+
private _summed;
|
|
4356
|
+
/** called by nebula */
|
|
4357
|
+
init(): void;
|
|
4358
|
+
/** called by nebula */
|
|
4359
|
+
getValue(deltaTime: number): number;
|
|
4360
|
+
}
|
|
4361
|
+
export class ColorOverLifetimeModule {
|
|
4362
|
+
enabled: boolean;
|
|
4363
|
+
color: MinMaxGradient;
|
|
4364
|
+
}
|
|
4365
|
+
export class SizeOverLifetimeModule {
|
|
4366
|
+
enabled: boolean;
|
|
4367
|
+
separateAxes: boolean;
|
|
4368
|
+
size: MinMaxCurve;
|
|
4369
|
+
sizeMultiplier: number;
|
|
4370
|
+
sizeX: MinMaxCurve;
|
|
4371
|
+
sizeXMultiplier: number;
|
|
4372
|
+
sizeY: MinMaxCurve;
|
|
4373
|
+
sizeYMultiplier: number;
|
|
4374
|
+
sizeZ: MinMaxCurve;
|
|
4375
|
+
sizeZMultiplier: number;
|
|
4376
|
+
private _time;
|
|
4377
|
+
evaluate(t01: number, target: Vec3): Vec3;
|
|
4210
4378
|
}
|
|
4211
4379
|
export class ShapeModule {
|
|
4212
4380
|
shapeType: ParticleSystemShapeType;
|
|
@@ -4215,68 +4383,99 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4215
4383
|
angle: number;
|
|
4216
4384
|
arc: number;
|
|
4217
4385
|
arcmode: number;
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
scale: THREE.Vector3;
|
|
4386
|
+
boxThickness: Vector3;
|
|
4387
|
+
position: Vector3;
|
|
4388
|
+
rotation: Vector3;
|
|
4389
|
+
scale: Vector3;
|
|
4223
4390
|
radius: number;
|
|
4391
|
+
radiusThickness: number;
|
|
4224
4392
|
sphericalDirectionAmount: number;
|
|
4393
|
+
private _space?;
|
|
4394
|
+
private readonly _worldSpacePosition;
|
|
4395
|
+
update(_context: Context, simulationSpace: ParticleSystemSimulationSpace, obj: Object3D): void;
|
|
4396
|
+
/** nebula implementations: */
|
|
4397
|
+
/** initializer implementation */
|
|
4398
|
+
private _vector;
|
|
4399
|
+
private _temp;
|
|
4400
|
+
/** called by nebula on initialize */
|
|
4401
|
+
get vector(): THREE.Vector3;
|
|
4402
|
+
/** called by nebula */
|
|
4403
|
+
getPosition(): void;
|
|
4404
|
+
private _dir;
|
|
4405
|
+
getDirection(position: any): Vector3;
|
|
4225
4406
|
}
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4407
|
+
import { Context } from "engine/engine_setup";
|
|
4408
|
+
export class NoiseModule {
|
|
4409
|
+
damping: boolean;
|
|
4410
|
+
enabled: boolean;
|
|
4411
|
+
frequency: number;
|
|
4412
|
+
octaveCount: number;
|
|
4413
|
+
octaveMultiplier: number;
|
|
4414
|
+
octaveScale: number;
|
|
4415
|
+
positionAmount: MinMaxCurve;
|
|
4416
|
+
quality: number;
|
|
4417
|
+
remap: MinMaxCurve;
|
|
4418
|
+
remapEnabled: boolean;
|
|
4419
|
+
remapMultiplier: number;
|
|
4420
|
+
remapX: MinMaxCurve;
|
|
4421
|
+
remapXMultiplier: number;
|
|
4422
|
+
remapY: MinMaxCurve;
|
|
4423
|
+
remapYMultiplier: number;
|
|
4424
|
+
remapZ: MinMaxCurve;
|
|
4425
|
+
remapZMultiplier: number;
|
|
4426
|
+
scrollSpeedMultiplier: number;
|
|
4427
|
+
separateAxes: boolean;
|
|
4428
|
+
strengthMultiplier: number;
|
|
4429
|
+
strengthX: MinMaxCurve;
|
|
4430
|
+
strengthXMultiplier: number;
|
|
4431
|
+
strengthY: MinMaxCurve;
|
|
4432
|
+
strengthYMultiplier: number;
|
|
4433
|
+
strengthZ: MinMaxCurve;
|
|
4434
|
+
strengthZMultiplier: number;
|
|
4435
|
+
private _noise?;
|
|
4436
|
+
private _time;
|
|
4437
|
+
update(context: Context): void;
|
|
4438
|
+
/** nebula implementations: */
|
|
4439
|
+
private _temp;
|
|
4440
|
+
applyNoise(index: number, pos: Vec3, vel: Vec3, deltaTime: number, age: number, life: number): void;
|
|
4245
4441
|
}
|
|
4246
4442
|
}
|
|
4247
4443
|
declare module "engine-components/ParticleSystem" {
|
|
4248
4444
|
import { Behaviour } from "engine-components/Component";
|
|
4249
4445
|
import * as THREE from "three";
|
|
4250
|
-
import
|
|
4446
|
+
import { MainModule, EmissionModule, ShapeModule, ColorOverLifetimeModule, SizeOverLifetimeModule, NoiseModule, IParticleSystem, ParticleSystemRenderMode } from "engine-components/ParticleSystemModules";
|
|
4447
|
+
import { Mesh, SpriteMaterial } from "three";
|
|
4251
4448
|
export class ParticleSystemRenderer extends Behaviour {
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
main:
|
|
4260
|
-
emission:
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
private
|
|
4270
|
-
private
|
|
4271
|
-
private
|
|
4272
|
-
private
|
|
4449
|
+
renderMode?: ParticleSystemRenderMode;
|
|
4450
|
+
particleMaterial?: SpriteMaterial;
|
|
4451
|
+
particleMesh?: Mesh | string;
|
|
4452
|
+
getMesh(): THREE.Mesh<THREE.BufferGeometry, THREE.SpriteMaterial>;
|
|
4453
|
+
}
|
|
4454
|
+
export class ParticleSystem extends Behaviour implements IParticleSystem {
|
|
4455
|
+
readonly colorOverLifetime: ColorOverLifetimeModule;
|
|
4456
|
+
readonly main: MainModule;
|
|
4457
|
+
readonly emission: EmissionModule;
|
|
4458
|
+
readonly sizeOverLifetime: SizeOverLifetimeModule;
|
|
4459
|
+
readonly shape: ShapeModule;
|
|
4460
|
+
readonly noise: NoiseModule;
|
|
4461
|
+
get renderer(): ParticleSystemRenderer;
|
|
4462
|
+
get currentParticles(): any;
|
|
4463
|
+
get maxParticles(): number;
|
|
4464
|
+
get time(): number;
|
|
4465
|
+
get duration(): number;
|
|
4466
|
+
private _renderer;
|
|
4467
|
+
private _system;
|
|
4468
|
+
private _emitter;
|
|
4469
|
+
private _size;
|
|
4470
|
+
private _container?;
|
|
4471
|
+
private _time;
|
|
4472
|
+
/** called from deserialization */
|
|
4473
|
+
private set bursts(value);
|
|
4474
|
+
private _bursts?;
|
|
4273
4475
|
awake(): void;
|
|
4274
4476
|
onEnable(): void;
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
private updateOverLifetime;
|
|
4278
|
-
private assignPosition;
|
|
4279
|
-
private assignVelocity;
|
|
4477
|
+
onDisable(): void;
|
|
4478
|
+
onBeforeRender(): void;
|
|
4280
4479
|
}
|
|
4281
4480
|
}
|
|
4282
4481
|
declare module "engine/engine_coroutine" {
|
|
@@ -5556,9 +5755,16 @@ declare module "engine-components/codegen/components" {
|
|
|
5556
5755
|
export { OrbitControls } from "engine-components/OrbitControls";
|
|
5557
5756
|
export { ParticleSystemRenderer } from "engine-components/ParticleSystem";
|
|
5558
5757
|
export { ParticleSystem } from "engine-components/ParticleSystem";
|
|
5758
|
+
export { Gradient } from "engine-components/ParticleSystemModules";
|
|
5759
|
+
export { MinMaxCurve } from "engine-components/ParticleSystemModules";
|
|
5760
|
+
export { MinMaxGradient } from "engine-components/ParticleSystemModules";
|
|
5559
5761
|
export { MainModule } from "engine-components/ParticleSystemModules";
|
|
5762
|
+
export { ParticleBurst } from "engine-components/ParticleSystemModules";
|
|
5560
5763
|
export { EmissionModule } from "engine-components/ParticleSystemModules";
|
|
5764
|
+
export { ColorOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
5765
|
+
export { SizeOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
5561
5766
|
export { ShapeModule } from "engine-components/ParticleSystemModules";
|
|
5767
|
+
export { NoiseModule } from "engine-components/ParticleSystemModules";
|
|
5562
5768
|
export { PlayerColor } from "engine-components/PlayerColor";
|
|
5563
5769
|
export { ReflectionProbe } from "engine-components/ReflectionProbe";
|
|
5564
5770
|
export { FieldWithDefault } from "engine-components/Renderer";
|