4 this->size =
size.Divide(2.0f);
10 for (uint8_t i = 0; i < 128; i++) {
24 this->size =
size.Divide(2.0f);
60 float xDistance2 =
size.X / float(
bins) * (x + 2) -
size.X;
69 if (rPos.
Y < height *
size.Y / 2.0f && rPos.
Y > height *
size.Y / 2.0f -
size.Y * 0.1f) {
A dynamic oscilloscope material for visualizing audio signals.
Abstract base class for rendering materials.
static bool IsClose(float v1, float v2, float epsilon)
Checks if two values are close within a specified epsilon.
static T Map(T value, T inLow, T inMax, T outMin, T outMax)
Maps a value from one range to another.
static float CosineInterpolation(float beg, float fin, float ratio)
Applies a cosine-based interpolation between two values.
MaxFilter< 40 > maxF
Filter for tracking maximum values.
Oscilloscope(Vector2D size, Vector2D offset)
Constructs an Oscilloscope with the specified size and offset.
void SetPosition(Vector2D offset)
Sets the position of the oscilloscope visualization.
float * data
Pointer to the audio sample data.
BouncePhysics * bPhy[128]
Array of BouncePhysics instances for dynamic bouncing behavior.
float hueAngle
Hue angle for color adjustments.
float midPoint
Midpoint for audio data normalization.
RGBColor GetRGB(const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override
Computes the color at a given position in the visualization.
float * GetSampleData()
Retrieves the current sample data.
void SetSize(Vector2D size)
Sets the size of the oscilloscope visualization.
MinFilter< 40 > minF
Filter for tracking minimum values.
~Oscilloscope()
Destroys the Oscilloscope instance.
Vector2D offset
The position offset of the visualization.
float angle
Rotation angle of the visualization.
void Update(float *data)
Updates the oscilloscope visualization based on new audio data.
GradientMaterial< 6 > gM
Gradient material for the rainbow spectrum.
float maxValue
Minimum and maximum values for data scaling.
void SetMaterial(Material *material)
Sets an additional material for visual effects.
void SetRotation(float angle)
Sets the rotation angle of the visualization.
Material * material
Pointer to an additional material for 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 oscilloscope visualization.
Represents an RGB color and provides methods for manipulation.
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.
Vector2D Rotate(const float &angle, const Vector2D &offset) const
Rotates this vector by a specified angle (in degrees or radians) around a given offset.
float X
The X-component of the 2D vector.
float Y
The Y-component of the 2D vector.
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
float X
The X-component of the 3D vector.
float Y
The Y-component of the 3D vector.