@needle-tools/engine 2.42.0-pre → 2.44.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 +22 -0
- package/dist/needle-engine.d.ts +224 -81
- package/dist/needle-engine.js +3836 -422
- package/dist/needle-engine.js.map +4 -4
- package/dist/needle-engine.min.js +40 -40
- package/dist/needle-engine.min.js.map +4 -4
- package/lib/engine/engine_element_loading.js +22 -6
- package/lib/engine/engine_element_loading.js.map +1 -1
- package/lib/engine/engine_input.js +17 -6
- package/lib/engine/engine_input.js.map +1 -1
- package/lib/engine/engine_serialization_builtin_serializer.js +60 -58
- package/lib/engine/engine_serialization_builtin_serializer.js.map +1 -1
- package/lib/engine/engine_three_utils.d.ts +1 -0
- package/lib/engine/engine_three_utils.js +10 -0
- 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/extensions/NEEDLE_techniques_webgl.js +42 -0
- package/lib/engine/extensions/NEEDLE_techniques_webgl.js.map +1 -1
- package/lib/engine-components/Animation.d.ts +3 -1
- package/lib/engine-components/Animation.js +25 -1
- package/lib/engine-components/Animation.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/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 +33 -7
- package/lib/engine-components/ParticleSystem.js +464 -249
- 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 -20
- package/lib/engine-components/ParticleSystemModules.js +461 -63
- package/lib/engine-components/ParticleSystemModules.js.map +1 -1
- package/lib/engine-components/WebXRController.d.ts +1 -0
- package/lib/engine-components/WebXRController.js +2 -1
- package/lib/engine-components/WebXRController.js.map +1 -1
- package/lib/engine-components/codegen/components.d.ts +6 -0
- package/lib/engine-components/codegen/components.js +6 -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 +2 -1
- package/src/engine/codegen/register_types.js +24 -0
- package/src/engine/engine_element_loading.ts +22 -5
- package/src/engine/engine_input.ts +16 -7
- package/src/engine/engine_serialization_builtin_serializer.ts +59 -57
- package/src/engine/engine_three_utils.ts +11 -2
- package/src/engine/engine_time.ts +1 -0
- package/src/engine/extensions/NEEDLE_techniques_webgl.ts +43 -1
- package/src/engine-components/Animation.ts +18 -2
- package/src/engine-components/AnimatorController.ts +5 -1
- package/src/engine-components/Camera.ts +17 -10
- package/src/engine-components/ParticleSystem.ts +526 -303
- package/src/engine-components/ParticleSystemBehaviours.ts +0 -0
- package/src/engine-components/ParticleSystemModules.ts +408 -66
- package/src/engine-components/WebXRController.ts +2 -1
- package/src/engine-components/codegen/components.ts +6 -0
- package/src/engine-components/js-extensions/RGBAColor.ts +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,28 @@ 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.44.0-pre] - 2022-11-11
|
|
8
|
+
- Add: Particles limit velocity over time
|
|
9
|
+
- Add: Particles rotation by speed
|
|
10
|
+
- Add: ParticleSystem play, pause, stop and emit(count) methods
|
|
11
|
+
- Add: ``WebXR.showRaycastLine`` exposed so it can be disabled from code
|
|
12
|
+
- Fix: issues in applying some forces/values for different scaling and worldspace <> localspace scenarios
|
|
13
|
+
- Change: raise input events in core method to also allow receiving WebAR mock touch events
|
|
14
|
+
- Change: ``Animation.play()`` does not require argument anymore
|
|
15
|
+
|
|
16
|
+
## [2.43.0-pre] - 2022-11-10
|
|
17
|
+
- Add: particles emission over distance
|
|
18
|
+
- Add: particles can enable trail (settings are not yet applied tho)
|
|
19
|
+
- Add: camera now useses culling mask settings
|
|
20
|
+
- Add: particle VelocityOverLife
|
|
21
|
+
- Add: particle basic texture sheet animation support
|
|
22
|
+
- Change: ensure ``time.deltaTime`` is always > 0 and nevery exactly 0
|
|
23
|
+
- Fix: progressbar handle progress event not reporting total file size
|
|
24
|
+
- Fix: layer on camera did affect visibility
|
|
25
|
+
- Fix: cloning animatorcontrollers in builds did fail because of legacy AnimatorAction name check
|
|
26
|
+
- Fix: ``RGBAColor.lerpColors`` did produce wrong alpha value
|
|
27
|
+
- Fix: custom shader ``_ZTest`` value is now applied as threejs depthTest function
|
|
28
|
+
|
|
7
29
|
## [2.42.0-pre] - 2022-11-09
|
|
8
30
|
- add ``Graphics.copyTexture``
|
|
9
31
|
- add ``Renderer.allowProgressiveLoad``
|
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
|
}
|
|
@@ -70,6 +71,7 @@ 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;
|
|
73
75
|
export class Graphics {
|
|
74
76
|
private static planeGeometry;
|
|
75
77
|
private static renderer;
|
|
@@ -287,42 +289,6 @@ declare module "engine/engine_utils" {
|
|
|
287
289
|
}
|
|
288
290
|
export function isMobileDevice(): boolean;
|
|
289
291
|
}
|
|
290
|
-
declare module "engine/extensions/extension_resolver" {
|
|
291
|
-
import { GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
292
|
-
export interface IExtensionReferenceResolver {
|
|
293
|
-
resolve(parser: GLTFParser, path: string): Promise<void> | null;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
declare module "engine/engine_default_parameters" {
|
|
297
|
-
export const showGizmos: string | boolean;
|
|
298
|
-
export const debugExtension: string | boolean;
|
|
299
|
-
}
|
|
300
|
-
declare module "engine/extensions/extension_utils" {
|
|
301
|
-
import { GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
302
|
-
export function resolveReferences(parser: GLTFParser, obj: any): Promise<void | void[]>;
|
|
303
|
-
}
|
|
304
|
-
declare module "engine/engine_typestore" {
|
|
305
|
-
class _TypeStore {
|
|
306
|
-
private _types;
|
|
307
|
-
add(key: any, type: any): void;
|
|
308
|
-
get(key: any): any;
|
|
309
|
-
}
|
|
310
|
-
export const $BuiltInTypeFlag: unique symbol;
|
|
311
|
-
export const TypeStore: _TypeStore;
|
|
312
|
-
}
|
|
313
|
-
declare module "engine/extensions/NEEDLE_persistent_assets" {
|
|
314
|
-
import { GLTF, GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
315
|
-
import { IExtensionReferenceResolver } from "engine/extensions/extension_resolver";
|
|
316
|
-
export const EXTENSION_NAME = "NEEDLE_persistent_assets";
|
|
317
|
-
export function isPersistentAsset(asset: any): boolean;
|
|
318
|
-
export class NEEDLE_persistent_assets implements GLTFLoaderPlugin, IExtensionReferenceResolver {
|
|
319
|
-
get name(): string;
|
|
320
|
-
private parser;
|
|
321
|
-
constructor(parser: GLTFParser);
|
|
322
|
-
afterRoot(_result: GLTF): Promise<void>;
|
|
323
|
-
resolve(parser: GLTFParser, path: string): Promise<void> | null | any;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
292
|
declare module "engine/engine_networking_utils" {
|
|
327
293
|
export function isLocalNetwork(hostname?: string): boolean;
|
|
328
294
|
export function isHostedOnGlitch(): boolean;
|
|
@@ -363,6 +329,42 @@ declare module "engine/debug/debug" {
|
|
|
363
329
|
export function showBalloonMessage(text: string, logType?: LogType): void;
|
|
364
330
|
export function showBalloonWarning(text: string): void;
|
|
365
331
|
}
|
|
332
|
+
declare module "engine/extensions/extension_resolver" {
|
|
333
|
+
import { GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
334
|
+
export interface IExtensionReferenceResolver {
|
|
335
|
+
resolve(parser: GLTFParser, path: string): Promise<void> | null;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
declare module "engine/engine_default_parameters" {
|
|
339
|
+
export const showGizmos: string | boolean;
|
|
340
|
+
export const debugExtension: string | boolean;
|
|
341
|
+
}
|
|
342
|
+
declare module "engine/extensions/extension_utils" {
|
|
343
|
+
import { GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
344
|
+
export function resolveReferences(parser: GLTFParser, obj: any): Promise<void | void[]>;
|
|
345
|
+
}
|
|
346
|
+
declare module "engine/engine_typestore" {
|
|
347
|
+
class _TypeStore {
|
|
348
|
+
private _types;
|
|
349
|
+
add(key: any, type: any): void;
|
|
350
|
+
get(key: any): any;
|
|
351
|
+
}
|
|
352
|
+
export const $BuiltInTypeFlag: unique symbol;
|
|
353
|
+
export const TypeStore: _TypeStore;
|
|
354
|
+
}
|
|
355
|
+
declare module "engine/extensions/NEEDLE_persistent_assets" {
|
|
356
|
+
import { GLTF, GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader";
|
|
357
|
+
import { IExtensionReferenceResolver } from "engine/extensions/extension_resolver";
|
|
358
|
+
export const EXTENSION_NAME = "NEEDLE_persistent_assets";
|
|
359
|
+
export function isPersistentAsset(asset: any): boolean;
|
|
360
|
+
export class NEEDLE_persistent_assets implements GLTFLoaderPlugin, IExtensionReferenceResolver {
|
|
361
|
+
get name(): string;
|
|
362
|
+
private parser;
|
|
363
|
+
constructor(parser: GLTFParser);
|
|
364
|
+
afterRoot(_result: GLTF): Promise<void>;
|
|
365
|
+
resolve(parser: GLTFParser, path: string): Promise<void> | null | any;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
366
368
|
declare module "engine/engine_serialization_core" {
|
|
367
369
|
import { GLTF } from "three/examples/jsm/loaders/GLTFLoader";
|
|
368
370
|
import { Object3D } from "three";
|
|
@@ -1904,6 +1906,23 @@ declare module "engine/engine_setup" {
|
|
|
1904
1906
|
private executeCoroutines;
|
|
1905
1907
|
}
|
|
1906
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
|
+
}
|
|
1907
1926
|
declare module "engine/engine_element_loading" {
|
|
1908
1927
|
import { LoadingProgressArgs } from "engine/engine_setup";
|
|
1909
1928
|
export class LoadingElementOptions {
|
|
@@ -2178,6 +2197,8 @@ declare module "engine-components/Animation" {
|
|
|
2178
2197
|
randomStartTime: boolean;
|
|
2179
2198
|
minMaxSpeed?: Vec2;
|
|
2180
2199
|
minMaxOffsetNormalized?: Vec2;
|
|
2200
|
+
loop: boolean;
|
|
2201
|
+
clampWhenFinished: boolean;
|
|
2181
2202
|
private _tempAnimationClipBeforeGameObjectExisted;
|
|
2182
2203
|
get clip(): AnimationClip | null;
|
|
2183
2204
|
set clip(val: AnimationClip | null);
|
|
@@ -2203,7 +2224,7 @@ declare module "engine-components/Animation" {
|
|
|
2203
2224
|
update(): void;
|
|
2204
2225
|
getAction(name: string): THREE.AnimationAction | undefined | null;
|
|
2205
2226
|
get isPlaying(): boolean;
|
|
2206
|
-
play(clipOrNumber: AnimationClip | number | string, options?: PlayOptions): Promise<AnimationAction> | void;
|
|
2227
|
+
play(clipOrNumber: AnimationClip | number | string | undefined, options?: PlayOptions): Promise<AnimationAction> | void;
|
|
2207
2228
|
internalOnPlay(action: AnimationAction, options?: PlayOptions): Promise<AnimationAction>;
|
|
2208
2229
|
private tryFindHandle;
|
|
2209
2230
|
private _didInit;
|
|
@@ -2470,23 +2491,6 @@ declare module "engine/engine_element" {
|
|
|
2470
2491
|
private onBeforeBeginLoading;
|
|
2471
2492
|
}
|
|
2472
2493
|
}
|
|
2473
|
-
declare module "engine/engine_util_decorator" {
|
|
2474
|
-
import { IComponent } from "engine/engine_types";
|
|
2475
|
-
type setter = (v: any) => void;
|
|
2476
|
-
type getter = () => any;
|
|
2477
|
-
/** create accessor callbacks for a field */
|
|
2478
|
-
export const validate: (set?: setter, get?: getter) => (target: IComponent | any, propertyKey: string, descriptor?: undefined) => void;
|
|
2479
|
-
}
|
|
2480
|
-
declare module "engine/api" {
|
|
2481
|
-
export { InstancingUtil } from "engine/engine_instancing";
|
|
2482
|
-
export * from "engine/engine_gameobject";
|
|
2483
|
-
export * from "engine/engine_components";
|
|
2484
|
-
export { AssetReference } from "engine/engine_addressables";
|
|
2485
|
-
export { FrameEvent } from "engine/engine_setup";
|
|
2486
|
-
export * from "engine/debug/debug";
|
|
2487
|
-
export { validate } from "engine/engine_util_decorator";
|
|
2488
|
-
export { Gizmos } from "engine/engine_gizmos";
|
|
2489
|
-
}
|
|
2490
2494
|
declare module "engine-components/AlignmentConstraint" {
|
|
2491
2495
|
import { Behaviour } from "engine-components/Component";
|
|
2492
2496
|
export class AlignmentConstraint extends Behaviour {
|
|
@@ -2602,6 +2606,9 @@ declare module "engine-components/Camera" {
|
|
|
2602
2606
|
orthographic: boolean;
|
|
2603
2607
|
orthographicSize: number;
|
|
2604
2608
|
ARBackgroundAlpha: number;
|
|
2609
|
+
set cullingMask(val: number);
|
|
2610
|
+
get cullingMask(): number;
|
|
2611
|
+
private _cullingMask;
|
|
2605
2612
|
private _nearClipPlane;
|
|
2606
2613
|
private _farClipPlane;
|
|
2607
2614
|
get backgroundColor(): RGBAColor | null;
|
|
@@ -3593,6 +3600,7 @@ declare module "engine-components/WebXRController" {
|
|
|
3593
3600
|
grabbed: AttachedObject | null;
|
|
3594
3601
|
input: XRInputSource | null;
|
|
3595
3602
|
type: ControllerType;
|
|
3603
|
+
showRaycastLine: boolean;
|
|
3596
3604
|
get isUsingHands(): boolean;
|
|
3597
3605
|
get wrist(): Object3D | null;
|
|
3598
3606
|
private _wristQuaternion;
|
|
@@ -4169,10 +4177,11 @@ declare module "engine-components/OffsetConstraint" {
|
|
|
4169
4177
|
}
|
|
4170
4178
|
declare module "engine-components/ParticleSystemModules" {
|
|
4171
4179
|
import * as THREE from "three";
|
|
4172
|
-
import { Object3D, Vector3 } from "three";
|
|
4180
|
+
import { Object3D, Quaternion, Vector3 } from "three";
|
|
4173
4181
|
import { RGBAColor } from "engine-components/js-extensions/RGBAColor";
|
|
4174
4182
|
import { AnimationCurve } from "engine-components/AnimationCurve";
|
|
4175
|
-
import { Vec3 } from "engine/engine_types";
|
|
4183
|
+
import { Vec2, Vec3 } from "engine/engine_types";
|
|
4184
|
+
import { EmitterShape, Particle, ShapeJSON } from "three.quarks";
|
|
4176
4185
|
type Color4 = {
|
|
4177
4186
|
r: number;
|
|
4178
4187
|
g: number;
|
|
@@ -4193,6 +4202,10 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4193
4202
|
get time(): number;
|
|
4194
4203
|
get duration(): number;
|
|
4195
4204
|
readonly main: MainModule;
|
|
4205
|
+
get container(): Object3D;
|
|
4206
|
+
get worldQuaternion(): Quaternion;
|
|
4207
|
+
get worldQuaternionInverted(): Quaternion;
|
|
4208
|
+
get worldScale(): Vector3;
|
|
4196
4209
|
}
|
|
4197
4210
|
export enum ParticleSystemRenderMode {
|
|
4198
4211
|
Billboard = 0,
|
|
@@ -4351,12 +4364,8 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4351
4364
|
rateOverDistanceMultiplier: number;
|
|
4352
4365
|
/** set from system */
|
|
4353
4366
|
system: IParticleSystem;
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
/** called by nebula */
|
|
4357
|
-
init(): void;
|
|
4358
|
-
/** called by nebula */
|
|
4359
|
-
getValue(deltaTime: number): number;
|
|
4367
|
+
reset(): void;
|
|
4368
|
+
getBurst(): number;
|
|
4360
4369
|
}
|
|
4361
4370
|
export class ColorOverLifetimeModule {
|
|
4362
4371
|
enabled: boolean;
|
|
@@ -4367,16 +4376,21 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4367
4376
|
separateAxes: boolean;
|
|
4368
4377
|
size: MinMaxCurve;
|
|
4369
4378
|
sizeMultiplier: number;
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4379
|
+
x: MinMaxCurve;
|
|
4380
|
+
xMultiplier: number;
|
|
4381
|
+
y: MinMaxCurve;
|
|
4382
|
+
yMultiplier: number;
|
|
4383
|
+
z: MinMaxCurve;
|
|
4384
|
+
zMultiplier: number;
|
|
4376
4385
|
private _time;
|
|
4377
|
-
|
|
4386
|
+
private _temp;
|
|
4387
|
+
evaluate(t01: number, target?: Vec3): Vec3;
|
|
4378
4388
|
}
|
|
4379
|
-
export class ShapeModule {
|
|
4389
|
+
export class ShapeModule implements EmitterShape {
|
|
4390
|
+
get type(): string;
|
|
4391
|
+
initialize(particle: Particle): void;
|
|
4392
|
+
toJSON(): ShapeJSON;
|
|
4393
|
+
clone(): EmitterShape;
|
|
4380
4394
|
shapeType: ParticleSystemShapeType;
|
|
4381
4395
|
enabled: boolean;
|
|
4382
4396
|
alignToDirection: boolean;
|
|
@@ -4390,16 +4404,17 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4390
4404
|
radius: number;
|
|
4391
4405
|
radiusThickness: number;
|
|
4392
4406
|
sphericalDirectionAmount: number;
|
|
4407
|
+
private system;
|
|
4393
4408
|
private _space?;
|
|
4394
|
-
private readonly
|
|
4395
|
-
|
|
4409
|
+
private readonly _worldSpaceMatrix;
|
|
4410
|
+
private readonly _worldSpaceMatrixInverse;
|
|
4411
|
+
update(system: IParticleSystem, _context: Context, simulationSpace: ParticleSystemSimulationSpace, obj: Object3D): void;
|
|
4396
4412
|
/** nebula implementations: */
|
|
4397
4413
|
/** initializer implementation */
|
|
4398
4414
|
private _vector;
|
|
4399
4415
|
private _temp;
|
|
4400
4416
|
/** called by nebula on initialize */
|
|
4401
4417
|
get vector(): THREE.Vector3;
|
|
4402
|
-
/** called by nebula */
|
|
4403
4418
|
getPosition(): void;
|
|
4404
4419
|
private _dir;
|
|
4405
4420
|
getDirection(position: any): Vector3;
|
|
@@ -4437,38 +4452,160 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4437
4452
|
update(context: Context): void;
|
|
4438
4453
|
/** nebula implementations: */
|
|
4439
4454
|
private _temp;
|
|
4440
|
-
|
|
4455
|
+
apply(_index: number, pos: Vec3, vel: Vec3, _deltaTime: number, age: number, life: number): void;
|
|
4456
|
+
}
|
|
4457
|
+
export class TrailModule {
|
|
4458
|
+
enabled: boolean;
|
|
4459
|
+
}
|
|
4460
|
+
export class VelocityOverLifetimeModule {
|
|
4461
|
+
enabled: boolean;
|
|
4462
|
+
space: ParticleSystemSimulationSpace;
|
|
4463
|
+
speedModifier: MinMaxCurve;
|
|
4464
|
+
speedModifierMultiplier: number;
|
|
4465
|
+
x: MinMaxCurve;
|
|
4466
|
+
xMultiplier: number;
|
|
4467
|
+
y: MinMaxCurve;
|
|
4468
|
+
yMultiplier: number;
|
|
4469
|
+
z: MinMaxCurve;
|
|
4470
|
+
zMultiplier: number;
|
|
4471
|
+
private _system?;
|
|
4472
|
+
update(system: IParticleSystem): void;
|
|
4473
|
+
private _temp;
|
|
4474
|
+
apply(_index: number, _pos: Vec3, vel: Vec3, _dt: number, age: number, life: number): void;
|
|
4475
|
+
}
|
|
4476
|
+
enum ParticleSystemAnimationTimeMode {
|
|
4477
|
+
Lifetime = 0,
|
|
4478
|
+
Speed = 1,
|
|
4479
|
+
FPS = 2
|
|
4480
|
+
}
|
|
4481
|
+
enum ParticleSystemAnimationRowMode {
|
|
4482
|
+
Custom = 0,
|
|
4483
|
+
Random = 1,
|
|
4484
|
+
MeshIndex = 2
|
|
4485
|
+
}
|
|
4486
|
+
enum ParticleSystemAnimationType {
|
|
4487
|
+
WholeSheet = 0,
|
|
4488
|
+
SingleRow = 1
|
|
4489
|
+
}
|
|
4490
|
+
export class TextureSheetAnimationModule {
|
|
4491
|
+
animation: ParticleSystemAnimationType;
|
|
4492
|
+
enabled: boolean;
|
|
4493
|
+
cycleCount: number;
|
|
4494
|
+
frameOverTime: MinMaxCurve;
|
|
4495
|
+
frameOverTimeMultiplier: number;
|
|
4496
|
+
numTilesX: number;
|
|
4497
|
+
numTilesY: number;
|
|
4498
|
+
startFrame: MinMaxCurve;
|
|
4499
|
+
startFrameMultiplier: number;
|
|
4500
|
+
rowMode: ParticleSystemAnimationRowMode;
|
|
4501
|
+
rowIndex: number;
|
|
4502
|
+
spriteCount: number;
|
|
4503
|
+
timeMode: ParticleSystemAnimationTimeMode;
|
|
4504
|
+
private sampleOnceAtStart;
|
|
4505
|
+
getStartIndex(): number;
|
|
4506
|
+
evaluate(t01: number): number | undefined;
|
|
4507
|
+
private getIndex;
|
|
4508
|
+
}
|
|
4509
|
+
export class RotationOverLifetimeModule {
|
|
4510
|
+
enabled: boolean;
|
|
4511
|
+
separateAxes: boolean;
|
|
4512
|
+
x: MinMaxCurve;
|
|
4513
|
+
xMultiplier: number;
|
|
4514
|
+
y: MinMaxCurve;
|
|
4515
|
+
yMultiplier: number;
|
|
4516
|
+
z: MinMaxCurve;
|
|
4517
|
+
zMultiplier: number;
|
|
4518
|
+
evaluate(t01: number): number;
|
|
4519
|
+
}
|
|
4520
|
+
export class RotationBySpeedModule {
|
|
4521
|
+
enabled: boolean;
|
|
4522
|
+
range: Vec2;
|
|
4523
|
+
separateAxes: boolean;
|
|
4524
|
+
x: MinMaxCurve;
|
|
4525
|
+
xMultiplier: number;
|
|
4526
|
+
y: MinMaxCurve;
|
|
4527
|
+
yMultiplier: number;
|
|
4528
|
+
z: MinMaxCurve;
|
|
4529
|
+
zMultiplier: number;
|
|
4530
|
+
evaluate(_t01: number, speed: number): number;
|
|
4531
|
+
}
|
|
4532
|
+
export class LimitVelocityOverLifetimeModule {
|
|
4533
|
+
enabled: boolean;
|
|
4534
|
+
dampen: number;
|
|
4535
|
+
drag: MinMaxCurve;
|
|
4536
|
+
dragMultiplier: number;
|
|
4537
|
+
limit: MinMaxCurve;
|
|
4538
|
+
limitMultiplier: number;
|
|
4539
|
+
separateAxes: boolean;
|
|
4540
|
+
limitX: MinMaxCurve;
|
|
4541
|
+
limitXMultiplier: number;
|
|
4542
|
+
limitY: MinMaxCurve;
|
|
4543
|
+
limitYMultiplier: number;
|
|
4544
|
+
limitZ: MinMaxCurve;
|
|
4545
|
+
limitZMultiplier: number;
|
|
4546
|
+
multiplyDragByParticleSize: boolean;
|
|
4547
|
+
multiplyDragByParticleVelocity: boolean;
|
|
4548
|
+
space: ParticleSystemSimulationSpace;
|
|
4549
|
+
private _temp;
|
|
4550
|
+
private _temp2;
|
|
4551
|
+
apply(_position: Vec3, baseVelocity: Vector3, currentVelocity: Vector3, _size: number, t01: number, _dt: number, _scale: number): void;
|
|
4441
4552
|
}
|
|
4442
4553
|
}
|
|
4443
4554
|
declare module "engine-components/ParticleSystem" {
|
|
4444
4555
|
import { Behaviour } from "engine-components/Component";
|
|
4445
4556
|
import * as THREE from "three";
|
|
4446
|
-
import { MainModule, EmissionModule, ShapeModule, ColorOverLifetimeModule, SizeOverLifetimeModule, NoiseModule, IParticleSystem, ParticleSystemRenderMode } from "engine-components/ParticleSystemModules";
|
|
4447
|
-
import { Mesh, SpriteMaterial } from "three";
|
|
4557
|
+
import { MainModule, EmissionModule, ShapeModule, ColorOverLifetimeModule, SizeOverLifetimeModule, NoiseModule, IParticleSystem, ParticleSystemRenderMode, TrailModule, VelocityOverLifetimeModule, TextureSheetAnimationModule, RotationOverLifetimeModule, LimitVelocityOverLifetimeModule, RotationBySpeedModule } from "engine-components/ParticleSystemModules";
|
|
4558
|
+
import { Mesh, Object3D, Quaternion, SpriteMaterial, Vector3 } from "three";
|
|
4448
4559
|
export class ParticleSystemRenderer extends Behaviour {
|
|
4449
4560
|
renderMode?: ParticleSystemRenderMode;
|
|
4450
4561
|
particleMaterial?: SpriteMaterial;
|
|
4451
4562
|
particleMesh?: Mesh | string;
|
|
4563
|
+
get transparent(): boolean;
|
|
4452
4564
|
getMesh(): THREE.Mesh<THREE.BufferGeometry, THREE.SpriteMaterial>;
|
|
4453
4565
|
}
|
|
4454
4566
|
export class ParticleSystem extends Behaviour implements IParticleSystem {
|
|
4567
|
+
play(includeChildren?: boolean): void;
|
|
4568
|
+
pause(): void;
|
|
4569
|
+
stop(): void;
|
|
4570
|
+
private _state?;
|
|
4571
|
+
emit(count: number): void;
|
|
4455
4572
|
readonly colorOverLifetime: ColorOverLifetimeModule;
|
|
4456
4573
|
readonly main: MainModule;
|
|
4457
4574
|
readonly emission: EmissionModule;
|
|
4458
4575
|
readonly sizeOverLifetime: SizeOverLifetimeModule;
|
|
4459
4576
|
readonly shape: ShapeModule;
|
|
4460
4577
|
readonly noise: NoiseModule;
|
|
4578
|
+
readonly trails: TrailModule;
|
|
4579
|
+
readonly velocityOverLifetime: VelocityOverLifetimeModule;
|
|
4580
|
+
readonly limitVelocityOverLifetime: LimitVelocityOverLifetimeModule;
|
|
4581
|
+
readonly textureSheetAnimation: TextureSheetAnimationModule;
|
|
4582
|
+
readonly rotationOverLifetime: RotationOverLifetimeModule;
|
|
4583
|
+
readonly rotationBySpeed: RotationBySpeedModule;
|
|
4461
4584
|
get renderer(): ParticleSystemRenderer;
|
|
4462
|
-
get
|
|
4585
|
+
get isPlaying(): any;
|
|
4586
|
+
get currentParticles(): number;
|
|
4463
4587
|
get maxParticles(): number;
|
|
4464
4588
|
get time(): number;
|
|
4465
4589
|
get duration(): number;
|
|
4590
|
+
get deltaTime(): number;
|
|
4591
|
+
get scale(): number;
|
|
4592
|
+
get cameraScale(): number;
|
|
4593
|
+
private _cameraScale;
|
|
4594
|
+
get container(): Object3D;
|
|
4595
|
+
get worldspace(): boolean;
|
|
4596
|
+
private __worldQuaternion;
|
|
4597
|
+
get worldQuaternion(): Quaternion;
|
|
4598
|
+
private _worldQuaternionInverted;
|
|
4599
|
+
get worldQuaternionInverted(): Quaternion;
|
|
4600
|
+
private _worldScale;
|
|
4601
|
+
get worldScale(): Vector3;
|
|
4466
4602
|
private _renderer;
|
|
4467
|
-
private
|
|
4468
|
-
private
|
|
4469
|
-
private
|
|
4470
|
-
private _container
|
|
4603
|
+
private _batchSystem?;
|
|
4604
|
+
private _particleSystem?;
|
|
4605
|
+
private _interface;
|
|
4606
|
+
private _container;
|
|
4471
4607
|
private _time;
|
|
4608
|
+
private _isPlaying;
|
|
4472
4609
|
/** called from deserialization */
|
|
4473
4610
|
private set bursts(value);
|
|
4474
4611
|
private _bursts?;
|
|
@@ -5765,6 +5902,12 @@ declare module "engine-components/codegen/components" {
|
|
|
5765
5902
|
export { SizeOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
5766
5903
|
export { ShapeModule } from "engine-components/ParticleSystemModules";
|
|
5767
5904
|
export { NoiseModule } from "engine-components/ParticleSystemModules";
|
|
5905
|
+
export { TrailModule } from "engine-components/ParticleSystemModules";
|
|
5906
|
+
export { VelocityOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
5907
|
+
export { TextureSheetAnimationModule } from "engine-components/ParticleSystemModules";
|
|
5908
|
+
export { RotationOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
5909
|
+
export { RotationBySpeedModule } from "engine-components/ParticleSystemModules";
|
|
5910
|
+
export { LimitVelocityOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
5768
5911
|
export { PlayerColor } from "engine-components/PlayerColor";
|
|
5769
5912
|
export { ReflectionProbe } from "engine-components/ReflectionProbe";
|
|
5770
5913
|
export { FieldWithDefault } from "engine-components/Renderer";
|