![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Generates a spiral pattern with configurable properties. More...
#include <SpiralMaterial.h>
Public Member Functions | |
SpiralMaterial (uint8_t colorCount, RGBColor *rgbColors, float width, float bend) | |
Constructs a SpiralMaterial instance. | |
~SpiralMaterial () | |
Destructor for SpiralMaterial. | |
void | SetPositionOffset (Vector2D positionOffset) |
Sets the position offset for the spiral. | |
void | SetRotationOffset (Vector2D rotationOffset) |
Sets the rotation offset for the spiral. | |
void | SetRotationAngle (float rotationAngle) |
Sets the rotation angle for the spiral. | |
void | SetWidth (float width) |
Sets the width of the spiral arms. | |
void | SetBend (float bend) |
Sets the bending factor of the spiral arms. | |
void | HueShift (float hueDeg) |
Shifts the hue of the spiral colors. | |
RGBColor | GetRGB (const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override |
Retrieves the color for a given position. | |
![]() | |
virtual | ~Material ()=default |
Virtual destructor for proper cleanup in derived classes. | |
Private Attributes | |
RGBColor * | rgbColors |
Array of colors for the spiral. | |
RGBColor * | baseRGBColors |
Backup array for the original colors. | |
uint8_t | colorCount |
Number of colors in the spiral. | |
Vector2D | positionOffset |
Offset for the position of the spiral. | |
Vector2D | rotationOffset |
Point around which the spiral rotates. | |
float | width |
Width of the spiral arms. | |
float | bend |
Degree of bending for the spiral arms. | |
float | rotationAngle |
Angle to rotate the spiral pattern. | |
Additional Inherited Members | |
![]() | |
enum | Method { Base , Add , Subtract , Multiply , Divide , Darken , Lighten , Screen , Overlay , SoftLight , Replace , EfficientMask , Bypass } |
Defines blending methods for combining colors. More... | |
Generates a spiral pattern with configurable properties.
This class provides methods for manipulating the position, rotation, width, and bend of a spiral. The pattern is created using an array of RGB colors.
Definition at line 27 of file SpiralMaterial.h.
SpiralMaterial | ( | uint8_t | colorCount, |
RGBColor * | rgbColors, | ||
float | width, | ||
float | bend | ||
) |
Constructs a SpiralMaterial instance.
colorCount | Number of colors in the spiral. |
rgbColors | Pointer to an array of colors. |
width | Width of the spiral arms. |
bend | Degree of bending for the spiral arms. |
Definition at line 3 of file StripeMaterial.cpp.
References baseRGBColors, bend, colorCount, rgbColors, and width.
~SpiralMaterial | ( | ) |
Destructor for SpiralMaterial.
Definition at line 17 of file StripeMaterial.cpp.
References baseRGBColors, and rgbColors.
|
overridevirtual |
Retrieves the color for a given position.
position | 3D position in the scene. |
normal | Normal vector at the position (not used for this material). |
uvw | Texture coordinates at the position (not used for this material). |
Implements Material.
Definition at line 48 of file StripeMaterial.cpp.
References bend, colorCount, EulerConstants::EulerOrderXYZS, Mathematics::Fract(), Rotation::GetQuaternion(), Vector2D::Magnitude(), Mathematics::MPI, positionOffset, rgbColors, Quaternion::RotateVector(), rotationAngle, width, Vector2D::X, Vector3D::X, Vector2D::Y, and Vector3D::Y.
Referenced by RainbowSpiral::GetRGB().
Shifts the hue of the spiral colors.
hueDeg | The degree to shift the hue. |
Definition at line 42 of file StripeMaterial.cpp.
References baseRGBColors, colorCount, RGBColor::HueShift(), and rgbColors.
Sets the bending factor of the spiral arms.
bend | The degree of bending. |
Definition at line 38 of file StripeMaterial.cpp.
References bend.
Referenced by RainbowSpiral::Update(), WaffleDaProtoAnimation::Update(), and FullScreenAnimation::Update().
Sets the position offset for the spiral.
positionOffset | The offset to apply. |
Definition at line 22 of file StripeMaterial.cpp.
References positionOffset.
Referenced by RainbowSpiral::Update(), WaffleDaProtoAnimation::Update(), and FullScreenAnimation::Update().
Sets the rotation angle for the spiral.
rotationAngle | The angle to rotate the spiral pattern. |
Definition at line 30 of file StripeMaterial.cpp.
References rotationAngle.
Referenced by RainbowSpiral::Update(), WaffleDaProtoAnimation::Update(), and FullScreenAnimation::Update().
Sets the rotation offset for the spiral.
rotationOffset | The point around which to rotate. |
Definition at line 26 of file StripeMaterial.cpp.
References rotationOffset.
Sets the width of the spiral arms.
width | The desired width. |
Definition at line 34 of file StripeMaterial.cpp.
References width.
|
private |
Backup array for the original colors.
Definition at line 30 of file SpiralMaterial.h.
Referenced by HueShift(), SpiralMaterial(), and ~SpiralMaterial().
|
private |
Degree of bending for the spiral arms.
Definition at line 35 of file SpiralMaterial.h.
Referenced by GetRGB(), SetBend(), and SpiralMaterial().
|
private |
Number of colors in the spiral.
Definition at line 31 of file SpiralMaterial.h.
Referenced by GetRGB(), HueShift(), and SpiralMaterial().
|
private |
Offset for the position of the spiral.
Definition at line 32 of file SpiralMaterial.h.
Referenced by GetRGB(), and SetPositionOffset().
|
private |
Array of colors for the spiral.
Definition at line 29 of file SpiralMaterial.h.
Referenced by GetRGB(), HueShift(), SpiralMaterial(), and ~SpiralMaterial().
|
private |
Angle to rotate the spiral pattern.
Definition at line 36 of file SpiralMaterial.h.
Referenced by GetRGB(), and SetRotationAngle().
|
private |
Point around which the spiral rotates.
Definition at line 33 of file SpiralMaterial.h.
Referenced by SetRotationOffset().
|
private |
Width of the spiral arms.
Definition at line 34 of file SpiralMaterial.h.
Referenced by GetRGB(), SetWidth(), and SpiralMaterial().