![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
A material that applies a single, solid RGB color to surfaces. More...
#include <SimpleMaterial.h>
Public Member Functions | |
SimpleMaterial (RGBColor rgb) | |
Constructs a SimpleMaterial with a specified RGB color. | |
void | HueShift (float hueDeg) |
Adjusts the hue of the material's color. | |
void | SetRGB (RGBColor rgb) |
Sets a new RGB color for the material. | |
RGBColor | GetRGB (const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override |
Retrieves the RGB color for a surface. | |
![]() | |
virtual | ~Material ()=default |
Virtual destructor for proper cleanup in derived classes. | |
Private Attributes | |
RGBColor | rgb |
The active RGB color applied to the surface. | |
RGBColor | baseRGB |
The base RGB color used for reference during hue shifts. | |
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... | |
A material that applies a single, solid RGB color to surfaces.
This class allows setting a static RGB color or dynamically adjusting its hue for visual effects.
Definition at line 23 of file SimpleMaterial.h.
SimpleMaterial | ( | RGBColor | rgb | ) |
Constructs a SimpleMaterial
with a specified RGB color.
rgb | The initial color to be applied to the material. |
Definition at line 3 of file SimpleMaterial.cpp.
|
overridevirtual |
Retrieves the RGB color for a surface.
For SimpleMaterial
, this always returns the same color, regardless of position, normal, or texture coordinates.
position | 3D position in the scene (not used for this material). |
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 17 of file SimpleMaterial.cpp.
References rgb.
Adjusts the hue of the material's color.
This function shifts the hue of the current color by the specified degree value while maintaining its brightness and saturation.
hueDeg | The hue shift in degrees (range: 0–360). |
Definition at line 8 of file SimpleMaterial.cpp.
References baseRGB, RGBColor::HueShift(), and rgb.
Sets a new RGB color for the material.
rgb | The new RGB color to apply. |
Definition at line 12 of file SimpleMaterial.cpp.
Referenced by SpyroRotateAnimation::Update().
|
private |
The base RGB color used for reference during hue shifts.
Definition at line 26 of file SimpleMaterial.h.
Referenced by HueShift(), SetRGB(), and SimpleMaterial().
|
private |
The active RGB color applied to the surface.
Definition at line 25 of file SimpleMaterial.h.
Referenced by GetRGB(), HueShift(), SetRGB(), and SimpleMaterial().