simvx.core.particles¶
CPU-side particle emitter system with sub-emitters, collision, trails, and deterministic seeding.
Module Contents¶
Classes¶
CPU-driven particle emitter with sub-emitters, collision, trails, and deterministic seeding. |
Data¶
API¶
- simvx.core.particles.log¶
‘getLogger(…)’
- simvx.core.particles.__all__¶
[‘ParticleEmitter’, ‘PARTICLE_DTYPE’]
- simvx.core.particles.PARTICLE_DTYPE¶
‘dtype(…)’
- class simvx.core.particles.ParticleEmitter(seed: int | None = None, **kwargs)¶
Bases:
simvx.core.engine.Node3DCPU-driven particle emitter with sub-emitters, collision, trails, and deterministic seeding.
Emits particles that move, scale, and recolour over their lifetime. The graphics backend reads
particle_dataeach frame for billboard rendering. Supports emission shapes (point, sphere, box), collision with a ground plane, particle trails, and sub-emitters that fire on birth or death events.Attributes: amount: Maximum number of live particles (pool size). lifetime: How long each particle lives, in seconds. emission_rate: Particles emitted per second. one_shot: When
True, stops emitting after the pool is filled. emitting: Whether the emitter is actively spawning particles. gravity: Gravity vector applied to all particles each physics step. collision_enabled: Enable ground-plane collision. trail_enabled: Enable per-particle ribbon trails.Example::
emitter = ParticleEmitter(amount=200, lifetime=1.5, emission_rate=80) emitter.gravity = (0.0, -4.9, 0.0) emitter.start_color = (1.0, 0.8, 0.2, 1.0) emitter.end_color = (1.0, 0.0, 0.0, 0.0) scene.add_child(emitter)
Initialization
- amount¶
‘Property(…)’
- lifetime¶
‘Property(…)’
- emission_rate¶
‘Property(…)’
- one_shot¶
‘Property(…)’
- emitting¶
‘Property(…)’
- emission_shape¶
‘Property(…)’
- emission_radius¶
‘Property(…)’
- emission_box¶
‘Property(…)’
- initial_velocity¶
‘Property(…)’
- velocity_spread¶
‘Property(…)’
- gravity¶
‘Property(…)’
- damping¶
‘Property(…)’
- start_scale¶
‘Property(…)’
- end_scale¶
‘Property(…)’
- start_color¶
‘Property(…)’
- end_color¶
‘Property(…)’
- gpu_simulation¶
‘Property(…)’
- collision_enabled¶
‘Property(…)’
- collision_bounce¶
‘Property(…)’
- collision_friction¶
‘Property(…)’
- collision_mode¶
‘Property(…)’
- collision_plane_y¶
‘Property(…)’
- trail_enabled¶
‘Property(…)’
- trail_length¶
‘Property(…)’
- trail_width¶
‘Property(…)’
- particle_born¶
‘Signal(…)’
- particle_died¶
‘Signal(…)’
- property seed: int | None¶
- property emitter_config: dict¶
- ready()¶
- restart()¶
- physics_process(dt: float)¶
- property alive_count: int¶
- property particle_data: numpy.ndarray | None¶
- property trail_data¶
- property trail_vertices: numpy.ndarray | None¶
- property position¶
- property rotation: simvx.core.math.types.Quat¶
- property scale¶
- property rotation_degrees: simvx.core.math.types.Vec3¶
- property global_position: simvx.core.math.types.Vec3¶
- property global_rotation: simvx.core.math.types.Quat¶
- property global_scale: simvx.core.math.types.Vec3¶
- property forward: simvx.core.math.types.Vec3¶
- property right: simvx.core.math.types.Vec3¶
- property up: simvx.core.math.types.Vec3¶
- translate(offset: tuple[float, float, float] | numpy.ndarray)¶
- translate_global(offset: tuple[float, float, float] | numpy.ndarray)¶
- rotate(axis: tuple[float, float, float] | numpy.ndarray, angle: float)¶
- rotate_x(angle: float)¶
- rotate_y(angle: float)¶
- rotate_z(angle: float)¶
- look_at(target: tuple[float, float, float] | numpy.ndarray, up=None)¶
- wrap_bounds(bounds: tuple[float, float, float] | numpy.ndarray, margin: float = 1.0)¶
- script_error_raised¶
‘Signal(…)’
- classmethod __init_subclass__(**kwargs)¶
- property name: str¶
- property process_mode: simvx.core.descriptors.ProcessMode¶
- reset_error() None¶
- add_child(node: simvx.core.node.Node) simvx.core.node.Node¶
- remove_child(node: simvx.core.node.Node)¶
- reparent(new_parent: simvx.core.node.Node)¶
- get_node(path: str) simvx.core.node.Node¶
- find_child(name: str, recursive: bool = False) simvx.core.node.Node | None¶
- find(node_type: type) simvx.core.node.Node | None¶
- property path: str¶
- add_to_group(group: str)¶
- remove_from_group(group: str)¶
- is_in_group(group: str) bool¶
- enter_tree() None¶
- exit_tree() None¶
- process(dt: float) None¶
- draw(renderer) None¶
- input_event(event: simvx.core.events.InputEvent) None¶
- input(event: simvx.core.events.TreeInputEvent) None¶
- unhandled_input(event: simvx.core.events.TreeInputEvent) None¶
- start_coroutine(gen: simvx.core.descriptors.Coroutine) simvx.core.descriptors.CoroutineHandle¶
- stop_coroutine(gen_or_handle)¶
- destroy()¶
- queue_free¶
None
- property tree: simvx.core.scene_tree.SceneTree¶
- get_tree() simvx.core.scene_tree.SceneTree¶
- __getitem__(key: str)¶
- classmethod get_properties() dict[str, simvx.core.descriptors.Property]¶
- get_settings¶
None
- __repr__()¶