@neutrinoparticles/js-v1.1-phaser 1.0.0 → 1.1.0
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 -1
- package/README.md +37 -0
- package/dist/Effect.d.ts +11 -1
- package/dist/NeutrinoRenderer.d.ts +8 -0
- package/dist/PerspectiveProjection.d.ts +10 -0
- package/dist/neutrinoparticles.js-v1.1-phaser.cjs.js +202 -57
- package/dist/neutrinoparticles.js-v1.1-phaser.cjs.js.map +1 -1
- package/dist/neutrinoparticles.js-v1.1-phaser.d.ts +37 -1
- package/dist/neutrinoparticles.js-v1.1-phaser.es.js +307 -119
- package/dist/neutrinoparticles.js-v1.1-phaser.es.js.map +1 -1
- package/dist/neutrinoparticles.js-v1.1-phaser.umd.js +202 -57
- package/dist/neutrinoparticles.js-v1.1-phaser.umd.js.map +1 -1
- package/dist/types.d.ts +12 -0
- package/package.json +4 -3
|
@@ -103,13 +103,15 @@ declare module '@neutrinoparticles/js-v1.1-phaser/Effect' {
|
|
|
103
103
|
import { Pause, Vec2, Vec3 } from '@neutrinoparticles/js-v1.1-phaser/types';
|
|
104
104
|
import { GamePlugin } from '@neutrinoparticles/js-v1.1-phaser/GamePlugin';
|
|
105
105
|
import { EffectModel } from '@neutrinoparticles/js-v1.1-phaser/EffectModel';
|
|
106
|
-
import { NeutrinoSystem } from '@neutrinoparticles/js-v1.1-phaser/types';
|
|
106
|
+
import { NeutrinoEmitterProperty, NeutrinoSystem } from '@neutrinoparticles/js-v1.1-phaser/types';
|
|
107
|
+
import { PerspectiveProjection } from '@neutrinoparticles/js-v1.1-phaser/PerspectiveProjection';
|
|
107
108
|
export interface EffectOptions {
|
|
108
109
|
position?: Vec3;
|
|
109
110
|
angle?: number;
|
|
110
111
|
scale?: number;
|
|
111
112
|
pause?: Pause;
|
|
112
113
|
generatorsPaused?: boolean;
|
|
114
|
+
projection?: PerspectiveProjection;
|
|
113
115
|
}
|
|
114
116
|
/**
|
|
115
117
|
* A NeutrinoParticles effect on a Phaser scene (JS v1.1 runtime).
|
|
@@ -135,6 +137,8 @@ declare module '@neutrinoparticles/js-v1.1-phaser/Effect' {
|
|
|
135
137
|
alpha: number;
|
|
136
138
|
depth: number;
|
|
137
139
|
blendMode: number;
|
|
140
|
+
/** Optional v1.0-parity perspective projection (Projection3D). */
|
|
141
|
+
projection?: PerspectiveProjection;
|
|
138
142
|
constructor(effectModel: EffectModel, scene: Phaser.Scene, options?: EffectOptions);
|
|
139
143
|
get ready(): boolean;
|
|
140
144
|
preUpdate(_time: number, ms: number): void;
|
|
@@ -156,6 +160,12 @@ declare module '@neutrinoparticles/js-v1.1-phaser/Effect' {
|
|
|
156
160
|
unpauseGenerators(): void;
|
|
157
161
|
get generatorsPaused(): boolean;
|
|
158
162
|
setPropertyInAllEmitters(name: string, value: Vec3 | Vec2 | number): void;
|
|
163
|
+
setPropertyInEmitter(emitterName: string, name: string, value: Vec3 | Vec2 | number): void;
|
|
164
|
+
getEmitterPropertyValue(name: string): number | number[] | undefined;
|
|
165
|
+
getEmitterPropertyValue(emitterName: string, name: string): number | number[] | undefined;
|
|
166
|
+
hasEmitterProperty(name: string): boolean;
|
|
167
|
+
hasEmitterProperty(emitterName: string, name: string): boolean;
|
|
168
|
+
getEmitterProperties(): NeutrinoEmitterProperty[];
|
|
159
169
|
getNumParticles(): number;
|
|
160
170
|
setScrollFactor(x: number, y?: number): this;
|
|
161
171
|
setAlpha(topLeft?: number, _topRight?: number, _bottomLeft?: number, _bottomRight?: number): this;
|
|
@@ -237,6 +247,18 @@ declare module '@neutrinoparticles/js-v1.1-phaser/types' {
|
|
|
237
247
|
areGeneratorsInAllEmittersPaused(): boolean;
|
|
238
248
|
getNumParticles(): number;
|
|
239
249
|
setPropertyInAllEmitters(name: string, value: number | Vec2 | Vec3): void;
|
|
250
|
+
setPropertyInEmitter(emitterName: string, name: string, value: number | Vec2 | Vec3): void;
|
|
251
|
+
getEmitterPropertyValue(name: string): number | number[] | undefined;
|
|
252
|
+
getEmitterPropertyValue(emitterName: string, name: string): number | number[] | undefined;
|
|
253
|
+
hasEmitterProperty(name: string): boolean;
|
|
254
|
+
hasEmitterProperty(emitterName: string, name: string): boolean;
|
|
255
|
+
getEmitterProperties(): NeutrinoEmitterProperty[];
|
|
256
|
+
}
|
|
257
|
+
export interface NeutrinoEmitterProperty {
|
|
258
|
+
emitterName: string;
|
|
259
|
+
name: string;
|
|
260
|
+
arity: number;
|
|
261
|
+
value: number | number[];
|
|
240
262
|
}
|
|
241
263
|
export interface NeutrinoRuntimeContext {
|
|
242
264
|
initializeNoise(path: string, success: () => void, fail: () => void): void;
|
|
@@ -315,6 +337,7 @@ declare module '@neutrinoparticles/js-v1.1-phaser/NeutrinoRenderer' {
|
|
|
315
337
|
import { DataTextureManager } from "@neutrinoparticles/js-v1.1-phaser/DataTextureManager";
|
|
316
338
|
import { DataTextureManagerGL1 } from "@neutrinoparticles/js-v1.1-phaser/gl1/DataTextureManagerGL1";
|
|
317
339
|
import { NeutrinoSubRect } from "@neutrinoparticles/js-v1.1-phaser/types";
|
|
340
|
+
import { PerspectiveProjection } from "@neutrinoparticles/js-v1.1-phaser/PerspectiveProjection";
|
|
318
341
|
export interface RenderParams {
|
|
319
342
|
/** Effect world transform (2x3) already including world scale. */
|
|
320
343
|
model: {
|
|
@@ -334,6 +357,9 @@ declare module '@neutrinoparticles/js-v1.1-phaser/NeutrinoRenderer' {
|
|
|
334
357
|
zoom: number;
|
|
335
358
|
/** Host scene-graph world alpha, multiplied into each particle's alpha. */
|
|
336
359
|
worldAlpha: number;
|
|
360
|
+
/** Optional v1.0-parity perspective projection (Projection3D); when set,
|
|
361
|
+
* uViewProjMatrix = ortho * perspective (both in screen space). */
|
|
362
|
+
projection?: PerspectiveProjection;
|
|
337
363
|
/** Per-particle GL textures (one per render-style texture index). */
|
|
338
364
|
glTextures: (WebGLTexture | null)[];
|
|
339
365
|
remaps: Array<NeutrinoSubRect | null>;
|
|
@@ -445,6 +471,16 @@ declare module '@neutrinoparticles/js-v1.1-phaser/PerspectiveProjection' {
|
|
|
445
471
|
*/
|
|
446
472
|
transformSize(outSize: Vec2, pos: Vec3, size: Vec2): void;
|
|
447
473
|
_getScale(pos: Vec3): number;
|
|
474
|
+
/**
|
|
475
|
+
* Writes the projection as a 4x4 column-major matrix operating in screen
|
|
476
|
+
* space, for the GPU render path. Homogeneous equivalent of
|
|
477
|
+
* transformPosition(): clip.xy = p.xy - center * (p.z / z),
|
|
478
|
+
* clip.w = 1 - p.z / z; the z row is zeroed (no depth on this path).
|
|
479
|
+
* setScreenFrame() must have been called before.
|
|
480
|
+
*
|
|
481
|
+
* @param {Float32Array} out 16-element column-major output matrix.
|
|
482
|
+
*/
|
|
483
|
+
writeMatrix(out: Float32Array): void;
|
|
448
484
|
}
|
|
449
485
|
}
|
|
450
486
|
|