ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
MaterialAnimator< materialCount > Class Template Reference

Animates transitions and blends between multiple materials. More...

#include <MaterialAnimator.h>

Inheritance diagram for MaterialAnimator< materialCount >:
Collaboration diagram for MaterialAnimator< materialCount >:

Public Member Functions

 MaterialAnimator ()
 Default constructor for MaterialAnimator.
 
void SetBaseMaterial (Material::Method method, Material *material)
 Sets the base material for the animation.
 
void AddMaterial (Material::Method method, Material *material, uint16_t frames, float minOpacity, float maxOpacity)
 Adds a material to the animation with specified properties.
 
void AddMaterialFrame (Material &material, float opacity)
 Adds a specific frame for a material in the animation.
 
float GetMaterialOpacity (Material &material)
 Retrieves the current opacity of a material.
 
void Update ()
 Updates the animator, advancing the transitions.
 
RGBColor GetRGB (const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override
 Retrieves the color at a specific position, considering the blended materials.
 
- Public Member Functions inherited from Material
virtual ~Material ()=default
 Virtual destructor for proper cleanup in derived classes.
 

Private Attributes

EasyEaseAnimator< materialCounteEA = EasyEaseAnimator<materialCount>(IEasyEaseAnimator::Cosine)
 Animator for easing transitions.
 
CombineMaterial< materialCountcombineMaterial
 Combines multiple materials for rendering.
 
float materialRatios [materialCount]
 Stores the opacity ratios for each material.
 
Materialdictionary [materialCount]
 Holds the materials in the animator.
 
uint8_t currentMaterials = 0
 Tracks the number of materials added.
 
bool baseMaterialSet = false
 Indicates if the base material is set.
 

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

template<size_t materialCount>
class MaterialAnimator< materialCount >

Animates transitions and blends between multiple materials.

The MaterialAnimator class uses an EasyEaseAnimator for smooth transitions between materials, allowing dynamic blending and effects in rendering systems.

Template Parameters
materialCountThe maximum number of materials to animate.

Definition at line 28 of file MaterialAnimator.h.

Constructor & Destructor Documentation

◆ MaterialAnimator()

template<size_t materialCount>
MaterialAnimator ( )

Default constructor for MaterialAnimator.

Member Function Documentation

◆ AddMaterial()

◆ AddMaterialFrame()

template<size_t materialCount>
void AddMaterialFrame ( Material material,
float  opacity 
)

Adds a specific frame for a material in the animation.

Parameters
materialReference to the material.
opacityThe opacity value for the frame.

Referenced by ProtogenProject::AddBackgroundMaterialFrame(), ProtogenProject::AddBackgroundMaterialFrame(), ProtogenProject::AddMaterialFrame(), ProtogenProject::AddMaterialFrame(), AphoriAnimation::Angry(), BasilGardenAnimation::Angry(), InfraredAnimation::Angry(), SammyAnimation::Angry(), TamamoAnimation::Angry(), TechSaneAnimation::Angry(), WarzoneAnimation::Angry(), XenraxAnimation::Angry(), HUB75AnimationSplit::Angry(), WS35AnimationSplit::Angry(), AlphaAnimation::AngryFace(), GammaAnimation::AngryFace(), AlphaAnimation::AudioReactiveGradientDisplay(), AphoriAnimation::AudioReactiveGradientFace(), BasilGardenAnimation::AudioReactiveGradientFace(), BroookAnimation::AudioReactiveGradientFace(), GalaxyAnimation::AudioReactiveGradientFace(), HertzzAnimation::AudioReactiveGradientFace(), InfraredAnimation::AudioReactiveGradientFace(), SammyAnimation::AudioReactiveGradientFace(), SergaliciousAnimation::AudioReactiveGradientFace(), StrawberryAnimation::AudioReactiveGradientFace(), TamamoAnimation::AudioReactiveGradientFace(), TechSaneAnimation::AudioReactiveGradientFace(), Warzone2Animation::AudioReactiveGradientFace(), XenraxAnimation::AudioReactiveGradientFace(), GammaAnimation::AudioReactiveGradientFace(), HUB75AnimationSplit::AudioReactiveGradientFace(), WS35AnimationSplit::AudioReactiveGradientFace(), ProtogenProject::AudioReactiveGradientFace(), BroookAnimation::BadAppleFace(), XenraxAnimation::Battery(), AphoriAnimation::Blush(), Warzone2Animation::Blush(), AphoriAnimation::Boop(), TamamoAnimation::Boop(), XenraxAnimation::Boop(), SergaliciousAnimation::BSOD(), XenraxAnimation::BSOD(), InfraredAnimation::Calm(), AceAnimation::Crash(), BroookAnimation::Dead(), Warzone2Animation::Dead(), AlphaAnimation::Dead(), GammaAnimation::Dead(), InfraredAnimation::Default(), InfraredAnimation::Determination(), BasilGardenAnimation::ForReal(), BroookAnimation::Happy(), InfraredAnimation::Happy(), GalaxyAnimation::HappyRainbow(), BroookAnimation::Heart(), AlphaAnimation::Heart(), GammaAnimation::Heart(), AlphaAnimation::HideAll(), XenraxAnimation::Hypno(), DrGonzoProject::Lewd(), InfraredAnimation::Mad(), AphoriAnimation::OscilloscopeFace(), BasilGardenAnimation::OscilloscopeFace(), BroookAnimation::OscilloscopeFace(), GalaxyAnimation::OscilloscopeFace(), HertzzAnimation::OscilloscopeFace(), InfraredAnimation::OscilloscopeFace(), SammyAnimation::OscilloscopeFace(), SergaliciousAnimation::OscilloscopeFace(), StrawberryAnimation::OscilloscopeFace(), TamamoAnimation::OscilloscopeFace(), TechSaneAnimation::OscilloscopeFace(), Warzone2Animation::OscilloscopeFace(), XenraxAnimation::OscilloscopeFace(), GammaAnimation::OscilloscopeFace(), HUB75AnimationSplit::OscilloscopeFace(), WS35AnimationSplit::OscilloscopeFace(), ProtogenProject::OscilloscopeFace(), GammaAnimation::OwO(), AlphaAnimation::OwO2(), GammaAnimation::OwO2(), BasilGardenAnimation::Rage(), AphoriAnimation::Sad(), BasilGardenAnimation::Sad(), BroookAnimation::Sad(), InfraredAnimation::Sad(), SammyAnimation::Sad(), TechSaneAnimation::Sad(), WarzoneAnimation::Sad(), AlphaAnimation::Sad(), GammaAnimation::Sad(), HUB75AnimationSplit::Sad(), WS35AnimationSplit::Sad(), AphoriAnimation::SetMaterialColor(), BasilGardenAnimation::SetMaterialColor(), BroookAnimation::SetMaterialColor(), GalaxyAnimation::SetMaterialColor(), HertzzAnimation::SetMaterialColor(), SammyAnimation::SetMaterialColor(), SergaliciousAnimation::SetMaterialColor(), StrawberryAnimation::SetMaterialColor(), TamamoAnimation::SetMaterialColor(), TechSaneAnimation::SetMaterialColor(), Warzone2Animation::SetMaterialColor(), XenraxAnimation::SetMaterialColor(), GammaAnimation::SetMaterialColor(), HUB75AnimationSplit::SetMaterialColor(), WS35AnimationSplit::SetMaterialColor(), ProtogenProject::SetMaterialColor(), AlphaAnimation::SpectrumAnalyzerDisplay(), AphoriAnimation::SpectrumAnalyzerFace(), BasilGardenAnimation::SpectrumAnalyzerFace(), BroookAnimation::SpectrumAnalyzerFace(), GalaxyAnimation::SpectrumAnalyzerFace(), HertzzAnimation::SpectrumAnalyzerFace(), InfraredAnimation::SpectrumAnalyzerFace(), SammyAnimation::SpectrumAnalyzerFace(), SergaliciousAnimation::SpectrumAnalyzerFace(), StrawberryAnimation::SpectrumAnalyzerFace(), TamamoAnimation::SpectrumAnalyzerFace(), TechSaneAnimation::SpectrumAnalyzerFace(), Warzone2Animation::SpectrumAnalyzerFace(), XenraxAnimation::SpectrumAnalyzerFace(), GammaAnimation::SpectrumAnalyzerFace(), HUB75AnimationSplit::SpectrumAnalyzerFace(), WS35AnimationSplit::SpectrumAnalyzerFace(), ProtogenProject::SpectrumAnalyzerFace(), Warzone2Animation::Spiral(), InfraredAnimation::Surprised(), SammyAnimation::Surprised(), TechSaneAnimation::Surprised(), WarzoneAnimation::Surprised(), HUB75AnimationSplit::Surprised(), WS35AnimationSplit::Surprised(), AphoriAnimation::Thrilled(), AphoriAnimation::Toast(), BroookAnimation::Upset(), and Warzone2Animation::Upset().

◆ GetMaterialOpacity()

template<size_t materialCount>
float GetMaterialOpacity ( Material material)

Retrieves the current opacity of a material.

Parameters
materialReference to the material.
Returns
The current opacity of the material.

Referenced by AceAnimation::Update().

◆ GetRGB()

template<size_t materialCount>
RGBColor GetRGB ( const Vector3D position,
const Vector3D normal,
const Vector3D uvw 
)
overridevirtual

Retrieves the color at a specific position, considering the blended materials.

Parameters
positionThe 3D position to sample the color.
normalThe normal vector at the position.
uvwUVW coordinates at the position.
Returns
The blended RGB color at the specified position.

Implements Material.

◆ SetBaseMaterial()

◆ Update()

Member Data Documentation

◆ baseMaterialSet

template<size_t materialCount>
bool baseMaterialSet = false
private

Indicates if the base material is set.

Definition at line 35 of file MaterialAnimator.h.

◆ combineMaterial

template<size_t materialCount>
CombineMaterial<materialCount> combineMaterial
private

Combines multiple materials for rendering.

Definition at line 31 of file MaterialAnimator.h.

◆ currentMaterials

template<size_t materialCount>
uint8_t currentMaterials = 0
private

Tracks the number of materials added.

Definition at line 34 of file MaterialAnimator.h.

◆ dictionary

template<size_t materialCount>
Material* dictionary[materialCount]
private

Holds the materials in the animator.

Definition at line 33 of file MaterialAnimator.h.

◆ eEA

Animator for easing transitions.

Definition at line 30 of file MaterialAnimator.h.

◆ materialRatios

template<size_t materialCount>
float materialRatios[materialCount]
private

Stores the opacity ratios for each material.

Definition at line 32 of file MaterialAnimator.h.


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