RubiksCubeEffect
Source:
RubiksCubeEffect.h
Cube¶
src/light/effects/RubiksCubeEffect.h:107Public Attributes¶
uint8_t SIZE = 3
Face front
Face back
Face left
Face right
Face top
Face bottom
Public Methods¶
inline void init(uint8_t cubeSize)
inline void rotateFace(Face & face, bool clockwise)
inline void rotateRow(int startRow, int stopRow, bool clockwise)
inline void rotateColumn(int startCol, int stopCol, bool clockwise)
inline void rotateFaceLayer(bool clockwise, int startLayer, int endLayer)
inline void rotateFront(bool clockwise, uint8_t width)
inline void rotateBack(bool clockwise, uint8_t width)
inline void rotateLeft(bool clockwise, uint8_t width)
inline void rotateRight(bool clockwise, uint8_t width)
inline void rotateTop(bool clockwise, uint8_t width)
inline void rotateBottom(bool clockwise, uint8_t width)
inline void drawCube(Buffer & buf, Coord3D dims, lengthType sx, lengthType sy, lengthType sz, const std::array< RGB, 6 > & COLOR_MAP) const
Public Static Attributes¶
constuint8_t MAX_SIZE = 8
Public Types¶
using Face = std::array< std::array< uint8_t, MAX_SIZE >, MAX_SIZE >
Move¶
src/light/effects/RubiksCubeEffect.h:258Public Attributes¶
uint8_t face
uint8_t width
uint8_t direction
RubiksCubeEffect¶
src/light/effects/RubiksCubeEffect.h:24Inherits:
EffectBase
Effect rendering a rotating Rubik's cube on a 3D layout.
Public Attributes¶
uint8_t turnsPerSecond = 2
uint8_t cubeSize = 3
bool randomTurning =
bool usePalette =
Public Methods¶
virtual inline constchar * tags() const override
: Curated emoji tags for the module picker's chip filter — extras beyond the role chip (which the UI derives from role() on its own).
virtual inline Dim dimensions() const override
: Which axes the effect iterates — a claim, not a guarantee about the layer.
virtual inline void defineControls() override
: defineControls MUST be idempotent and pure: only controls_.clear() + controls_.addX().
inline std::array< RGB, 6 > faceColors() const
virtual inline void onControlChanged(constchar *) override
: Cheap per-control reaction, tier 1 of the three-tier control-change split (mirrors MoonLight's onUpdate / requestMappings / onSizeChanged; see architecture.md § Rebuild propagation).
virtual inline void tick() override