simvx.core.rain

Rain3D: a camera-relative GPU rain volume (design RM-E3).

A thin specialisation of :class:GPUParticles3D that fills a volume around the active camera with fast-falling droplets and slants them with the scene wind. It reuses the GPU particle simulation wholesale (there is no new render pass and no new GPU binding): the only rain-specific behaviour is

  1. snapping the emitter to the active camera each frame so the downpour always surrounds the viewer (a camera-relative volume), and

  2. reading the WorldEnvironment wind – the same source that populates the FrameGlobals wind slot the wet-surface shader reads – to slant the fall.

Zero-cost when unused: a scene with no Rain3D emits nothing and touches no new code path. Pair it with wetness_affected materials and a WorldEnvironment whose wetness / rain_intensity / ripple_strength are non-zero to make the ground read as wet under the downpour.

Module Contents

Classes

Rain3D

A camera-following GPU rain emitter.

Data

API

simvx.core.rain.__all__

[‘Rain3D’]

class simvx.core.rain.Rain3D(**kwargs)[source]

Bases: simvx.core.gpu_particles.GPUParticles3D

A camera-following GPU rain emitter.

Example::

rain = scene.add_child(Rain3D(radius=16.0, fall_speed=22.0, amount=8000))

radius/height size the falling volume centred above the camera; fall_speed is the downward launch speed; wind_response scales how much the WorldEnvironment wind slants the drops. All the underlying emitter dials (amount, lifetime, start_colour …) remain available.

Initialization

radius

‘Property(…)’

height

‘Property(…)’

fall_speed

‘Property(…)’

wind_response

‘Property(…)’

follow_camera

‘Property(…)’

on_update(dt: float)[source]
amount

‘Property(…)’

lifetime

‘Property(…)’

emitting

‘Property(…)’

one_shot

‘Property(…)’

speed

‘Property(…)’

speed_variance

‘Property(…)’

direction

‘Property(…)’

spread

‘Property(…)’

spread_pattern

‘Property(…)’

spread_points

‘Property(…)’

gravity

‘Property(…)’

damping

‘Property(…)’

emission_shape

‘Property(…)’

emission_radius

‘Property(…)’

emission_box

‘Property(…)’

start_colour

‘Colour(…)’

end_colour

‘Colour(…)’

start_scale

‘Property(…)’

end_scale

‘Property(…)’

streak

‘Property(…)’

explosiveness

‘Property(…)’

randomness

‘Property(…)’

fixed_fps

‘Property(…)’

preprocess

‘Property(…)’

local_coords

‘Property(…)’

finished

‘Signal(…)’

property emitter_config: dict
restart()
position

‘_SpatialVecProperty(…)’

rotation

‘Property(…)’

scale

‘_SpatialVecProperty(…)’

render_layer

‘Property(…)’

property rotation_degrees: simvx.core.math.types.Vec3
property world_position: simvx.core.math.types.Vec3
property world_rotation: simvx.core.math.types.Quat
property world_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)
face_along(forward: tuple[float, float, float] | numpy.ndarray, up: tuple[float, float, float] | numpy.ndarray | None = None) None
set_render_layer(index: int, enabled: bool = True) None
is_on_render_layer(index: int) bool
wrap_bounds(bounds: tuple[float, float, float] | numpy.ndarray, margin: float = 1.0)
strict_errors: ClassVar[bool]

True

script_error_raised

‘Signal(…)’

dynamic: bool

False

classmethod __init_subclass__(**kwargs)
property name: str
property update_mode: simvx.core.descriptors.UpdateMode
property visible: bool
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
get_node_or_none(path: str) simvx.core.node.Node | None
find(target, *, direct: bool = False)
find_all(target, *, direct: bool = False)
walk(*, include_self: bool = True) collections.abc.Iterator[simvx.core.node.Node]
property path: str
add_to_group(group: str)
remove_from_group(group: str)
is_in_group(group: str) bool
on_ready() None
on_enter_tree() None
on_exit_tree() None
on_fixed_update(dt: float) None
on_draw(renderer) None
on_picked(event: simvx.core.events.InputEvent) None
on_unhandled_input(event: simvx.core.events.TreeInputEvent) None
start_coroutine(gen: simvx.core.descriptors.Coroutine) simvx.core.descriptors.CoroutineHandle
stop_coroutine(gen_or_handle)
queue_redraw() None
property render_dirty: bool
clear_children()
destroy()
call_deferred(method: collections.abc.Callable[..., Any], *args: Any) None
property app
property tree: simvx.core.scene_tree.SceneTree
property physics
property physics_2d
__getitem__(key: str)
classmethod get_properties() dict[str, simvx.core.descriptors.Property]
__repr__()