custom-pixi-particles 5.2.0 → 8.0.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/README.md +119 -82
- package/package.json +5 -5
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -28
- package/dist/index.js.map +0 -1
- package/dist/lib/Model.d.ts +0 -32
- package/dist/lib/Model.js +0 -44
- package/dist/lib/Model.js.map +0 -1
- package/dist/lib/Particle.d.ts +0 -220
- package/dist/lib/Particle.js +0 -172
- package/dist/lib/Particle.js.map +0 -1
- package/dist/lib/ParticlePool.d.ts +0 -37
- package/dist/lib/ParticlePool.js +0 -56
- package/dist/lib/ParticlePool.js.map +0 -1
- package/dist/lib/behaviour/AngularVelocityBehaviour.d.ts +0 -57
- package/dist/lib/behaviour/AngularVelocityBehaviour.js +0 -87
- package/dist/lib/behaviour/AngularVelocityBehaviour.js.map +0 -1
- package/dist/lib/behaviour/Behaviour.d.ts +0 -33
- package/dist/lib/behaviour/Behaviour.js +0 -45
- package/dist/lib/behaviour/Behaviour.js.map +0 -1
- package/dist/lib/behaviour/BehaviourNames.d.ts +0 -11
- package/dist/lib/behaviour/BehaviourNames.js +0 -11
- package/dist/lib/behaviour/BehaviourNames.js.map +0 -1
- package/dist/lib/behaviour/ColorBehaviour.d.ts +0 -45
- package/dist/lib/behaviour/ColorBehaviour.js +0 -77
- package/dist/lib/behaviour/ColorBehaviour.js.map +0 -1
- package/dist/lib/behaviour/EmitDirectionBehaviour.d.ts +0 -46
- package/dist/lib/behaviour/EmitDirectionBehaviour.js +0 -64
- package/dist/lib/behaviour/EmitDirectionBehaviour.js.map +0 -1
- package/dist/lib/behaviour/EmitterBehaviours.d.ts +0 -63
- package/dist/lib/behaviour/EmitterBehaviours.js +0 -105
- package/dist/lib/behaviour/EmitterBehaviours.js.map +0 -1
- package/dist/lib/behaviour/LifeBehaviour.d.ts +0 -67
- package/dist/lib/behaviour/LifeBehaviour.js +0 -85
- package/dist/lib/behaviour/LifeBehaviour.js.map +0 -1
- package/dist/lib/behaviour/PositionBehaviour.d.ts +0 -177
- package/dist/lib/behaviour/PositionBehaviour.js +0 -534
- package/dist/lib/behaviour/PositionBehaviour.js.map +0 -1
- package/dist/lib/behaviour/RotationBehaviour.d.ts +0 -51
- package/dist/lib/behaviour/RotationBehaviour.js +0 -66
- package/dist/lib/behaviour/RotationBehaviour.js.map +0 -1
- package/dist/lib/behaviour/SizeBehaviour.d.ts +0 -31
- package/dist/lib/behaviour/SizeBehaviour.js +0 -71
- package/dist/lib/behaviour/SizeBehaviour.js.map +0 -1
- package/dist/lib/behaviour/TurbulenceBehaviour.d.ts +0 -72
- package/dist/lib/behaviour/TurbulenceBehaviour.js +0 -128
- package/dist/lib/behaviour/TurbulenceBehaviour.js.map +0 -1
- package/dist/lib/behaviour/index.d.ts +0 -12
- package/dist/lib/behaviour/index.js +0 -13
- package/dist/lib/behaviour/index.js.map +0 -1
- package/dist/lib/customPixiParticlesSettingsInterface.d.ts +0 -18
- package/dist/lib/customPixiParticlesSettingsInterface.js +0 -2
- package/dist/lib/customPixiParticlesSettingsInterface.js.map +0 -1
- package/dist/lib/emission/AbstractEmission.d.ts +0 -30
- package/dist/lib/emission/AbstractEmission.js +0 -39
- package/dist/lib/emission/AbstractEmission.js.map +0 -1
- package/dist/lib/emission/EmissionTypes.d.ts +0 -6
- package/dist/lib/emission/EmissionTypes.js +0 -6
- package/dist/lib/emission/EmissionTypes.js.map +0 -1
- package/dist/lib/emission/RandomEmission.d.ts +0 -44
- package/dist/lib/emission/RandomEmission.js +0 -66
- package/dist/lib/emission/RandomEmission.js.map +0 -1
- package/dist/lib/emission/StandardEmission.d.ts +0 -62
- package/dist/lib/emission/StandardEmission.js +0 -87
- package/dist/lib/emission/StandardEmission.js.map +0 -1
- package/dist/lib/emission/UniformEmission.d.ts +0 -56
- package/dist/lib/emission/UniformEmission.js +0 -83
- package/dist/lib/emission/UniformEmission.js.map +0 -1
- package/dist/lib/emission/index.d.ts +0 -6
- package/dist/lib/emission/index.js +0 -7
- package/dist/lib/emission/index.js.map +0 -1
- package/dist/lib/emitter/Duration.d.ts +0 -27
- package/dist/lib/emitter/Duration.js +0 -41
- package/dist/lib/emitter/Duration.js.map +0 -1
- package/dist/lib/emitter/Emitter.d.ts +0 -113
- package/dist/lib/emitter/Emitter.js +0 -201
- package/dist/lib/emitter/Emitter.js.map +0 -1
- package/dist/lib/emitter/index.d.ts +0 -3
- package/dist/lib/emitter/index.js +0 -4
- package/dist/lib/emitter/index.js.map +0 -1
- package/dist/lib/index.d.ts +0 -20
- package/dist/lib/index.js +0 -21
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/parser/BehaviourParser.d.ts +0 -21
- package/dist/lib/parser/BehaviourParser.js +0 -72
- package/dist/lib/parser/BehaviourParser.js.map +0 -1
- package/dist/lib/parser/CompatibilityHelper.d.ts +0 -12
- package/dist/lib/parser/CompatibilityHelper.js +0 -19
- package/dist/lib/parser/CompatibilityHelper.js.map +0 -1
- package/dist/lib/parser/EmitControllerParser.d.ts +0 -27
- package/dist/lib/parser/EmitControllerParser.js +0 -39
- package/dist/lib/parser/EmitControllerParser.js.map +0 -1
- package/dist/lib/parser/EmitterParser.d.ts +0 -67
- package/dist/lib/parser/EmitterParser.js +0 -168
- package/dist/lib/parser/EmitterParser.js.map +0 -1
- package/dist/lib/parser/index.d.ts +0 -5
- package/dist/lib/parser/index.js +0 -6
- package/dist/lib/parser/index.js.map +0 -1
- package/dist/lib/pixi/Renderer.d.ts +0 -116
- package/dist/lib/pixi/Renderer.js +0 -508
- package/dist/lib/pixi/Renderer.js.map +0 -1
- package/dist/lib/util/Color.d.ts +0 -133
- package/dist/lib/util/Color.js +0 -173
- package/dist/lib/util/Color.js.map +0 -1
- package/dist/lib/util/List.d.ts +0 -49
- package/dist/lib/util/List.js +0 -87
- package/dist/lib/util/List.js.map +0 -1
- package/dist/lib/util/MinMax.d.ts +0 -34
- package/dist/lib/util/MinMax.js +0 -46
- package/dist/lib/util/MinMax.js.map +0 -1
- package/dist/lib/util/Point.d.ts +0 -34
- package/dist/lib/util/Point.js +0 -46
- package/dist/lib/util/Point.js.map +0 -1
- package/dist/lib/util/Random.d.ts +0 -24
- package/dist/lib/util/Random.js +0 -30
- package/dist/lib/util/Random.js.map +0 -1
- package/dist/lib/util/ThereBack.d.ts +0 -14
- package/dist/lib/util/ThereBack.js +0 -23
- package/dist/lib/util/ThereBack.js.map +0 -1
- package/dist/lib/util/index.d.ts +0 -5
- package/dist/lib/util/index.js +0 -6
- package/dist/lib/util/index.js.map +0 -1
- package/dist/lib/util/maths.d.ts +0 -10
- package/dist/lib/util/maths.js +0 -13
- package/dist/lib/util/maths.js.map +0 -1
- package/dist/lib/util/turbulencePool.d.ts +0 -4
- package/dist/lib/util/turbulencePool.js +0 -7
- package/dist/lib/util/turbulencePool.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,126 +1,163 @@
|
|
|
1
1
|
# CustomPIXIParticles by [@lukasz-okuniewicz](http://github.com/lukasz-okuniewicz)
|
|
2
2
|
|
|
3
|
-
CustomPIXIParticles is a lightweight
|
|
3
|
+
**CustomPIXIParticles** is a lightweight, high-performance library designed for creating and managing customizable particle effects in **PIXI.js** applications. It offers an intuitive API, flexible configuration options, and seamless compatibility with modern PIXI.js versions, making it an essential tool for developers looking to create stunning visual effects.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
* Easy-to-use API: Create particle emitters with just a few lines of code
|
|
7
|
-
* Flexible configuration: Customize particle behavior, appearance, and animation
|
|
8
|
-
* High performance: Render particles efficiently without impacting application performance
|
|
9
|
-
* Compatible with PIXI.js v7: Works seamlessly with the latest version of PIXI.js
|
|
5
|
+
---
|
|
10
6
|
|
|
11
|
-
###
|
|
7
|
+
### Support My Work
|
|
8
|
+
If you find **CustomPIXIParticles** useful and would like to support my work, you can buy me a coffee. Your contributions help me dedicate more time to improving this library and creating new features for the community. Thank you for your support! ☕💖
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
|---|---|
|
|
15
|
-
| v5.x - v6.x | v4.x |
|
|
16
|
-
| v7.x | v5.x |
|
|
10
|
+
[](https://buymeacoffee.com/lukasz.okuniewicz)
|
|
17
11
|
|
|
18
|
-
|
|
19
|
-
[custom-pixi-particles](http://particles.okuniewicz.eu/)
|
|
12
|
+
---
|
|
20
13
|
|
|
21
|
-
|
|
14
|
+
## ✨ Features
|
|
15
|
+
- **Simple API**: Effortlessly create particle emitters with minimal code.
|
|
16
|
+
- **Highly Configurable**: Adjust particle behavior, appearance, animation, and more.
|
|
17
|
+
- **Performance Optimized**: Handle thousands of particles with minimal performance overhead.
|
|
18
|
+
- **PIXI.js Compatibility**: Fully compatible with **PIXI.js v7**, with legacy support for v5.x and v6.x.
|
|
19
|
+
- **Real-Time Customization**: Dynamically update textures, positions, configurations, and emitters on the fly.
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🎮 Demo
|
|
24
|
+
Try it out here: [CustomPIXIParticles Live Editor](https://okuniewicz.eu/)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 🛠️ Installation
|
|
29
|
+
|
|
30
|
+
Install via npm:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
24
33
|
npm install custom-pixi-particles
|
|
25
34
|
```
|
|
26
35
|
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 🚀 Quick Start
|
|
39
|
+
Import or Require
|
|
29
40
|
```javascript
|
|
30
|
-
|
|
31
|
-
// or
|
|
41
|
+
// ES6 Modules
|
|
32
42
|
import customPixiParticles from 'custom-pixi-particles'
|
|
43
|
+
|
|
44
|
+
// CommonJS
|
|
45
|
+
const customPixiParticles = require('custom-pixi-particles')
|
|
33
46
|
```
|
|
34
47
|
|
|
48
|
+
Create Particle Effects
|
|
35
49
|
```javascript
|
|
36
|
-
// Define
|
|
50
|
+
// Define textures and emitter configuration
|
|
37
51
|
const textures = ['texture1.png', 'texture2.png']
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
//
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
container
|
|
52
|
+
const emitterConfig = {
|
|
53
|
+
// Your configuration object
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Initialize particle emitter
|
|
57
|
+
const particles = customPixiParticles.create({ textures, emitterConfig })
|
|
58
|
+
|
|
59
|
+
// Add emitter to the PIXI container
|
|
60
|
+
container.addChild(particles)
|
|
61
|
+
|
|
62
|
+
// Start the emitter
|
|
63
|
+
particles.play()
|
|
46
64
|
```
|
|
47
65
|
|
|
48
|
-
|
|
49
|
-
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 📖 API Reference
|
|
69
|
+
Initializes a particle emitter.
|
|
50
70
|
```javascript
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
animatedSpriteZeroPad: Number,
|
|
55
|
-
animatedSpriteIndexToStart: Number,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
tickerSpeed: Number,
|
|
71
|
+
const particles = customPixiParticles.create({
|
|
72
|
+
textures: [String], // Array of particle textures
|
|
73
|
+
emitterConfig: Object, // Configuration object for the emitter
|
|
74
|
+
animatedSpriteZeroPad: Number, // Zero-padding for animated sprite names
|
|
75
|
+
animatedSpriteIndexToStart: Number, // Initial frame index for animated sprites
|
|
76
|
+
finishingTextures: [String], // Textures used for particle finishing
|
|
77
|
+
vertices: Boolean, // Use vertex mode for rendering
|
|
78
|
+
position: Boolean, // Allow position-based behavior
|
|
79
|
+
rotation: Boolean, // Allow rotation-based behavior
|
|
80
|
+
uvs: Boolean, // Apply UV mapping
|
|
81
|
+
tint: Boolean, // Apply tint to particles
|
|
82
|
+
maxParticles: Number, // Maximum particles allowed
|
|
83
|
+
maxFPS: Number, // Cap emitter update frequency
|
|
84
|
+
tickerSpeed: Number, // Speed of the PIXI ticker
|
|
66
85
|
})
|
|
67
86
|
```
|
|
68
87
|
|
|
88
|
+
### Event Callbacks
|
|
89
|
+
Triggered when the particle animation completes.
|
|
69
90
|
```javascript
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
//...
|
|
91
|
+
particles.onComplete = () => {
|
|
92
|
+
console.log("Particle animation finished!")
|
|
73
93
|
}
|
|
74
94
|
```
|
|
75
95
|
|
|
96
|
+
### Texture Management
|
|
97
|
+
Updates the particle emitter's textures.
|
|
76
98
|
```javascript
|
|
77
|
-
|
|
78
|
-
const newTextures = ['texture3.png', 'texture4.png']
|
|
79
|
-
// Updates the particle emitter's textures.
|
|
80
|
-
this.particles.setTextures(newTextures)
|
|
99
|
+
particles.setTextures(['texture3.png', 'texture4.png'])
|
|
81
100
|
```
|
|
82
101
|
|
|
102
|
+
### Configuration Updates
|
|
103
|
+
Dynamically update emitter configurations.
|
|
83
104
|
```javascript
|
|
84
|
-
|
|
85
|
-
this.particles.updateConfig({
|
|
86
|
-
// Update emitter configuration properties
|
|
87
|
-
})
|
|
105
|
+
particles.updateConfig({ /* New configuration properties */ })
|
|
88
106
|
```
|
|
89
107
|
|
|
108
|
+
### State Control
|
|
109
|
+
Starts or resumes the emitter.
|
|
90
110
|
```javascript
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
111
|
+
particles.play()
|
|
112
|
+
```
|
|
113
|
+
Toggles the paused state.
|
|
114
|
+
```javascript
|
|
115
|
+
particles.pause(isPaused)
|
|
116
|
+
```
|
|
117
|
+
Terminates the emitter and stops emission.
|
|
118
|
+
```javascript
|
|
119
|
+
particles.stop()
|
|
120
|
+
```
|
|
121
|
+
Halts all emissions immediately.
|
|
122
|
+
```javascript
|
|
123
|
+
particles.stopImmediately()
|
|
124
|
+
```
|
|
125
|
+
Resets the emitter to its initial state.
|
|
126
|
+
```javascript
|
|
127
|
+
particles.resetEmitter()
|
|
128
|
+
```
|
|
96
129
|
|
|
97
|
-
|
|
98
|
-
|
|
130
|
+
### Position Updates
|
|
131
|
+
Dynamically adjust the emitter's position.
|
|
132
|
+
```javascript
|
|
133
|
+
particles.updatePosition({ x: 100, y: 200 })
|
|
134
|
+
```
|
|
99
135
|
|
|
100
|
-
|
|
101
|
-
|
|
136
|
+
### Pool Management
|
|
137
|
+
Clears internal object pools to free memory.
|
|
138
|
+
```javascript
|
|
139
|
+
particles.clearPool()
|
|
140
|
+
```
|
|
102
141
|
|
|
103
|
-
|
|
104
|
-
destroy()
|
|
142
|
+
---
|
|
105
143
|
|
|
106
|
-
|
|
107
|
-
|
|
144
|
+
## 🖥️ Versions Compatibility
|
|
145
|
+
| PixiJS | CustomPIXIParticles |
|
|
146
|
+
|-------------|---------------------|
|
|
147
|
+
| v5.x - v6.x | v4.x |
|
|
148
|
+
| v7.x | v7.x |
|
|
108
149
|
|
|
109
|
-
|
|
110
|
-
resetEmitter()
|
|
150
|
+
---
|
|
111
151
|
|
|
112
|
-
|
|
113
|
-
|
|
152
|
+
## 🛠️ Advanced Editor
|
|
153
|
+
Easily design and fine-tune your particle effects with the CustomPIXIParticles Editor.
|
|
154
|
+
🔗 [CustomPIXIParticles Live Editor](https://okuniewicz.eu/)
|
|
114
155
|
|
|
115
|
-
|
|
116
|
-
updateConfig(config, resetDuration = true)
|
|
156
|
+
---
|
|
117
157
|
|
|
118
|
-
|
|
119
|
-
|
|
158
|
+
## 🤝 Contributing
|
|
159
|
+
Contributions, feature suggestions, and bug reports are welcome! Open an issue or submit a pull request on the [GitHub repository](https://github.com/lukasz-okuniewicz/custom-pixi-particles).
|
|
120
160
|
|
|
121
|
-
|
|
122
|
-
clearPool()
|
|
123
|
-
```
|
|
161
|
+
---
|
|
124
162
|
|
|
125
|
-
|
|
126
|
-
Editor for particles: [custom-pixi-particles-editor](https://github.com/lukasz-okuniewicz/custom-pixi-particles-editor)
|
|
163
|
+
With CustomPIXIParticles, you're not just building animations; you're crafting immersive experiences! 🌟
|
package/package.json
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"@types/file-saver": "^2.0.7",
|
|
9
9
|
"copy-dir": "^1.3.0",
|
|
10
10
|
"file-saver": "^2.0.5",
|
|
11
|
-
"pixi.js": "^
|
|
12
|
-
"prettier": "^3.1.0",
|
|
11
|
+
"pixi.js": "^8.6.4",
|
|
13
12
|
"gsap": "^3.12.5",
|
|
14
|
-
"
|
|
13
|
+
"prettier": "^3.4.2",
|
|
14
|
+
"rimraf": "^6.0.1",
|
|
15
15
|
"ts-node": "^10.9.2",
|
|
16
16
|
"tslint": "^6.1.3",
|
|
17
|
-
"typescript": "^5.
|
|
17
|
+
"typescript": "^5.7.2"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"eventemitter3": "^4.0.7"
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"lint": "tslint 'src/**/*.ts'",
|
|
42
42
|
"lint:fix": "tslint --fix 'src/**/*.ts'"
|
|
43
43
|
},
|
|
44
|
-
"version": "
|
|
44
|
+
"version": "8.0.0"
|
|
45
45
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import Renderer from './lib/pixi/Renderer';
|
|
2
|
-
import { ICustomPixiParticlesSettings } from './lib/customPixiParticlesSettingsInterface';
|
|
3
|
-
/**
|
|
4
|
-
* Constructs a renderer for custom pixi particles
|
|
5
|
-
* @class Renderer
|
|
6
|
-
* @param {ICustomPixiParticlesSettings} settings The settings for the renderer
|
|
7
|
-
*/
|
|
8
|
-
declare const customPixiParticles: {
|
|
9
|
-
create(settings: ICustomPixiParticlesSettings): Renderer;
|
|
10
|
-
};
|
|
11
|
-
export { Renderer, customPixiParticles, ICustomPixiParticlesSettings };
|
package/dist/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import Renderer from './lib/pixi/Renderer';
|
|
2
|
-
/**
|
|
3
|
-
* Constructs a renderer for custom pixi particles
|
|
4
|
-
* @class Renderer
|
|
5
|
-
* @param {ICustomPixiParticlesSettings} settings The settings for the renderer
|
|
6
|
-
*/
|
|
7
|
-
const customPixiParticles = {
|
|
8
|
-
create(settings) {
|
|
9
|
-
const { textures, emitterConfig, animatedSpriteZeroPad = 2, animatedSpriteIndexToStart = 0, finishingTextures = [], vertices = true, position = true, rotation = true, uvs = true, tint = true, maxParticles = 10000, maxFPS = 60, tickerSpeed = 0.02, } = settings;
|
|
10
|
-
return new Renderer({
|
|
11
|
-
textures,
|
|
12
|
-
animatedSpriteZeroPad,
|
|
13
|
-
animatedSpriteIndexToStart,
|
|
14
|
-
emitterConfig,
|
|
15
|
-
finishingTextures,
|
|
16
|
-
vertices,
|
|
17
|
-
position,
|
|
18
|
-
rotation,
|
|
19
|
-
uvs,
|
|
20
|
-
tint,
|
|
21
|
-
maxParticles,
|
|
22
|
-
maxFPS,
|
|
23
|
-
tickerSpeed,
|
|
24
|
-
});
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
export { Renderer, customPixiParticles };
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,qBAAqB,CAAA;AAG1C;;;;GAIG;AACH,MAAM,mBAAmB,GAAG;IAC1B,MAAM,CAAC,QAAsC;QAC3C,MAAM,EACJ,QAAQ,EACR,aAAa,EACb,qBAAqB,GAAG,CAAC,EACzB,0BAA0B,GAAG,CAAC,EAC9B,iBAAiB,GAAG,EAAE,EACtB,QAAQ,GAAG,IAAI,EACf,QAAQ,GAAG,IAAI,EACf,QAAQ,GAAG,IAAI,EACf,GAAG,GAAG,IAAI,EACV,IAAI,GAAG,IAAI,EACX,YAAY,GAAG,KAAK,EACpB,MAAM,GAAG,EAAE,EACX,WAAW,GAAG,IAAI,GACnB,GAAG,QAAQ,CAAA;QACZ,OAAO,IAAI,QAAQ,CAAC;YAClB,QAAQ;YACR,qBAAqB;YACrB,0BAA0B;YAC1B,aAAa;YACb,iBAAiB;YACjB,QAAQ;YACR,QAAQ;YACR,QAAQ;YACR,GAAG;YACH,IAAI;YACJ,YAAY;YACZ,MAAM;YACN,WAAW;SACZ,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAgC,CAAA"}
|
package/dist/lib/Model.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export default class Model {
|
|
2
|
-
/**
|
|
3
|
-
* Boolean value indicating whether warping is enabled
|
|
4
|
-
*/
|
|
5
|
-
warp: boolean;
|
|
6
|
-
/**
|
|
7
|
-
* The Z position of the camera
|
|
8
|
-
*/
|
|
9
|
-
cameraZ: number;
|
|
10
|
-
/**
|
|
11
|
-
* The conversion rate for cameraZ
|
|
12
|
-
*/
|
|
13
|
-
cameraZConverter: number;
|
|
14
|
-
/**
|
|
15
|
-
* The speed of warp
|
|
16
|
-
*/
|
|
17
|
-
warpSpeed: number;
|
|
18
|
-
/**
|
|
19
|
-
* The base speed of warp
|
|
20
|
-
*/
|
|
21
|
-
warpBaseSpeed: number;
|
|
22
|
-
/**
|
|
23
|
-
* Update the model with the behaviour object
|
|
24
|
-
* @param {Object} behaviour - The behaviour object
|
|
25
|
-
*/
|
|
26
|
-
update(behaviour: any): void;
|
|
27
|
-
/**
|
|
28
|
-
* Update the camera position based on the delta time
|
|
29
|
-
* @param {number} deltaTime - The delta time
|
|
30
|
-
*/
|
|
31
|
-
updateCamera(deltaTime: number): void;
|
|
32
|
-
}
|
package/dist/lib/Model.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export default class Model {
|
|
2
|
-
constructor() {
|
|
3
|
-
/**
|
|
4
|
-
* Boolean value indicating whether warping is enabled
|
|
5
|
-
*/
|
|
6
|
-
this.warp = false;
|
|
7
|
-
/**
|
|
8
|
-
* The Z position of the camera
|
|
9
|
-
*/
|
|
10
|
-
this.cameraZ = 0;
|
|
11
|
-
/**
|
|
12
|
-
* The conversion rate for cameraZ
|
|
13
|
-
*/
|
|
14
|
-
this.cameraZConverter = 0;
|
|
15
|
-
/**
|
|
16
|
-
* The speed of warp
|
|
17
|
-
*/
|
|
18
|
-
this.warpSpeed = 0;
|
|
19
|
-
/**
|
|
20
|
-
* The base speed of warp
|
|
21
|
-
*/
|
|
22
|
-
this.warpBaseSpeed = 0;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Update the model with the behaviour object
|
|
26
|
-
* @param {Object} behaviour - The behaviour object
|
|
27
|
-
*/
|
|
28
|
-
update(behaviour) {
|
|
29
|
-
this.warp = behaviour.warp || false;
|
|
30
|
-
this.cameraZConverter = behaviour.cameraZConverter;
|
|
31
|
-
this.warpSpeed = behaviour.warpSpeed;
|
|
32
|
-
this.warpBaseSpeed = behaviour.warpBaseSpeed;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Update the camera position based on the delta time
|
|
36
|
-
* @param {number} deltaTime - The delta time
|
|
37
|
-
*/
|
|
38
|
-
updateCamera(deltaTime) {
|
|
39
|
-
if (!this.warp)
|
|
40
|
-
return;
|
|
41
|
-
this.cameraZ += deltaTime * this.cameraZConverter * this.warpSpeed * this.warpBaseSpeed;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=Model.js.map
|
package/dist/lib/Model.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Model.js","sourceRoot":"","sources":["../../src/lib/Model.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,KAAK;IAA1B;QACE;;WAEG;QACH,SAAI,GAAY,KAAK,CAAA;QAErB;;WAEG;QACH,YAAO,GAAW,CAAC,CAAA;QAEnB;;WAEG;QACH,qBAAgB,GAAW,CAAC,CAAA;QAE5B;;WAEG;QACH,cAAS,GAAW,CAAC,CAAA;QAErB;;WAEG;QACH,kBAAa,GAAW,CAAC,CAAA;IAqB3B,CAAC;IAnBC;;;OAGG;IACH,MAAM,CAAC,SAAc;QACnB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,IAAI,KAAK,CAAA;QACnC,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC,gBAAgB,CAAA;QAClD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAA;QACpC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,aAAa,CAAA;IAC9C,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,SAAiB;QAC5B,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAM;QACtB,IAAI,CAAC,OAAO,IAAI,SAAS,GAAG,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAA;IACzF,CAAC;CACF"}
|
package/dist/lib/Particle.d.ts
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { Sprite } from 'pixi.js-legacy';
|
|
2
|
-
import { Color, Point } from './util';
|
|
3
|
-
import ThereBack from './util/ThereBack';
|
|
4
|
-
/**
|
|
5
|
-
* Represents a particle object used in particle system simulations
|
|
6
|
-
*/
|
|
7
|
-
export default class Particle {
|
|
8
|
-
static _UID: {
|
|
9
|
-
value: number;
|
|
10
|
-
};
|
|
11
|
-
next: Particle | null;
|
|
12
|
-
prev: Particle | null;
|
|
13
|
-
/**
|
|
14
|
-
* Stores the unique ID of the particle
|
|
15
|
-
*/
|
|
16
|
-
uid: number;
|
|
17
|
-
/**
|
|
18
|
-
* Stores the movement of the particle
|
|
19
|
-
*/
|
|
20
|
-
movement: Point;
|
|
21
|
-
/**
|
|
22
|
-
* Stores the acceleration of the particle
|
|
23
|
-
*/
|
|
24
|
-
acceleration: Point;
|
|
25
|
-
/**
|
|
26
|
-
* Stores the velocity of the particle
|
|
27
|
-
*/
|
|
28
|
-
velocity: Point;
|
|
29
|
-
/**
|
|
30
|
-
* Stores the size of the particle
|
|
31
|
-
*/
|
|
32
|
-
size: Point;
|
|
33
|
-
/**
|
|
34
|
-
* Stores the starting size of the particle
|
|
35
|
-
*/
|
|
36
|
-
sizeStart: Point;
|
|
37
|
-
/**
|
|
38
|
-
* Stores the starting warp size of the particle
|
|
39
|
-
*/
|
|
40
|
-
warpSizeStart: Point;
|
|
41
|
-
/**
|
|
42
|
-
* Stores the ending size of the particle
|
|
43
|
-
*/
|
|
44
|
-
sizeEnd: Point;
|
|
45
|
-
/**
|
|
46
|
-
* Stores the x value of the particle for sin wave
|
|
47
|
-
*/
|
|
48
|
-
sinXVal: Point;
|
|
49
|
-
/**
|
|
50
|
-
* Stores the y value of the particle for sin wave
|
|
51
|
-
*/
|
|
52
|
-
sinYVal: Point;
|
|
53
|
-
/**
|
|
54
|
-
* Stores the color of the particle
|
|
55
|
-
*/
|
|
56
|
-
color: Color;
|
|
57
|
-
/**
|
|
58
|
-
* Stores the starting color of the particle
|
|
59
|
-
*/
|
|
60
|
-
colorStart: Color;
|
|
61
|
-
/**
|
|
62
|
-
* Stores the ending color of the particle
|
|
63
|
-
*/
|
|
64
|
-
colorEnd: Color;
|
|
65
|
-
/**
|
|
66
|
-
* Stores the maximum life time of the particle
|
|
67
|
-
*/
|
|
68
|
-
maxLifeTime: number;
|
|
69
|
-
/**
|
|
70
|
-
* Stores the current life time of the particle
|
|
71
|
-
*/
|
|
72
|
-
lifeTime: number;
|
|
73
|
-
/**
|
|
74
|
-
* Stores the current life progress of the particle
|
|
75
|
-
*/
|
|
76
|
-
lifeProgress: number;
|
|
77
|
-
/**
|
|
78
|
-
* Stores the x position of the particle
|
|
79
|
-
*/
|
|
80
|
-
x: number;
|
|
81
|
-
/**
|
|
82
|
-
* Stores the y position of the particle
|
|
83
|
-
*/
|
|
84
|
-
y: number;
|
|
85
|
-
/**
|
|
86
|
-
* Stores the z position of the particle
|
|
87
|
-
*/
|
|
88
|
-
z: number;
|
|
89
|
-
/**
|
|
90
|
-
* Stores the velocity angle of the particle
|
|
91
|
-
*/
|
|
92
|
-
velocityAngle: number;
|
|
93
|
-
/**
|
|
94
|
-
* Stores the radians per second of the particle
|
|
95
|
-
*/
|
|
96
|
-
radiansPerSecond: number;
|
|
97
|
-
/**
|
|
98
|
-
* Stores the radius of the particle
|
|
99
|
-
*/
|
|
100
|
-
radius: number;
|
|
101
|
-
radiusX: number;
|
|
102
|
-
radiusY: number;
|
|
103
|
-
/**
|
|
104
|
-
* Stores the starting radius of the particle
|
|
105
|
-
*/
|
|
106
|
-
radiusStart: number;
|
|
107
|
-
/**
|
|
108
|
-
* Stores the ending radius of the particle
|
|
109
|
-
*/
|
|
110
|
-
radiusEnd: number;
|
|
111
|
-
/**
|
|
112
|
-
* Stores the cosine of the direction of the particle
|
|
113
|
-
*/
|
|
114
|
-
directionCos: number;
|
|
115
|
-
/**
|
|
116
|
-
* Stores the sine of the direction of the particle
|
|
117
|
-
*/
|
|
118
|
-
directionSin: number;
|
|
119
|
-
/**
|
|
120
|
-
* Stores the rotation of the particle
|
|
121
|
-
*/
|
|
122
|
-
rotation: number;
|
|
123
|
-
/**
|
|
124
|
-
* Stores the rotation delta of the particle
|
|
125
|
-
*/
|
|
126
|
-
rotationDelta: number;
|
|
127
|
-
/**
|
|
128
|
-
* Stores the angle of the particle
|
|
129
|
-
*/
|
|
130
|
-
angle: number;
|
|
131
|
-
/**
|
|
132
|
-
* Stores the sprite of the particle
|
|
133
|
-
*/
|
|
134
|
-
sprite: Sprite;
|
|
135
|
-
/**
|
|
136
|
-
* Stores whether the vortices are shown
|
|
137
|
-
*/
|
|
138
|
-
showVortices: boolean;
|
|
139
|
-
/**
|
|
140
|
-
* Stores whether the turbulence is enabled
|
|
141
|
-
*/
|
|
142
|
-
turbulence: boolean;
|
|
143
|
-
/**
|
|
144
|
-
* Stores the finishing texture of the particle
|
|
145
|
-
*/
|
|
146
|
-
finishingTexture: number;
|
|
147
|
-
/**
|
|
148
|
-
* Stores the camera z position of the particle
|
|
149
|
-
*/
|
|
150
|
-
cameraZ: number;
|
|
151
|
-
/**
|
|
152
|
-
* Stores the camera z position converter of the particle
|
|
153
|
-
*/
|
|
154
|
-
cameraZConverter: number;
|
|
155
|
-
/**
|
|
156
|
-
* Stores the warp speed of the particle
|
|
157
|
-
*/
|
|
158
|
-
warpSpeed: number;
|
|
159
|
-
/**
|
|
160
|
-
* Stores the warp base speed of the particle
|
|
161
|
-
*/
|
|
162
|
-
warpBaseSpeed: number;
|
|
163
|
-
/**
|
|
164
|
-
* Stores the warp field of view of the particle
|
|
165
|
-
*/
|
|
166
|
-
warpFov: number;
|
|
167
|
-
/**
|
|
168
|
-
* Stores the warp stretch of the particle
|
|
169
|
-
*/
|
|
170
|
-
warpStretch: number;
|
|
171
|
-
/**
|
|
172
|
-
* Stores the warp distance scale converter of the particle
|
|
173
|
-
*/
|
|
174
|
-
warpDistanceScaleConverter: number;
|
|
175
|
-
sizeDifference: {
|
|
176
|
-
x: number;
|
|
177
|
-
y: number;
|
|
178
|
-
};
|
|
179
|
-
fromAtoB: boolean;
|
|
180
|
-
fromAtoBTwoWays: boolean;
|
|
181
|
-
pointA: Point;
|
|
182
|
-
pointB: Point;
|
|
183
|
-
there: ThereBack;
|
|
184
|
-
back: ThereBack;
|
|
185
|
-
xStart: number;
|
|
186
|
-
yStart: number;
|
|
187
|
-
xTarget: number;
|
|
188
|
-
yTarget: number;
|
|
189
|
-
thereDuration: number;
|
|
190
|
-
backDuration: number;
|
|
191
|
-
progress: number;
|
|
192
|
-
time: number;
|
|
193
|
-
thereAmplitude: number;
|
|
194
|
-
backAmplitude: number;
|
|
195
|
-
direction: number;
|
|
196
|
-
/**
|
|
197
|
-
* Constructs a particle object
|
|
198
|
-
*/
|
|
199
|
-
constructor();
|
|
200
|
-
/**
|
|
201
|
-
* Resets the particle object
|
|
202
|
-
*/
|
|
203
|
-
reset(): void;
|
|
204
|
-
/**
|
|
205
|
-
* Checks if the particle is almost dead
|
|
206
|
-
*
|
|
207
|
-
* @return {boolean} True if the particle is almost dead, otherwise false
|
|
208
|
-
*/
|
|
209
|
-
isAlmostDead(): boolean;
|
|
210
|
-
/**
|
|
211
|
-
* Checks if the particle is dead
|
|
212
|
-
*
|
|
213
|
-
* @return {boolean} True if the particle is dead, otherwise false
|
|
214
|
-
*/
|
|
215
|
-
isDead(): boolean;
|
|
216
|
-
/**
|
|
217
|
-
* Hides the particle
|
|
218
|
-
*/
|
|
219
|
-
hide(): void;
|
|
220
|
-
}
|