@needle-tools/engine 2.42.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 +13 -0
- package/dist/needle-engine.d.ts +130 -40
- 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_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.js +9 -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 +21 -7
- package/lib/engine-components/ParticleSystem.js +519 -246
- 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 +83 -16
- package/lib/engine-components/ParticleSystemModules.js +284 -49
- package/lib/engine-components/ParticleSystemModules.js.map +1 -1
- package/lib/engine-components/codegen/components.d.ts +4 -0
- package/lib/engine-components/codegen/components.js +4 -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 +16 -0
- package/src/engine/engine_element_loading.ts +22 -5
- 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 +7 -1
- package/src/engine-components/AnimatorController.ts +5 -1
- package/src/engine-components/Camera.ts +17 -10
- package/src/engine-components/ParticleSystem.ts +600 -274
- package/src/engine-components/ParticleSystemBehaviours.ts +0 -0
- package/src/engine-components/ParticleSystemModules.ts +263 -51
- package/src/engine-components/codegen/components.ts +4 -0
- package/src/engine-components/js-extensions/RGBAColor.ts +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,19 @@ 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
|
+
|
|
7
20
|
## [2.42.0-pre] - 2022-11-09
|
|
8
21
|
- add ``Graphics.copyTexture``
|
|
9
22
|
- 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;
|
|
@@ -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 {
|
|
@@ -2470,23 +2489,6 @@ declare module "engine/engine_element" {
|
|
|
2470
2489
|
private onBeforeBeginLoading;
|
|
2471
2490
|
}
|
|
2472
2491
|
}
|
|
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
2492
|
declare module "engine-components/AlignmentConstraint" {
|
|
2491
2493
|
import { Behaviour } from "engine-components/Component";
|
|
2492
2494
|
export class AlignmentConstraint extends Behaviour {
|
|
@@ -2602,6 +2604,9 @@ declare module "engine-components/Camera" {
|
|
|
2602
2604
|
orthographic: boolean;
|
|
2603
2605
|
orthographicSize: number;
|
|
2604
2606
|
ARBackgroundAlpha: number;
|
|
2607
|
+
set cullingMask(val: number);
|
|
2608
|
+
get cullingMask(): number;
|
|
2609
|
+
private _cullingMask;
|
|
2605
2610
|
private _nearClipPlane;
|
|
2606
2611
|
private _farClipPlane;
|
|
2607
2612
|
get backgroundColor(): RGBAColor | null;
|
|
@@ -4169,10 +4174,11 @@ declare module "engine-components/OffsetConstraint" {
|
|
|
4169
4174
|
}
|
|
4170
4175
|
declare module "engine-components/ParticleSystemModules" {
|
|
4171
4176
|
import * as THREE from "three";
|
|
4172
|
-
import { Object3D, Vector3 } from "three";
|
|
4177
|
+
import { Object3D, Quaternion, Vector3 } from "three";
|
|
4173
4178
|
import { RGBAColor } from "engine-components/js-extensions/RGBAColor";
|
|
4174
4179
|
import { AnimationCurve } from "engine-components/AnimationCurve";
|
|
4175
4180
|
import { Vec3 } from "engine/engine_types";
|
|
4181
|
+
import { EmitterShape, Particle, ShapeJSON } from "three.quarks";
|
|
4176
4182
|
type Color4 = {
|
|
4177
4183
|
r: number;
|
|
4178
4184
|
g: number;
|
|
@@ -4193,6 +4199,9 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4193
4199
|
get time(): number;
|
|
4194
4200
|
get duration(): number;
|
|
4195
4201
|
readonly main: MainModule;
|
|
4202
|
+
get container(): Object3D;
|
|
4203
|
+
get worldQuaternion(): Quaternion;
|
|
4204
|
+
get worldQuaternionInverted(): Quaternion;
|
|
4196
4205
|
}
|
|
4197
4206
|
export enum ParticleSystemRenderMode {
|
|
4198
4207
|
Billboard = 0,
|
|
@@ -4352,11 +4361,7 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4352
4361
|
/** set from system */
|
|
4353
4362
|
system: IParticleSystem;
|
|
4354
4363
|
get time(): number;
|
|
4355
|
-
|
|
4356
|
-
/** called by nebula */
|
|
4357
|
-
init(): void;
|
|
4358
|
-
/** called by nebula */
|
|
4359
|
-
getValue(deltaTime: number): number;
|
|
4364
|
+
getBurst(): number;
|
|
4360
4365
|
}
|
|
4361
4366
|
export class ColorOverLifetimeModule {
|
|
4362
4367
|
enabled: boolean;
|
|
@@ -4367,16 +4372,21 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4367
4372
|
separateAxes: boolean;
|
|
4368
4373
|
size: MinMaxCurve;
|
|
4369
4374
|
sizeMultiplier: number;
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4375
|
+
x: MinMaxCurve;
|
|
4376
|
+
xMultiplier: number;
|
|
4377
|
+
y: MinMaxCurve;
|
|
4378
|
+
yMultiplier: number;
|
|
4379
|
+
z: MinMaxCurve;
|
|
4380
|
+
zMultiplier: number;
|
|
4376
4381
|
private _time;
|
|
4377
|
-
|
|
4382
|
+
private _temp;
|
|
4383
|
+
evaluate(t01: number, target?: Vec3): Vec3;
|
|
4378
4384
|
}
|
|
4379
|
-
export class ShapeModule {
|
|
4385
|
+
export class ShapeModule implements EmitterShape {
|
|
4386
|
+
get type(): string;
|
|
4387
|
+
initialize(particle: Particle): void;
|
|
4388
|
+
toJSON(): ShapeJSON;
|
|
4389
|
+
clone(): EmitterShape;
|
|
4380
4390
|
shapeType: ParticleSystemShapeType;
|
|
4381
4391
|
enabled: boolean;
|
|
4382
4392
|
alignToDirection: boolean;
|
|
@@ -4399,7 +4409,6 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4399
4409
|
private _temp;
|
|
4400
4410
|
/** called by nebula on initialize */
|
|
4401
4411
|
get vector(): THREE.Vector3;
|
|
4402
|
-
/** called by nebula */
|
|
4403
4412
|
getPosition(): void;
|
|
4404
4413
|
private _dir;
|
|
4405
4414
|
getDirection(position: any): Vector3;
|
|
@@ -4437,18 +4446,82 @@ declare module "engine-components/ParticleSystemModules" {
|
|
|
4437
4446
|
update(context: Context): void;
|
|
4438
4447
|
/** nebula implementations: */
|
|
4439
4448
|
private _temp;
|
|
4440
|
-
|
|
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;
|
|
4441
4513
|
}
|
|
4442
4514
|
}
|
|
4443
4515
|
declare module "engine-components/ParticleSystem" {
|
|
4444
4516
|
import { Behaviour } from "engine-components/Component";
|
|
4445
4517
|
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";
|
|
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";
|
|
4448
4520
|
export class ParticleSystemRenderer extends Behaviour {
|
|
4449
4521
|
renderMode?: ParticleSystemRenderMode;
|
|
4450
4522
|
particleMaterial?: SpriteMaterial;
|
|
4451
4523
|
particleMesh?: Mesh | string;
|
|
4524
|
+
get transparent(): boolean;
|
|
4452
4525
|
getMesh(): THREE.Mesh<THREE.BufferGeometry, THREE.SpriteMaterial>;
|
|
4453
4526
|
}
|
|
4454
4527
|
export class ParticleSystem extends Behaviour implements IParticleSystem {
|
|
@@ -4458,16 +4531,29 @@ declare module "engine-components/ParticleSystem" {
|
|
|
4458
4531
|
readonly sizeOverLifetime: SizeOverLifetimeModule;
|
|
4459
4532
|
readonly shape: ShapeModule;
|
|
4460
4533
|
readonly noise: NoiseModule;
|
|
4534
|
+
readonly trails: TrailModule;
|
|
4535
|
+
readonly velocityOverLifetime: VelocityOverLifetimeModule;
|
|
4536
|
+
readonly textureSheetAnimation: TextureSheetAnimationModule;
|
|
4537
|
+
readonly rotationOverLifetime: RotationOverLifetimeModule;
|
|
4461
4538
|
get renderer(): ParticleSystemRenderer;
|
|
4462
|
-
get currentParticles():
|
|
4539
|
+
get currentParticles(): number;
|
|
4463
4540
|
get maxParticles(): number;
|
|
4464
4541
|
get time(): number;
|
|
4465
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;
|
|
4466
4552
|
private _renderer;
|
|
4467
|
-
private
|
|
4468
|
-
private
|
|
4469
|
-
private
|
|
4470
|
-
private _container
|
|
4553
|
+
private _batchSystem?;
|
|
4554
|
+
private _particleSystem?;
|
|
4555
|
+
private _interface;
|
|
4556
|
+
private _container;
|
|
4471
4557
|
private _time;
|
|
4472
4558
|
/** called from deserialization */
|
|
4473
4559
|
private set bursts(value);
|
|
@@ -5765,6 +5851,10 @@ declare module "engine-components/codegen/components" {
|
|
|
5765
5851
|
export { SizeOverLifetimeModule } from "engine-components/ParticleSystemModules";
|
|
5766
5852
|
export { ShapeModule } from "engine-components/ParticleSystemModules";
|
|
5767
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";
|
|
5768
5858
|
export { PlayerColor } from "engine-components/PlayerColor";
|
|
5769
5859
|
export { ReflectionProbe } from "engine-components/ReflectionProbe";
|
|
5770
5860
|
export { FieldWithDefault } from "engine-components/Renderer";
|