15#include "../Material.h"
16#include "../Static/GradientMaterial.h"
17#include "../../../Physics/Utils/BouncePhysics.h"
18#include "../../../Utils/Math/Mathematics.h"
43 RGBColor rainbowSpectrum[6] = {
RGBColor(255, 0, 0),
RGBColor(255, 255, 0),
RGBColor(0, 255, 0),
RGBColor(0, 255, 255),
RGBColor(0, 0, 255),
RGBColor(255, 0, 255)};
118 void Update(
float* readData);
A material class for creating an audio-reactive gradient effect.
void SetRadius(float radius)
Sets the radius for circular gradient patterns.
RGBColor rainbowSpectrum[6]
Predefined rainbow colors.
void SetPosition(Vector2D offset)
Sets the position of the gradient.
float radius
Radius for circular gradient patterns.
float bounceData[128]
Processed bounce data for audio reactivity.
float * data
Pointer to the audio data array.
BouncePhysics * bPhy[128]
Array of BouncePhysics instances for handling dynamic bouncing.
float hueAngle
Hue angle for color adjustments.
bool bounce
Flag indicating if bouncing effects are enabled.
float * GetFourierData()
Retrieves the Fourier-transformed audio data.
void Update(float *readData)
Updates the gradient based on new audio data.
RGBColor GetRGB(const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override
Retrieves the color of the gradient at a specific position.
~AudioReactiveGradient()
Destroys the AudioReactiveGradient instance.
void SetSize(Vector2D size)
Sets the size of the gradient.
Vector2D offset
The offset of the gradient from the origin.
float angle
Rotation angle of the gradient.
bool circular
Flag indicating if circular patterns are enabled.
GradientMaterial< 6 > gM
Gradient material for the rainbow spectrum.
uint8_t colors
Number of colors in the gradient.
void SetMaterial(Material *material)
Sets a secondary material for additional effects.
void SetRotation(float angle)
Sets the rotation angle of the gradient.
Material * material
Pointer to a secondary material for additional effects.
uint8_t bins
Number of bins for audio data processing.
void SetHueAngle(float hueAngle)
Sets the hue angle for color adjustments.
Vector2D size
The size of the gradient area.
Simulates bouncing physics with gravity and velocity damping.
Creates a customizable gradient material for rendering.
Abstract base class for rendering materials.
Represents an RGB color and provides methods for manipulation.
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.