@needle-tools/engine 2.41.0-pre → 2.43.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 +24 -0
- package/dist/needle-engine.d.ts +226 -76
- package/dist/needle-engine.js +3847 -433
- package/dist/needle-engine.js.map +4 -4
- package/dist/needle-engine.min.js +51 -51
- 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 +24 -3
- package/lib/engine/engine_element_loading.js.map +1 -1
- package/lib/engine/engine_gizmos.d.ts +8 -22
- package/lib/engine/engine_gizmos.js +37 -3
- package/lib/engine/engine_gizmos.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 +17 -1
- package/lib/engine/engine_three_utils.js +104 -54
- package/lib/engine/engine_three_utils.js.map +1 -1
- package/lib/engine/engine_time.js +2 -0
- package/lib/engine/engine_time.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/extensions/NEEDLE_techniques_webgl.js +42 -0
- package/lib/engine/extensions/NEEDLE_techniques_webgl.js.map +1 -1
- package/lib/engine-components/Animation.js +9 -1
- package/lib/engine-components/Animation.js.map +1 -1
- package/lib/engine-components/AnimationCurve.js +2 -2
- package/lib/engine-components/AnimationCurve.js.map +1 -1
- package/lib/engine-components/AnimatorController.js +4 -1
- package/lib/engine-components/AnimatorController.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/Camera.d.ts +3 -0
- package/lib/engine-components/Camera.js +17 -9
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/ParticleSystem.d.ts +41 -13
- package/lib/engine-components/ParticleSystem.js +587 -219
- package/lib/engine-components/ParticleSystem.js.map +1 -1
- package/lib/engine-components/ParticleSystemBehaviours.d.ts +0 -0
- package/lib/engine-components/ParticleSystemBehaviours.js +2 -0
- package/lib/engine-components/ParticleSystemBehaviours.js.map +1 -0
- package/lib/engine-components/ParticleSystemModules.d.ts +123 -22
- package/lib/engine-components/ParticleSystemModules.js +377 -60
- 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/codegen/components.d.ts +5 -0
- package/lib/engine-components/codegen/components.js +5 -0
- package/lib/engine-components/codegen/components.js.map +1 -1
- package/lib/engine-components/js-extensions/RGBAColor.d.ts +1 -0
- package/lib/engine-components/js-extensions/RGBAColor.js +7 -0
- package/lib/engine-components/js-extensions/RGBAColor.js.map +1 -1
- package/package.json +3 -2
- package/src/engine/codegen/register_types.js +20 -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 +23 -2
- package/src/engine/engine_gizmos.ts +45 -8
- package/src/engine/engine_setup.ts +25 -2
- package/src/engine/engine_three_utils.ts +113 -63
- package/src/engine/engine_time.ts +1 -0
- package/src/engine/engine_types.ts +8 -1
- package/src/engine/extensions/NEEDLE_techniques_webgl.ts +43 -1
- package/src/engine-components/Animation.ts +7 -1
- package/src/engine-components/AnimationCurve.ts +2 -2
- package/src/engine-components/AnimatorController.ts +5 -1
- package/src/engine-components/BoxHelperComponent.ts +12 -15
- package/src/engine-components/Camera.ts +17 -10
- package/src/engine-components/ParticleSystem.ts +660 -258
- package/src/engine-components/ParticleSystemBehaviours.ts +0 -0
- package/src/engine-components/ParticleSystemModules.ts +379 -64
- package/src/engine-components/ReflectionProbe.ts +37 -13
- package/src/engine-components/Renderer.ts +4 -2
- package/src/engine-components/codegen/components.ts +5 -0
- package/src/engine-components/js-extensions/RGBAColor.ts +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,30 @@ 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.43.0-pre] - 2022-11-10
|
|
8
|
+
- Add: particles emission over distance
|
|
9
|
+
- Add: particles can enable trail (settings are not yet applied tho)
|
|
10
|
+
- Add: camera now useses culling mask settings
|
|
11
|
+
- Add: particle VelocityOverLife
|
|
12
|
+
- Add: particle basic texture sheet animation support
|
|
13
|
+
- Change: ensure ``time.deltaTime`` is always > 0 and nevery exactly 0
|
|
14
|
+
- Fix: progressbar handle progress event not reporting total file size
|
|
15
|
+
- Fix: layer on camera did affect visibility
|
|
16
|
+
- Fix: cloning animatorcontrollers in builds did fail because of legacy AnimatorAction name check
|
|
17
|
+
- Fix: ``RGBAColor.lerpColors`` did produce wrong alpha value
|
|
18
|
+
- Fix: custom shader ``_ZTest`` value is now applied as threejs depthTest function
|
|
19
|
+
|
|
20
|
+
## [2.42.0-pre] - 2022-11-09
|
|
21
|
+
- add ``Graphics.copyTexture``
|
|
22
|
+
- add ``Renderer.allowProgressiveLoad``
|
|
23
|
+
- add ``Gizmos.DrawBox`` and ``DrawBox3``
|
|
24
|
+
- add particles burst emission
|
|
25
|
+
- add particles color interpolation between two gradients
|
|
26
|
+
- fix: reflection probe material caching for when material is being changed at certain times outside of animation loop and cache applied wrong material
|
|
27
|
+
- fix: AnimationCurve evaluation when time and keyframe are both exactly 0
|
|
28
|
+
- change: reflection probe now requires anchor override
|
|
29
|
+
- change: bump threejs dependency
|
|
30
|
+
|
|
7
31
|
## [2.41.0-pre] - 2022-11-07
|
|
8
32
|
- Add: start adding particle systems support again
|
|
9
33
|
- Change: update dependency version to needle gltf-transform-extensions package
|
package/dist/needle-engine.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ declare module "engine-components/js-extensions/RGBAColor" {
|
|
|
23
23
|
clone(): this;
|
|
24
24
|
copy(col: RGBAColor | Color): this;
|
|
25
25
|
lerp(color: Color, alpha: number): this;
|
|
26
|
+
lerpColors(color1: Color, color2: Color, alpha: number): this;
|
|
26
27
|
multiply(color: Color): this;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
@@ -53,7 +54,7 @@ declare module "engine/engine_physics.types" {
|
|
|
53
54
|
}
|
|
54
55
|
declare module "engine/engine_three_utils" {
|
|
55
56
|
import * as THREE from "three";
|
|
56
|
-
import { Vector3 } from "three";
|
|
57
|
+
import { Vector3, Texture, ShaderMaterial } from "three";
|
|
57
58
|
export function lookAtInverse(obj: THREE.Object3D, target: Vector3): void;
|
|
58
59
|
export function getWorldPosition(obj: THREE.Object3D, vec?: THREE.Vector3 | null, updateParents?: boolean): THREE.Vector3;
|
|
59
60
|
export function setWorldPosition(obj: THREE.Object3D, val: THREE.Vector3): void;
|
|
@@ -70,7 +71,23 @@ declare module "engine/engine_three_utils" {
|
|
|
70
71
|
export function setWorldRotation(obj: THREE.Object3D, val: THREE.Vector3): void;
|
|
71
72
|
export function setWorldRotationXYZ(obj: THREE.Object3D, x: number, y: number, z: number, degrees?: boolean): void;
|
|
72
73
|
export function logHierarchy(root: THREE.Object3D | null | undefined, collapsible?: boolean): void;
|
|
74
|
+
export function isAnimationAction(obj: object): boolean;
|
|
75
|
+
export class Graphics {
|
|
76
|
+
private static planeGeometry;
|
|
77
|
+
private static renderer;
|
|
78
|
+
private static perspectiveCam;
|
|
79
|
+
private static scene;
|
|
80
|
+
private static readonly vertex;
|
|
81
|
+
private static readonly fragment;
|
|
82
|
+
private static readonly blipMaterial;
|
|
83
|
+
static createBlitMaterial(fragment: string): ShaderMaterial;
|
|
84
|
+
private static readonly mesh;
|
|
85
|
+
static copyTexture(texture: Texture, blitMaterial?: ShaderMaterial): THREE.Texture;
|
|
86
|
+
static textureToCanvas(texture: Texture, force: boolean): HTMLCanvasElement | null;
|
|
87
|
+
}
|
|
88
|
+
/**@obsolete use Graphics.copyTexture */
|
|
73
89
|
export function copyTexture(texture: THREE.Texture): THREE.Texture;
|
|
90
|
+
/**@obsolete use Graphics.textureToCanvas */
|
|
74
91
|
export function textureToCanvas(texture: THREE.Texture, force?: boolean): HTMLCanvasElement | null;
|
|
75
92
|
}
|
|
76
93
|
declare module "engine/engine_types" {
|
|
@@ -194,6 +211,12 @@ declare module "engine/engine_types" {
|
|
|
194
211
|
y: number;
|
|
195
212
|
z: number;
|
|
196
213
|
};
|
|
214
|
+
export type Vec4 = {
|
|
215
|
+
x: number;
|
|
216
|
+
y: number;
|
|
217
|
+
z: number;
|
|
218
|
+
w: number;
|
|
219
|
+
};
|
|
197
220
|
export class ContactPoint {
|
|
198
221
|
private readonly _point;
|
|
199
222
|
private readonly _normal;
|
|
@@ -768,30 +791,16 @@ declare module "engine/engine_gameobject" {
|
|
|
768
791
|
}
|
|
769
792
|
declare module "engine/engine_gizmos" {
|
|
770
793
|
import * as THREE from 'three';
|
|
771
|
-
import { ColorRepresentation } from 'three';
|
|
772
|
-
import { Vec3 } from "engine/engine_types";
|
|
794
|
+
import { ColorRepresentation, Box3 } from 'three';
|
|
795
|
+
import { Vec3, Vec4 } from "engine/engine_types";
|
|
773
796
|
export class Gizmos {
|
|
774
797
|
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
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
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;
|
|
798
|
+
static DrawDirection(pt: Vec3, direction: Vec3 | Vec4, color?: ColorRepresentation, duration?: number, depthTest?: boolean, lengthFactor?: number): void;
|
|
799
|
+
static DrawLine(pt0: Vec3, pt1: Vec3, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
800
|
+
static DrawWireSphere(center: Vec3, radius: number, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
801
|
+
static DrawSphere(center: Vec3, radius: number, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
802
|
+
static DrawBox(center: Vec3, size: Vec3, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
803
|
+
static DrawBox3(box: Box3, color?: ColorRepresentation, duration?: number, depthTest?: boolean): void;
|
|
795
804
|
}
|
|
796
805
|
export function CreateWireCube(col?: THREE.ColorRepresentation | null): THREE.LineSegments;
|
|
797
806
|
}
|
|
@@ -1824,6 +1833,9 @@ declare module "engine/engine_setup" {
|
|
|
1824
1833
|
get isInAR(): boolean;
|
|
1825
1834
|
get xrSession(): THREE.XRSession | null;
|
|
1826
1835
|
get arOverlayElement(): HTMLElement;
|
|
1836
|
+
/** Current event of the update cycle */
|
|
1837
|
+
get currentFrameEvent(): FrameEvent;
|
|
1838
|
+
private _currentFrameEvent;
|
|
1827
1839
|
scene: THREE.Scene;
|
|
1828
1840
|
renderer: THREE.WebGLRenderer;
|
|
1829
1841
|
composer: EffectComposer | null;
|
|
@@ -1894,6 +1906,23 @@ declare module "engine/engine_setup" {
|
|
|
1894
1906
|
private executeCoroutines;
|
|
1895
1907
|
}
|
|
1896
1908
|
}
|
|
1909
|
+
declare module "engine/engine_util_decorator" {
|
|
1910
|
+
import { IComponent } from "engine/engine_types";
|
|
1911
|
+
type setter = (v: any) => void;
|
|
1912
|
+
type getter = () => any;
|
|
1913
|
+
/** create accessor callbacks for a field */
|
|
1914
|
+
export const validate: (set?: setter, get?: getter) => (target: IComponent | any, propertyKey: string, descriptor?: undefined) => void;
|
|
1915
|
+
}
|
|
1916
|
+
declare module "engine/api" {
|
|
1917
|
+
export { InstancingUtil } from "engine/engine_instancing";
|
|
1918
|
+
export * from "engine/engine_gameobject";
|
|
1919
|
+
export * from "engine/engine_components";
|
|
1920
|
+
export { AssetReference } from "engine/engine_addressables";
|
|
1921
|
+
export { FrameEvent } from "engine/engine_setup";
|
|
1922
|
+
export * from "engine/debug/debug";
|
|
1923
|
+
export { validate } from "engine/engine_util_decorator";
|
|
1924
|
+
export { Gizmos } from "engine/engine_gizmos";
|
|
1925
|
+
}
|
|
1897
1926
|
declare module "engine/engine_element_loading" {
|
|
1898
1927
|
import { LoadingProgressArgs } from "engine/engine_setup";
|
|
1899
1928
|
export class LoadingElementOptions {
|
|
@@ -2460,23 +2489,6 @@ declare module "engine/engine_element" {
|
|
|
2460
2489
|
private onBeforeBeginLoading;
|
|
2461
2490
|
}
|
|
2462
2491
|
}
|
|
2463
|
-
declare module "engine/engine_util_decorator" {
|
|
2464
|
-
import { IComponent } from "engine/engine_types";
|
|
2465
|
-
type setter = (v: any) => void;
|
|
2466
|
-
type getter = () => any;
|
|
2467
|
-
/** create accessor callbacks for a field */
|
|
2468
|
-
export const validate: (set?: setter, get?: getter) => (target: IComponent | any, propertyKey: string, descriptor?: undefined) => void;
|
|
2469
|
-
}
|
|
2470
|
-
declare module "engine/api" {
|
|
2471
|
-
export { InstancingUtil } from "engine/engine_instancing";
|
|
2472
|
-
export * from "engine/engine_gameobject";
|
|
2473
|
-
export * from "engine/engine_components";
|
|
2474
|
-
export { AssetReference } from "engine/engine_addressables";
|
|
2475
|
-
export { FrameEvent } from "engine/engine_setup";
|
|
2476
|
-
export * from "engine/debug/debug";
|
|
2477
|
-
export { validate } from "engine/engine_util_decorator";
|
|
2478
|
-
export { Gizmos } from "engine/engine_gizmos";
|
|
2479
|
-
}
|
|
2480
2492
|
declare module "engine-components/AlignmentConstraint" {
|
|
2481
2493
|
import { Behaviour } from "engine-components/Component";
|
|
2482
2494
|
export class AlignmentConstraint extends Behaviour {
|
|
@@ -2592,6 +2604,9 @@ declare module "engine-components/Camera" {
|
|
|
2592
2604
|
orthographic: boolean;
|
|
2593
2605
|
orthographicSize: number;
|
|
2594
2606
|
ARBackgroundAlpha: number;
|
|
2607
|
+
set cullingMask(val: number);
|
|
2608
|
+
get cullingMask(): number;
|
|
2609
|
+
private _cullingMask;
|
|
2595
2610
|
private _nearClipPlane;
|
|
2596
2611
|
private _farClipPlane;
|
|
2597
2612
|
get backgroundColor(): RGBAColor | null;
|
|
@@ -3471,6 +3486,7 @@ declare module "engine-components/Renderer" {
|
|
|
3471
3486
|
get lightmap(): Texture | null;
|
|
3472
3487
|
set lightmap(tex: Texture | null | undefined);
|
|
3473
3488
|
get hasLightmap(): boolean;
|
|
3489
|
+
allowProgressiveLoading: boolean;
|
|
3474
3490
|
awake(): void;
|
|
3475
3491
|
private _isInstancingEnabled;
|
|
3476
3492
|
private handles;
|
|
@@ -4158,10 +4174,11 @@ declare module "engine-components/OffsetConstraint" {
|
|
|
4158
4174
|
}
|
|
4159
4175
|
declare module "engine-components/ParticleSystemModules" {
|
|
4160
4176
|
import * as THREE from "three";
|
|
4161
|
-
import { Object3D, Vector3 } from "three";
|
|
4177
|
+
import { Object3D, Quaternion, Vector3 } from "three";
|
|
4162
4178
|
import { RGBAColor } from "engine-components/js-extensions/RGBAColor";
|
|
4163
4179
|
import { AnimationCurve } from "engine-components/AnimationCurve";
|
|
4164
4180
|
import { Vec3 } from "engine/engine_types";
|
|
4181
|
+
import { EmitterShape, Particle, ShapeJSON } from "three.quarks";
|
|
4165
4182
|
type Color4 = {
|
|
4166
4183
|
r: number;
|
|
4167
4184
|
g: number;
|
|
@@ -4176,6 +4193,20 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4176
4193
|
time: number;
|
|
4177
4194
|
alpha: number;
|
|
4178
4195
|
};
|
|
4196
|
+
export interface IParticleSystem {
|
|
4197
|
+
get currentParticles(): number;
|
|
4198
|
+
get maxParticles(): number;
|
|
4199
|
+
get time(): number;
|
|
4200
|
+
get duration(): number;
|
|
4201
|
+
readonly main: MainModule;
|
|
4202
|
+
get container(): Object3D;
|
|
4203
|
+
get worldQuaternion(): Quaternion;
|
|
4204
|
+
get worldQuaternionInverted(): Quaternion;
|
|
4205
|
+
}
|
|
4206
|
+
export enum ParticleSystemRenderMode {
|
|
4207
|
+
Billboard = 0,
|
|
4208
|
+
Mesh = 4
|
|
4209
|
+
}
|
|
4179
4210
|
export class Gradient {
|
|
4180
4211
|
alphaKeys: Array<AlphaKey>;
|
|
4181
4212
|
colorKeys: Array<ColorKey>;
|
|
@@ -4242,7 +4273,8 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4242
4273
|
gradient: Gradient;
|
|
4243
4274
|
gradientMin: Gradient;
|
|
4244
4275
|
gradientMax: Gradient;
|
|
4245
|
-
private _temp;
|
|
4276
|
+
private static _temp;
|
|
4277
|
+
private static _temp2;
|
|
4246
4278
|
evaluate(t01: number, lerpFactor?: number): RGBAColor;
|
|
4247
4279
|
}
|
|
4248
4280
|
type ParticleSystemScalingMode = {
|
|
@@ -4297,21 +4329,39 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4297
4329
|
stopAction: number;
|
|
4298
4330
|
useUnscaledTime: boolean;
|
|
4299
4331
|
}
|
|
4332
|
+
export class ParticleBurst {
|
|
4333
|
+
cycleCount: number;
|
|
4334
|
+
maxCount: number;
|
|
4335
|
+
minCount: number;
|
|
4336
|
+
probability: number;
|
|
4337
|
+
repeatInterval: number;
|
|
4338
|
+
time: number;
|
|
4339
|
+
count: {
|
|
4340
|
+
constant: number;
|
|
4341
|
+
constantMax: number;
|
|
4342
|
+
constantMin: number;
|
|
4343
|
+
curve?: AnimationCurve;
|
|
4344
|
+
curveMax?: AnimationCurve;
|
|
4345
|
+
curveMin?: AnimationCurve;
|
|
4346
|
+
curveMultiplier?: number;
|
|
4347
|
+
mode: ParticleSystemCurveMode;
|
|
4348
|
+
};
|
|
4349
|
+
private _performed;
|
|
4350
|
+
reset(): void;
|
|
4351
|
+
run(time: number): number;
|
|
4352
|
+
}
|
|
4300
4353
|
export class EmissionModule {
|
|
4301
|
-
burstCount: number;
|
|
4302
4354
|
enabled: boolean;
|
|
4355
|
+
get burstCount(): number;
|
|
4356
|
+
bursts: ParticleBurst[];
|
|
4303
4357
|
rateOverTime: MinMaxCurve;
|
|
4304
4358
|
rateOverTimeMultiplier: number;
|
|
4305
4359
|
rateOverDistance: MinMaxCurve;
|
|
4306
4360
|
rateOverDistanceMultiplier: number;
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
/** called by nebula */
|
|
4312
|
-
init(): void;
|
|
4313
|
-
/** called by nebula */
|
|
4314
|
-
getValue(deltaTime: number): number;
|
|
4361
|
+
/** set from system */
|
|
4362
|
+
system: IParticleSystem;
|
|
4363
|
+
get time(): number;
|
|
4364
|
+
getBurst(): number;
|
|
4315
4365
|
}
|
|
4316
4366
|
export class ColorOverLifetimeModule {
|
|
4317
4367
|
enabled: boolean;
|
|
@@ -4322,16 +4372,21 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4322
4372
|
separateAxes: boolean;
|
|
4323
4373
|
size: MinMaxCurve;
|
|
4324
4374
|
sizeMultiplier: number;
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4375
|
+
x: MinMaxCurve;
|
|
4376
|
+
xMultiplier: number;
|
|
4377
|
+
y: MinMaxCurve;
|
|
4378
|
+
yMultiplier: number;
|
|
4379
|
+
z: MinMaxCurve;
|
|
4380
|
+
zMultiplier: number;
|
|
4331
4381
|
private _time;
|
|
4332
|
-
|
|
4382
|
+
private _temp;
|
|
4383
|
+
evaluate(t01: number, target?: Vec3): Vec3;
|
|
4333
4384
|
}
|
|
4334
|
-
export class ShapeModule {
|
|
4385
|
+
export class ShapeModule implements EmitterShape {
|
|
4386
|
+
get type(): string;
|
|
4387
|
+
initialize(particle: Particle): void;
|
|
4388
|
+
toJSON(): ShapeJSON;
|
|
4389
|
+
clone(): EmitterShape;
|
|
4335
4390
|
shapeType: ParticleSystemShapeType;
|
|
4336
4391
|
enabled: boolean;
|
|
4337
4392
|
alignToDirection: boolean;
|
|
@@ -4354,10 +4409,9 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4354
4409
|
private _temp;
|
|
4355
4410
|
/** called by nebula on initialize */
|
|
4356
4411
|
get vector(): THREE.Vector3;
|
|
4357
|
-
/** called by nebula */
|
|
4358
4412
|
getPosition(): void;
|
|
4359
4413
|
private _dir;
|
|
4360
|
-
getDirection(position: any):
|
|
4414
|
+
getDirection(position: any): Vector3;
|
|
4361
4415
|
}
|
|
4362
4416
|
import { Context } from "engine/engine_setup";
|
|
4363
4417
|
export class NoiseModule {
|
|
@@ -4392,27 +4446,118 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4392
4446
|
update(context: Context): void;
|
|
4393
4447
|
/** nebula implementations: */
|
|
4394
4448
|
private _temp;
|
|
4395
|
-
|
|
4449
|
+
apply(_index: number, pos: Vec3, vel: Vec3, _deltaTime: number, age: number, life: number): void;
|
|
4450
|
+
}
|
|
4451
|
+
export class TrailModule {
|
|
4452
|
+
enabled: boolean;
|
|
4453
|
+
}
|
|
4454
|
+
export class VelocityOverLifetimeModule {
|
|
4455
|
+
enabled: boolean;
|
|
4456
|
+
space: ParticleSystemSimulationSpace;
|
|
4457
|
+
speedModifier: MinMaxCurve;
|
|
4458
|
+
speedModifierMultiplier: number;
|
|
4459
|
+
x: MinMaxCurve;
|
|
4460
|
+
xMultiplier: number;
|
|
4461
|
+
y: MinMaxCurve;
|
|
4462
|
+
yMultiplier: number;
|
|
4463
|
+
z: MinMaxCurve;
|
|
4464
|
+
zMultiplier: number;
|
|
4465
|
+
private _system?;
|
|
4466
|
+
update(system: IParticleSystem): void;
|
|
4467
|
+
private _temp;
|
|
4468
|
+
apply(_index: number, _pos: Vec3, vel: Vec3, _dt: number, age: number, life: number): void;
|
|
4469
|
+
}
|
|
4470
|
+
enum ParticleSystemAnimationTimeMode {
|
|
4471
|
+
Lifetime = 0,
|
|
4472
|
+
Speed = 1,
|
|
4473
|
+
FPS = 2
|
|
4474
|
+
}
|
|
4475
|
+
enum ParticleSystemAnimationRowMode {
|
|
4476
|
+
Custom = 0,
|
|
4477
|
+
Random = 1,
|
|
4478
|
+
MeshIndex = 2
|
|
4479
|
+
}
|
|
4480
|
+
enum ParticleSystemAnimationType {
|
|
4481
|
+
WholeSheet = 0,
|
|
4482
|
+
SingleRow = 1
|
|
4483
|
+
}
|
|
4484
|
+
export class TextureSheetAnimationModule {
|
|
4485
|
+
animation: ParticleSystemAnimationType;
|
|
4486
|
+
enabled: boolean;
|
|
4487
|
+
cycleCount: number;
|
|
4488
|
+
frameOverTime: MinMaxCurve;
|
|
4489
|
+
frameOverTimeMultiplier: number;
|
|
4490
|
+
numTilesX: number;
|
|
4491
|
+
numTilesY: number;
|
|
4492
|
+
startFrame: MinMaxCurve;
|
|
4493
|
+
startFrameMultiplier: number;
|
|
4494
|
+
rowMode: ParticleSystemAnimationRowMode;
|
|
4495
|
+
rowIndex: number;
|
|
4496
|
+
spriteCount: number;
|
|
4497
|
+
timeMode: ParticleSystemAnimationTimeMode;
|
|
4498
|
+
private sampleOnceAtStart;
|
|
4499
|
+
getStartIndex(): number;
|
|
4500
|
+
evaluate(t01: number): number | undefined;
|
|
4501
|
+
private getIndex;
|
|
4502
|
+
}
|
|
4503
|
+
export class RotationOverLifetimeModule {
|
|
4504
|
+
enabled: boolean;
|
|
4505
|
+
separateAxes: boolean;
|
|
4506
|
+
x: MinMaxCurve;
|
|
4507
|
+
xMultiplier: number;
|
|
4508
|
+
y: MinMaxCurve;
|
|
4509
|
+
yMultiplier: number;
|
|
4510
|
+
z: MinMaxCurve;
|
|
4511
|
+
zMultiplier: number;
|
|
4512
|
+
evaluate(t01: number): number;
|
|
4396
4513
|
}
|
|
4397
4514
|
}
|
|
4398
4515
|
declare module "engine-components/ParticleSystem" {
|
|
4399
4516
|
import { Behaviour } from "engine-components/Component";
|
|
4400
|
-
import
|
|
4401
|
-
import {
|
|
4517
|
+
import * as THREE from "three";
|
|
4518
|
+
import { MainModule, EmissionModule, ShapeModule, ColorOverLifetimeModule, SizeOverLifetimeModule, NoiseModule, IParticleSystem, ParticleSystemRenderMode, TrailModule, VelocityOverLifetimeModule, TextureSheetAnimationModule, RotationOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
4519
|
+
import { Mesh, Object3D, Quaternion, SpriteMaterial } from "three";
|
|
4402
4520
|
export class ParticleSystemRenderer extends Behaviour {
|
|
4521
|
+
renderMode?: ParticleSystemRenderMode;
|
|
4403
4522
|
particleMaterial?: SpriteMaterial;
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4523
|
+
particleMesh?: Mesh | string;
|
|
4524
|
+
get transparent(): boolean;
|
|
4525
|
+
getMesh(): THREE.Mesh<THREE.BufferGeometry, THREE.SpriteMaterial>;
|
|
4526
|
+
}
|
|
4527
|
+
export class ParticleSystem extends Behaviour implements IParticleSystem {
|
|
4528
|
+
readonly colorOverLifetime: ColorOverLifetimeModule;
|
|
4529
|
+
readonly main: MainModule;
|
|
4530
|
+
readonly emission: EmissionModule;
|
|
4531
|
+
readonly sizeOverLifetime: SizeOverLifetimeModule;
|
|
4532
|
+
readonly shape: ShapeModule;
|
|
4533
|
+
readonly noise: NoiseModule;
|
|
4534
|
+
readonly trails: TrailModule;
|
|
4535
|
+
readonly velocityOverLifetime: VelocityOverLifetimeModule;
|
|
4536
|
+
readonly textureSheetAnimation: TextureSheetAnimationModule;
|
|
4537
|
+
readonly rotationOverLifetime: RotationOverLifetimeModule;
|
|
4538
|
+
get renderer(): ParticleSystemRenderer;
|
|
4539
|
+
get currentParticles(): number;
|
|
4540
|
+
get maxParticles(): number;
|
|
4541
|
+
get time(): number;
|
|
4542
|
+
get duration(): number;
|
|
4543
|
+
get deltaTime(): number;
|
|
4544
|
+
get scale(): number;
|
|
4545
|
+
get cameraScale(): number;
|
|
4546
|
+
private _cameraScale;
|
|
4547
|
+
get container(): Object3D;
|
|
4548
|
+
private __worldQuaternion;
|
|
4549
|
+
get worldQuaternion(): Quaternion;
|
|
4550
|
+
private _worldQuaternionInverted;
|
|
4551
|
+
get worldQuaternionInverted(): Quaternion;
|
|
4552
|
+
private _renderer;
|
|
4553
|
+
private _batchSystem?;
|
|
4554
|
+
private _particleSystem?;
|
|
4555
|
+
private _interface;
|
|
4556
|
+
private _container;
|
|
4557
|
+
private _time;
|
|
4558
|
+
/** called from deserialization */
|
|
4559
|
+
private set bursts(value);
|
|
4560
|
+
private _bursts?;
|
|
4416
4561
|
awake(): void;
|
|
4417
4562
|
onEnable(): void;
|
|
4418
4563
|
onDisable(): void;
|
|
@@ -5700,11 +5845,16 @@ declare module "engine-components/codegen/components" {
|
|
|
5700
5845
|
export { MinMaxCurve } from "engine-components/ParticleSystemModules";
|
|
5701
5846
|
export { MinMaxGradient } from "engine-components/ParticleSystemModules";
|
|
5702
5847
|
export { MainModule } from "engine-components/ParticleSystemModules";
|
|
5848
|
+
export { ParticleBurst } from "engine-components/ParticleSystemModules";
|
|
5703
5849
|
export { EmissionModule } from "engine-components/ParticleSystemModules";
|
|
5704
5850
|
export { ColorOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
5705
5851
|
export { SizeOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
5706
5852
|
export { ShapeModule } from "engine-components/ParticleSystemModules";
|
|
5707
5853
|
export { NoiseModule } from "engine-components/ParticleSystemModules";
|
|
5854
|
+
export { TrailModule } from "engine-components/ParticleSystemModules";
|
|
5855
|
+
export { VelocityOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
5856
|
+
export { TextureSheetAnimationModule } from "engine-components/ParticleSystemModules";
|
|
5857
|
+
export { RotationOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
5708
5858
|
export { PlayerColor } from "engine-components/PlayerColor";
|
|
5709
5859
|
export { ReflectionProbe } from "engine-components/ReflectionProbe";
|
|
5710
5860
|
export { FieldWithDefault } from "engine-components/Renderer";
|