@newkrok/three-particles 2.3.0 → 2.6.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/dist/bundle-report.json +1 -1
- package/dist/js/effects/three-particles/three-particles-modifiers.js +1 -2
- package/dist/js/effects/three-particles/three-particles.d.ts +1 -73
- package/dist/js/effects/three-particles/three-particles.d.ts.map +1 -1
- package/dist/js/effects/three-particles/three-particles.js +308 -173
- package/dist/js/effects/three-particles/types.d.ts +67 -0
- package/dist/js/effects/three-particles/types.d.ts.map +1 -1
- package/dist/three-particles.min.js +1 -1
- package/llms-full.txt +523 -0
- package/llms.txt +121 -0
- package/package.json +33 -23
package/dist/bundle-report.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"label":"three-particles.min.js","isAsset":true,"statSize":
|
|
1
|
+
[{"label":"three-particles.min.js","isAsset":true,"statSize":487030,"parsedSize":124623,"gzipSize":38322,"groups":[{"label":"dist","path":"./dist","statSize":477165,"groups":[{"id":706,"label":"index.js + 26 modules (concatenated)","path":"./dist/index.js + 26 modules (concatenated)","statSize":477165,"parsedSize":124623,"gzipSize":38322,"concatenated":true,"groups":[{"label":"dist","path":"./dist/index.js + 26 modules (concatenated)/dist","statSize":73787,"groups":[{"id":null,"label":"index.js","path":"./dist/index.js + 26 modules (concatenated)/dist/index.js","statSize":426,"parsedSize":111,"gzipSize":34,"inaccurateSizes":true},{"label":"js/effects/three-particles","path":"./dist/index.js + 26 modules (concatenated)/dist/js/effects/three-particles","statSize":73361,"groups":[{"id":null,"label":"three-particles-bezier.js","path":"./dist/index.js + 26 modules (concatenated)/dist/js/effects/three-particles/three-particles-bezier.js","statSize":2350,"parsedSize":613,"gzipSize":188,"inaccurateSizes":true},{"id":null,"label":"three-particles-curves.js","path":"./dist/index.js + 26 modules (concatenated)/dist/js/effects/three-particles/three-particles-curves.js","statSize":3617,"parsedSize":944,"gzipSize":290,"inaccurateSizes":true},{"id":null,"label":"three-particles-modifiers.js","path":"./dist/index.js + 26 modules (concatenated)/dist/js/effects/three-particles/three-particles-modifiers.js","statSize":8612,"parsedSize":2249,"gzipSize":691,"inaccurateSizes":true},{"id":null,"label":"three-particles-utils.js","path":"./dist/index.js + 26 modules (concatenated)/dist/js/effects/three-particles/three-particles-utils.js","statSize":14332,"parsedSize":3743,"gzipSize":1151,"inaccurateSizes":true},{"id":null,"label":"three-particles.js","path":"./dist/index.js + 26 modules (concatenated)/dist/js/effects/three-particles/three-particles.js","statSize":41460,"parsedSize":10828,"gzipSize":3329,"inaccurateSizes":true},{"label":"shaders","path":"./dist/index.js + 26 modules (concatenated)/dist/js/effects/three-particles/shaders","statSize":2990,"groups":[{"id":null,"label":"particle-system-fragment-shader.glsl.js","path":"./dist/index.js + 26 modules (concatenated)/dist/js/effects/three-particles/shaders/particle-system-fragment-shader.glsl.js","statSize":2039,"parsedSize":532,"gzipSize":163,"inaccurateSizes":true},{"id":null,"label":"particle-system-vertex-shader.glsl.js","path":"./dist/index.js + 26 modules (concatenated)/dist/js/effects/three-particles/shaders/particle-system-vertex-shader.glsl.js","statSize":951,"parsedSize":248,"gzipSize":76,"inaccurateSizes":true}],"parsedSize":780,"gzipSize":240,"inaccurateSizes":true}],"parsedSize":19159,"gzipSize":5891,"inaccurateSizes":true}],"parsedSize":19271,"gzipSize":5925,"inaccurateSizes":true},{"label":"node_modules","path":"./dist/index.js + 26 modules (concatenated)/node_modules","statSize":403336,"groups":[{"label":"@newkrok/three-utils/dist","path":"./dist/index.js + 26 modules (concatenated)/node_modules/@newkrok/three-utils/dist","statSize":25076,"groups":[{"id":null,"label":"index.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/@newkrok/three-utils/dist/index.js","statSize":411,"parsedSize":107,"gzipSize":33,"inaccurateSizes":true},{"id":null,"label":"callback-utils.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/@newkrok/three-utils/dist/callback-utils.js","statSize":1408,"parsedSize":367,"gzipSize":113,"inaccurateSizes":true},{"id":null,"label":"object-utils.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/@newkrok/three-utils/dist/object-utils.js","statSize":2889,"parsedSize":754,"gzipSize":232,"inaccurateSizes":true},{"id":null,"label":"time-utils.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/@newkrok/three-utils/dist/time-utils.js","statSize":1037,"parsedSize":270,"gzipSize":83,"inaccurateSizes":true},{"label":"assets","path":"./dist/index.js + 26 modules (concatenated)/node_modules/@newkrok/three-utils/dist/assets","statSize":15614,"groups":[{"id":null,"label":"index.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/@newkrok/three-utils/dist/assets/index.js","statSize":44,"parsedSize":11,"gzipSize":3,"inaccurateSizes":true},{"id":null,"label":"assets.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/@newkrok/three-utils/dist/assets/assets.js","statSize":9027,"parsedSize":2357,"gzipSize":724,"inaccurateSizes":true},{"id":null,"label":"loaders.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/@newkrok/three-utils/dist/assets/loaders.js","statSize":6543,"parsedSize":1708,"gzipSize":525,"inaccurateSizes":true}],"parsedSize":4077,"gzipSize":1253,"inaccurateSizes":true},{"label":"audio","path":"./dist/index.js + 26 modules (concatenated)/node_modules/@newkrok/three-utils/dist/audio","statSize":3717,"groups":[{"id":null,"label":"index.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/@newkrok/three-utils/dist/audio/index.js","statSize":42,"parsedSize":10,"gzipSize":3,"inaccurateSizes":true},{"id":null,"label":"audio.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/@newkrok/three-utils/dist/audio/audio.js","statSize":3675,"parsedSize":959,"gzipSize":295,"inaccurateSizes":true}],"parsedSize":970,"gzipSize":298,"inaccurateSizes":true}],"parsedSize":6549,"gzipSize":2013,"inaccurateSizes":true},{"label":"three/examples/jsm","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm","statSize":365339,"groups":[{"label":"misc","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/misc","statSize":1617,"groups":[{"id":null,"label":"Gyroscope.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/misc/Gyroscope.js","statSize":1617,"parsedSize":422,"gzipSize":129,"inaccurateSizes":true}],"parsedSize":422,"gzipSize":129,"inaccurateSizes":true},{"label":"helpers","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/helpers","statSize":4384,"groups":[{"id":null,"label":"PositionalAudioHelper.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/helpers/PositionalAudioHelper.js","statSize":4384,"parsedSize":1144,"gzipSize":352,"inaccurateSizes":true}],"parsedSize":1144,"gzipSize":352,"inaccurateSizes":true},{"label":"loaders","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/loaders","statSize":219725,"groups":[{"id":null,"label":"FBXLoader.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/loaders/FBXLoader.js","statSize":104842,"parsedSize":27381,"gzipSize":8420,"inaccurateSizes":true},{"id":null,"label":"GLTFLoader.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/loaders/GLTFLoader.js","statSize":114883,"parsedSize":30004,"gzipSize":9226,"inaccurateSizes":true}],"parsedSize":57386,"gzipSize":17646,"inaccurateSizes":true},{"label":"libs","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/libs","statSize":89384,"groups":[{"id":null,"label":"fflate.module.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/libs/fflate.module.js","statSize":89384,"parsedSize":23344,"gzipSize":7178,"inaccurateSizes":true}],"parsedSize":23344,"gzipSize":7178,"inaccurateSizes":true},{"label":"curves","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/curves","statSize":14690,"groups":[{"id":null,"label":"NURBSCurve.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/curves/NURBSCurve.js","statSize":3888,"parsedSize":1015,"gzipSize":312,"inaccurateSizes":true},{"id":null,"label":"NURBSUtils.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/curves/NURBSUtils.js","statSize":10802,"parsedSize":2821,"gzipSize":867,"inaccurateSizes":true}],"parsedSize":3836,"gzipSize":1179,"inaccurateSizes":true},{"label":"utils","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/utils","statSize":35539,"groups":[{"id":null,"label":"BufferGeometryUtils.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three/examples/jsm/utils/BufferGeometryUtils.js","statSize":35539,"parsedSize":9281,"gzipSize":2854,"inaccurateSizes":true}],"parsedSize":9281,"gzipSize":2854,"inaccurateSizes":true}],"parsedSize":95416,"gzipSize":29341,"inaccurateSizes":true},{"label":"three-noise/build","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three-noise/build","statSize":12921,"groups":[{"id":null,"label":"three-noise.module.js","path":"./dist/index.js + 26 modules (concatenated)/node_modules/three-noise/build/three-noise.module.js","statSize":12921,"parsedSize":3374,"gzipSize":1037,"inaccurateSizes":true}],"parsedSize":3374,"gzipSize":1037,"inaccurateSizes":true}],"parsedSize":105340,"gzipSize":32392,"inaccurateSizes":true}]}],"parsedSize":124623,"gzipSize":38322},{"label":"node_modules/easing-functions","path":"./node_modules/easing-functions","statSize":9865,"groups":[{"id":300,"label":"index.js","path":"./node_modules/easing-functions/index.js","statSize":9865}],"parsedSize":0,"gzipSize":0}],"isInitialByEntrypoint":{"main":true}}]
|
|
@@ -137,12 +137,11 @@ export const applyModifiers = ({ delta, generalData, normalizedConfig, attribute
|
|
|
137
137
|
attributes.rotation.needsUpdate = true;
|
|
138
138
|
}
|
|
139
139
|
if (noise.isActive) {
|
|
140
|
-
const { sampler, strength, offsets, positionAmount, rotationAmount, sizeAmount, } = noise;
|
|
140
|
+
const { sampler, strength, noisePower, offsets, positionAmount, rotationAmount, sizeAmount, } = noise;
|
|
141
141
|
let noiseOnPosition;
|
|
142
142
|
const noisePosition = (particleLifetimePercentage + (offsets ? offsets[particleIndex] : 0)) *
|
|
143
143
|
10 *
|
|
144
144
|
strength;
|
|
145
|
-
const noisePower = 0.15 * strength;
|
|
146
145
|
noiseInput.set(noisePosition, 0, 0);
|
|
147
146
|
noiseOnPosition = sampler.get3(noiseInput);
|
|
148
147
|
positionArr[positionIndex] += noiseOnPosition * noisePower * positionAmount;
|
|
@@ -103,77 +103,5 @@ export declare const getDefaultParticleSystemConfig: () => any;
|
|
|
103
103
|
* @see {@link ParticleSystemConfig} - Complete configuration options
|
|
104
104
|
*/
|
|
105
105
|
export declare const createParticleSystem: (config?: ParticleSystemConfig, externalNow?: number) => ParticleSystem;
|
|
106
|
-
|
|
107
|
-
* Updates all active particle systems created with {@link createParticleSystem}.
|
|
108
|
-
*
|
|
109
|
-
* This function must be called once per frame in your animation loop to animate all particles.
|
|
110
|
-
* It handles particle emission, movement, lifetime tracking, modifier application, and cleanup
|
|
111
|
-
* of expired particle systems.
|
|
112
|
-
*
|
|
113
|
-
* @param cycleData - Object containing timing information for the current frame:
|
|
114
|
-
* - `now`: Current timestamp in milliseconds (typically from `performance.now()` or `Date.now()`)
|
|
115
|
-
* - `delta`: Time elapsed since the last frame in seconds
|
|
116
|
-
* - `elapsed`: Total time elapsed since the animation started in seconds
|
|
117
|
-
*
|
|
118
|
-
* @example
|
|
119
|
-
* ```typescript
|
|
120
|
-
* import { createParticleSystem, updateParticleSystems } from '@newkrok/three-particles';
|
|
121
|
-
*
|
|
122
|
-
* const { instance } = createParticleSystem({
|
|
123
|
-
* // your config
|
|
124
|
-
* });
|
|
125
|
-
* scene.add(instance);
|
|
126
|
-
*
|
|
127
|
-
* // Animation loop
|
|
128
|
-
* let lastTime = 0;
|
|
129
|
-
* let elapsedTime = 0;
|
|
130
|
-
*
|
|
131
|
-
* function animate(currentTime) {
|
|
132
|
-
* requestAnimationFrame(animate);
|
|
133
|
-
*
|
|
134
|
-
* const delta = (currentTime - lastTime) / 1000; // Convert to seconds
|
|
135
|
-
* elapsedTime += delta;
|
|
136
|
-
* lastTime = currentTime;
|
|
137
|
-
*
|
|
138
|
-
* // Update all particle systems
|
|
139
|
-
* updateParticleSystems({
|
|
140
|
-
* now: currentTime,
|
|
141
|
-
* delta: delta,
|
|
142
|
-
* elapsed: elapsedTime
|
|
143
|
-
* });
|
|
144
|
-
*
|
|
145
|
-
* renderer.render(scene, camera);
|
|
146
|
-
* }
|
|
147
|
-
*
|
|
148
|
-
* animate(0);
|
|
149
|
-
* ```
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* ```typescript
|
|
153
|
-
* // Using Three.js Clock for timing
|
|
154
|
-
* import * as THREE from 'three';
|
|
155
|
-
* import { updateParticleSystems } from '@newkrok/three-particles';
|
|
156
|
-
*
|
|
157
|
-
* const clock = new THREE.Clock();
|
|
158
|
-
*
|
|
159
|
-
* function animate() {
|
|
160
|
-
* requestAnimationFrame(animate);
|
|
161
|
-
*
|
|
162
|
-
* const delta = clock.getDelta();
|
|
163
|
-
* const elapsed = clock.getElapsedTime();
|
|
164
|
-
*
|
|
165
|
-
* updateParticleSystems({
|
|
166
|
-
* now: performance.now(),
|
|
167
|
-
* delta: delta,
|
|
168
|
-
* elapsed: elapsed
|
|
169
|
-
* });
|
|
170
|
-
*
|
|
171
|
-
* renderer.render(scene, camera);
|
|
172
|
-
* }
|
|
173
|
-
* ```
|
|
174
|
-
*
|
|
175
|
-
* @see {@link createParticleSystem} - Creates particle systems to be updated
|
|
176
|
-
* @see {@link CycleData} - Timing data structure
|
|
177
|
-
*/
|
|
178
|
-
export declare const updateParticleSystems: ({ now, delta, elapsed }: CycleData) => void;
|
|
106
|
+
export declare const updateParticleSystems: (cycleData: CycleData) => void;
|
|
179
107
|
//# sourceMappingURL=three-particles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"three-particles.d.ts","sourceRoot":"","sources":["../../../../src/js/effects/three-particles/three-particles.ts"],"names":[],"mappings":"AA2BA,OAAO,EAEL,SAAS,EAIT,cAAc,EACd,oBAAoB,EAKrB,MAAM,YAAY,CAAC;AAEpB,cAAc,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"three-particles.d.ts","sourceRoot":"","sources":["../../../../src/js/effects/three-particles/three-particles.ts"],"names":[],"mappings":"AA2BA,OAAO,EAEL,SAAS,EAIT,cAAc,EACd,oBAAoB,EAKrB,MAAM,YAAY,CAAC;AAEpB,cAAc,YAAY,CAAC;AAkB3B;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,8BAA8B,WACiB,CAAC;AAyQ7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,eAAO,MAAM,oBAAoB,GAC/B,SAAQ,oBAAqD,EAC7D,cAAc,MAAM,KACnB,cAqoBF,CAAC;AA0WF,eAAO,MAAM,qBAAqB,GAAI,WAAW,SAAS,SAIzD,CAAC"}
|