![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Combines multiple materials with specified blending methods and opacities. More...
#include <CombineMaterial.h>
Public Member Functions | |
CombineMaterial () | |
Constructs an empty CombineMaterial instance. | |
void | AddMaterial (Method method, Material *material, float opacity) |
Adds a new material to the combination. | |
void | SetMethod (uint8_t index, Method method) |
Sets the blending method for a specific material. | |
void | SetOpacity (uint8_t index, float opacity) |
Sets the opacity for a specific material. | |
void | SetMaterial (uint8_t index, Material *material) |
Replaces a material at a specific index. | |
RGBColor | GetRGB (const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override |
Calculates the resulting color by combining all materials. | |
![]() | |
virtual | ~Material ()=default |
Virtual destructor for proper cleanup in derived classes. | |
Private Attributes | |
Method | method [materialCount] |
Array of blending methods for each material. | |
Material * | materials [materialCount] |
Array of pointers to materials. | |
float | opacity [materialCount] |
Array of opacities for each material. | |
uint8_t | materialsAdded = 0 |
Counter for added materials. | |
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... | |
Combines multiple materials with specified blending methods and opacities.
The CombineMaterial
class allows for the creation of composite materials by blending multiple materials using different methods and opacities. Each material can have a unique blending method and opacity level.
materialCount | Maximum number of materials to combine. |
Definition at line 29 of file CombineMaterial.h.
CombineMaterial | ( | ) |
Constructs an empty CombineMaterial
instance.
void AddMaterial | ( | Method | method, |
Material * | material, | ||
float | opacity | ||
) |
Adds a new material to the combination.
method | The blending method to use for the material. |
material | A pointer to the material to add. |
opacity | The opacity level of the material (0.0 to 1.0). |
Referenced by Boot::Boot(), ClockAnimation::SetMaterialLayers(), ArtleckAnimationV2::SetMaterials(), ElGatoAnimation::SetMaterials(), LeonHuskyAnimation::SetMaterials(), MyntAnimation::SetMaterials(), ProtobottAnimation::SetMaterials(), VesperAnimation::SetMaterials(), WaffleDaProtoAnimation::SetMaterials(), and TVStatic::TVStatic().
|
overridevirtual |
Calculates the resulting color by combining all materials.
position | The position in 3D space. |
normal | The normal vector at the position. |
uvw | The UVW coordinates for texture mapping. |
RGBColor
. Implements Material.
Referenced by TVStatic::GetRGB().
Replaces a material at a specific index.
index | The index of the material to replace. |
material | A pointer to the new material. |
Sets the blending method for a specific material.
index | The index of the material. |
method | The new blending method. |
Sets the opacity for a specific material.
Referenced by Boot::Update(), ArtleckAnimationV2::Update(), ElGatoAnimation::Update(), LeonHuskyAnimation::Update(), MyntAnimation::Update(), ProtobottAnimation::Update(), VesperAnimation::Update(), WaffleDaProtoAnimation::Update(), and ClockAnimation::Update().
|
private |
Array of pointers to materials.
Definition at line 32 of file CombineMaterial.h.
Counter for added materials.
Definition at line 34 of file CombineMaterial.h.
|
private |
Array of blending methods for each material.
Definition at line 31 of file CombineMaterial.h.
|
private |
Array of opacities for each material.
Definition at line 33 of file CombineMaterial.h.