Skip to content

RippleXZModifier

Source: RippleXZModifier.h

RippleXZModifier

class RippleXZModifier
src/light/modifiers/RippleXZModifier.h:23

Inherits: ModifierBase

Modifier that collapses one axis of the box to a single plane.

Author: @Troy (WLEDMM Art-Net), https://github.com/ewowi/MoonLight/blob/main/src/MoonLight/Nodes/Modifiers/M_MoonLight.h

Public Attributes

bool shrink = true : Whether the box collapses, and on which axes; y is never collapsed.

bool towardsX = true : Whether the ripple runs along x.

bool towardsZ = false : Whether it runs along z.

Public Methods

virtual inline const char * tags() const override : The catalog tags this modifier carries.

virtual inline Dim dimensions() const override : Folds x or z into a ripple, so it needs the third axis.

virtual inline void defineControls() override : The controls a user sets on the card.

virtual inline void modifyLogicalSize(Coord3D & size) override : Resize the logical box this modifier presents to the effect.

virtual inline bool modifyLogical(Coord3D & pos) const override : Transform one light's logical position, false dropping it from the mapping.

More info

Collapses one axis of the logical box to a single plane, so a lower-dimensional effect drawn on the collapsed axis maps identically onto every slice of the physical box. With the shrink flag on, an enabled axis flattens to a single slice and every coordinate on it folds to zero. A one-dimensional effect running along that axis is therefore painted once and broadcast across it. towardsZ does the same for the Z extent (each XY plane shared across depth). It is the static "collapse an axis" fold: the logical box loses the axis, and every coordinate on that axis folds to 0.

Prior art: MoonLight's RippleXZ modifier (M_MoonLight.h), same shrink/towardsX/ towardsZ axis collapse (modifySize sets the axis to 1, modifyPosition sets the coordinate to 0). MoonLight additionally runs a per-frame buffer shift in tick() that propagates a ripple wave along the collapsed axis by reading and writing the layer's RGB pixels (setRGB/getRGB). That is a render-buffer effect rather than a coordinate transform, so it has no place in the static fold this base class expresses. A modifier emits coordinates only, so the wave is dropped and the axis collapse preserved exactly. Defaults match MoonLight: shrink=true, towardsX=true, towardsZ=false.