43 String hourMinSec = String(
hour) +
":" + minuteString +
":" + secondString;
44 String date = String(
month) +
"/" + String(
day) +
"/" + String(
year);
50 dayOfWeek =
"SATURDAY";
59 dayOfWeek =
"TUESDAY";
62 dayOfWeek =
"WEDNESDAY";
65 dayOfWeek =
"THURSDAY";
81 return tE.
GetRGB(position, normal, uvw);
A material class for rendering a real-time clock with date and time overlays.
void SetRotation(float rotation)
Sets the rotation of the clock in the rendered scene.
uint8_t month
Current month.
bool hour24
Flag for 24-hour format (true) or 12-hour format (false).
uint8_t year
Current year (last two digits).
uint8_t second
Current second.
SimpleMaterial mat
Default material for the clock.
uint8_t minute
Current minute.
RGBColor GetRGB(const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override
Computes the color at a given position in the clock's material.
void SetSize(Vector2D size)
Sets the size of the clock's rendered area.
Clock(bool hour24)
Constructs a Clock instance with a specified time format.
TextEngine< 3, 12 > tE
Text engine for rendering time and date.
void SetMaterial(Material *material)
Sets the material to be used for rendering the clock.
void SetTime(uint8_t hour, uint8_t minute, uint8_t second)
Sets the current time for the clock.
void SetDate(uint8_t day, uint8_t month, uint8_t year, uint8_t wDay)
Sets the current date for the clock.
uint8_t wDay
Current weekday.
uint8_t hour
Current hour.
void Update()
Updates the clock's time and date.
void SetPosition(Vector2D position)
Sets the position of the clock in the rendered scene.
Abstract base class for rendering materials.
Represents an RGB color and provides methods for manipulation.
void SetPositionOffset(Vector2D positionOffset)
void SetRotationAngle(float rotationAngle)
RGBColor GetRGB(const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override
Pure virtual function to calculate color based on surface parameters.
void SetSize(Vector2D size)
void SetMaterial(Material *material)
void SetBlinkTime(uint16_t blinkTime)
void SetText(uint8_t line, String value, bool centerText=false)
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.