ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
StripeMaterial Class Reference

Generates striped patterns with configurable properties. More...

#include <StripeMaterial.h>

Inheritance diagram for StripeMaterial:
Collaboration diagram for StripeMaterial:

Public Member Functions

 StripeMaterial (uint8_t colorCount, RGBColor *rgbColors, float stripeWidth, float wavePeriod, float waveAmplitude)
 Constructs a StripeMaterial with given properties.
 
void SetPositionOffset (Vector2D positionOffset)
 Sets the position offset for the pattern.
 
void SetRotationOffset (Vector2D rotationOffset)
 Sets the rotation offset (center point) for the pattern.
 
void SetRotationAngle (float rotationAngle)
 Sets the rotation angle for the pattern.
 
void SetStripeWidth (float stripeWidth)
 Sets the stripe width.
 
void SetWavePeriod (float wavePeriod)
 Sets the wave period for the sinusoidal effect.
 
void SetWaveAmplitude (float waveAmplitude)
 Sets the wave amplitude for the sinusoidal effect.
 
void HueShift (float hueDeg)
 Applies a hue shift to the stripe colors.
 
RGBColor GetRGB (const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override
 Computes the color at a given position.
 
- Public Member Functions inherited from Material
virtual ~Material ()=default
 Virtual destructor for proper cleanup in derived classes.
 

Private Attributes

RGBColorrgbColors
 Array of colors used for the stripes.
 
RGBColorbaseRGBColors
 Backup of the original colors for hue adjustments.
 
uint8_t colorCount
 Number of colors in the stripe pattern.
 
Vector2D positionOffset
 Offset for the stripe position.
 
Vector2D rotationOffset
 Rotation center for the pattern.
 
float stripeWidth
 Width of each stripe in the pattern.
 
float wavePeriod
 Period of the sinusoidal wave effect.
 
float waveAmplitude
 Amplitude of the sinusoidal wave effect.
 
float rotationAngle
 Angle for rotating the pattern.
 

Additional Inherited Members

- Public Types inherited from Material
enum  Method {
  Base , Add , Subtract , Multiply ,
  Divide , Darken , Lighten , Screen ,
  Overlay , SoftLight , Replace , EfficientMask ,
  Bypass
}
 Defines blending methods for combining colors. More...
 

Detailed Description

Generates striped patterns with configurable properties.

The StripeMaterial class provides methods for creating and manipulating striped patterns that can include wave effects, color gradients, and rotational transformations.

Definition at line 27 of file StripeMaterial.h.

Constructor & Destructor Documentation

◆ StripeMaterial()

StripeMaterial ( uint8_t  colorCount,
RGBColor rgbColors,
float  stripeWidth,
float  wavePeriod,
float  waveAmplitude 
)

Constructs a StripeMaterial with given properties.

Parameters
colorCountNumber of colors in the stripe pattern.
rgbColorsArray of RGB colors for the stripes.
stripeWidthWidth of each stripe.
wavePeriodPeriod of the wave effect.
waveAmplitudeAmplitude of the wave effect.

Member Function Documentation

◆ GetRGB()

RGBColor GetRGB ( const Vector3D position,
const Vector3D normal,
const Vector3D uvw 
)
overridevirtual

Computes the color at a given position.

Parameters
position3D position in the scene.
normalNormal vector at the position (not used for this material).
uvwTexture coordinates at the position (not used for this material).
Returns
The RGB color corresponding to the given position.

Implements Material.

◆ HueShift()

void HueShift ( float  hueDeg)

Applies a hue shift to the stripe colors.

Parameters
hueDegThe degree of hue shift to apply.

◆ SetPositionOffset()

void SetPositionOffset ( Vector2D  positionOffset)

Sets the position offset for the pattern.

Parameters
positionOffsetThe desired position offset.

Referenced by AlphaAnimation::Update(), and FullScreenAnimation::Update().

◆ SetRotationAngle()

void SetRotationAngle ( float  rotationAngle)

Sets the rotation angle for the pattern.

Parameters
rotationAngleThe desired rotation angle in degrees.

Referenced by AlphaAnimation::Update(), and FullScreenAnimation::Update().

◆ SetRotationOffset()

void SetRotationOffset ( Vector2D  rotationOffset)

Sets the rotation offset (center point) for the pattern.

Parameters
rotationOffsetThe center point for rotation.

◆ SetStripeWidth()

void SetStripeWidth ( float  stripeWidth)

Sets the stripe width.

Parameters
stripeWidthThe desired stripe width.

Referenced by AlphaAnimation::Update(), and FullScreenAnimation::Update().

◆ SetWaveAmplitude()

void SetWaveAmplitude ( float  waveAmplitude)

Sets the wave amplitude for the sinusoidal effect.

Parameters
waveAmplitudeThe desired wave amplitude.

Referenced by AlphaAnimation::Update(), and FullScreenAnimation::Update().

◆ SetWavePeriod()

void SetWavePeriod ( float  wavePeriod)

Sets the wave period for the sinusoidal effect.

Parameters
wavePeriodThe desired wave period.

Referenced by AlphaAnimation::Update(), and FullScreenAnimation::Update().

Member Data Documentation

◆ baseRGBColors

RGBColor* baseRGBColors
private

Backup of the original colors for hue adjustments.

Definition at line 30 of file StripeMaterial.h.

◆ colorCount

uint8_t colorCount
private

Number of colors in the stripe pattern.

Definition at line 31 of file StripeMaterial.h.

◆ positionOffset

Vector2D positionOffset
private

Offset for the stripe position.

Definition at line 32 of file StripeMaterial.h.

◆ rgbColors

RGBColor* rgbColors
private

Array of colors used for the stripes.

Definition at line 29 of file StripeMaterial.h.

◆ rotationAngle

float rotationAngle
private

Angle for rotating the pattern.

Definition at line 37 of file StripeMaterial.h.

◆ rotationOffset

Vector2D rotationOffset
private

Rotation center for the pattern.

Definition at line 33 of file StripeMaterial.h.

◆ stripeWidth

float stripeWidth
private

Width of each stripe in the pattern.

Definition at line 34 of file StripeMaterial.h.

◆ waveAmplitude

float waveAmplitude
private

Amplitude of the sinusoidal wave effect.

Definition at line 36 of file StripeMaterial.h.

◆ wavePeriod

float wavePeriod
private

Period of the sinusoidal wave effect.

Definition at line 35 of file StripeMaterial.h.


The documentation for this class was generated from the following file: