particlefx 1.0.0__py3-none-any.whl

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.
particlefx/__init__.py ADDED
@@ -0,0 +1,78 @@
1
+ """
2
+ particlefx — 独立粒子系统库
3
+
4
+ 纯 Python + NumPy 实现的粒子系统,附带多渲染器(pygame / PIL / ModernGL)、
5
+ 效果工厂(30+ 预设配方)、天气与战斗特效系统、Taichi WCSPH 流体后端与
6
+ Compute Shader 全 GPU 模拟。
7
+
8
+ 快速上手:
9
+ from particlefx import ParticleSystem, Emitter, ForceField
10
+ from particlefx.renderers import PygameRenderer
11
+
12
+ ps = ParticleSystem(max_particles=1000)
13
+ ps.add_emitter(Emitter(x=400, y=300, rate=50.0))
14
+ ps.add_force_field(ForceField(field_type='gravity', strength=100.0))
15
+
16
+ 子包:
17
+ particlefx.core 核心粒子类 / NumPy 向量化 / Numba JIT / Taichi SPH / 空间哈希
18
+ particlefx.renderers pygame / PIL / ModernGL / 流体 / 后处理 / GPU 模拟
19
+ particlefx.components 效果工厂与声明式配方(JSON)
20
+ particlefx.systems 烟花 / 天气 / 战斗特效
21
+
22
+ 许可证:MIT
23
+ """
24
+
25
+ from .core import (
26
+ Particle,
27
+ ParticlePool,
28
+ ParticleSystem,
29
+ Emitter,
30
+ EmitterShape,
31
+ ForceField,
32
+ NoiseField,
33
+ ParticleAttractor,
34
+ CollisionBox,
35
+ CollisionBoundary,
36
+ LightSource,
37
+ BlinnPhongParams,
38
+ Renderer,
39
+ SpatialHashGrid,
40
+ create_attractor,
41
+ ParticleSystemNumpy,
42
+ )
43
+
44
+ __version__ = "1.0.0"
45
+
46
+ __all__ = [
47
+ '__version__',
48
+ # 核心
49
+ 'Particle',
50
+ 'ParticlePool',
51
+ 'ParticleSystem',
52
+ 'Emitter',
53
+ 'EmitterShape',
54
+ 'ForceField',
55
+ 'NoiseField',
56
+ 'ParticleAttractor',
57
+ 'CollisionBox',
58
+ 'CollisionBoundary',
59
+ 'LightSource',
60
+ 'BlinnPhongParams',
61
+ 'Renderer',
62
+ 'SpatialHashGrid',
63
+ 'create_attractor',
64
+ 'ParticleSystemNumpy',
65
+ ]
66
+
67
+
68
+ def available_backends():
69
+ """返回当前环境下可用的加速后端名集合。
70
+
71
+ 仅装了 numpy 时返回 ``{'ParticleSystemNumpy'}``;装了 numba / taichi 会
72
+ 追加对应实现。用于运行时判断「这台机器能不能用某条快路径」。
73
+
74
+ Returns:
75
+ set[str]: 后端类名集合
76
+ """
77
+ from .core import AVAILABLE_BACKENDS
78
+ return set(AVAILABLE_BACKENDS)
@@ -0,0 +1,41 @@
1
+ """粒子效果组件包"""
2
+ from .effects import (
3
+ create_explosion,
4
+ create_fire,
5
+ create_rain,
6
+ create_snow,
7
+ create_magic_circle,
8
+ create_fountain,
9
+ create_smoke,
10
+ create_sparkle,
11
+ create_trail,
12
+ get_effect,
13
+ list_effects,
14
+ EFFECT_REGISTRY,
15
+ )
16
+ from .effects_factory import (
17
+ EffectsFactory,
18
+ get_factory,
19
+ create_effect,
20
+ list_all_effects,
21
+ )
22
+
23
+ __all__ = [
24
+ 'create_explosion',
25
+ 'create_fire',
26
+ 'create_rain',
27
+ 'create_snow',
28
+ 'create_magic_circle',
29
+ 'create_fountain',
30
+ 'create_smoke',
31
+ 'create_sparkle',
32
+ 'create_trail',
33
+ 'get_effect',
34
+ 'list_effects',
35
+ 'EFFECT_REGISTRY',
36
+ # 声明式效果工厂(JSON 配方驱动)
37
+ 'EffectsFactory',
38
+ 'get_factory',
39
+ 'create_effect',
40
+ 'list_all_effects',
41
+ ]