3#include "../Animation.h"
4#include "../KeyFrameTrack.h"
5#include "../EasyEaseAnimator.h"
6#include "../../Objects/Background.h"
7#include "../../Morph/NukudeFace.h"
8#include "../../Render/Scene.h"
9#include "../../Signals/FunctionGenerator.h"
10#include "../../Sensors/MenuButtonHandler.h"
11#include "../../Sensors/BoopSensor.h"
13#include "../../Materials/Animated/SpectrumAnalyzer.h"
14#include "../../Materials/Animated/RainbowNoise.h"
15#include "../../Materials/Animated/RainbowSpiral.h"
17#include "../../Materials/CombineMaterial.h"
19#include "../AnimationTracks/BlinkTrack.h"
21#include "../../Signals/FFTVoiceDetection.h"
44 RGBColor gradientSpectrum[4] = {
RGBColor(0, 0, 255),
RGBColor(0, 255, 0),
RGBColor(255, 0, 0),
RGBColor(255, 255, 0)};
77 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Anger), NukudeFace::Anger, 60, 0.0f, 1.0f);
78 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Sadness), NukudeFace::Sadness, 60, 0.0f, 1.0f);
79 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Surprised), NukudeFace::Surprised, 60, 0.0f, 1.0f);
80 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Doubt), NukudeFace::Doubt, 60, 0.0f, 1.0f);
81 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Frown), NukudeFace::Frown, 60, 0.0f, 1.0f);
82 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::LookUp), NukudeFace::LookUp, 60, 0.0f, 1.0f);
83 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::LookDown), NukudeFace::LookDown, 60, 0.0f, 1.0f);
85 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_ee), NukudeFace::vrc_v_ee, 2, 0.0f, 1.0f);
86 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_ih), NukudeFace::vrc_v_ih, 2, 0.0f, 1.0f);
87 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_dd), NukudeFace::vrc_v_dd, 2, 0.0f, 1.0f);
88 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_rr), NukudeFace::vrc_v_rr, 2, 0.0f, 1.0f);
89 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_ch), NukudeFace::vrc_v_ch, 2, 0.0f, 1.0f);
90 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_aa), NukudeFace::vrc_v_aa, 2, 0.0f, 1.0f);
91 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_oh), NukudeFace::vrc_v_oh, 2, 0.0f, 1.0f);
92 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_ss), NukudeFace::vrc_v_ss, 2, 0.0f, 1.0f);
94 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::HideBlush), NukudeFace::HideBlush, 30, 1.0f, 0.0f);
141 scene.AddObject(
pM.GetObject());
153 MenuButtonHandler::Initialize(0, 7, 1000);
205 pM.GetObject()->Disable();
213 return pM.GetObject();
217 if(MenuButtonHandler::UseMicrophone()){
236 pM.GetObject()->Enable();
239 bool isBooped = MenuButtonHandler::UseBoopSensor() ?
boop.isBooped() : 0;
240 uint8_t mode = MenuButtonHandler::GetFaceState();
250 if (isBooped && mode != 6){
255 else if (mode == 1)
Angry();
256 else if (mode == 2)
Doubt();
259 else if (mode == 5)
Sad();
265 pM.SetMorphWeight(NukudeFace::BiggerNose, 1.0f);
266 pM.SetMorphWeight(NukudeFace::MoveEye, 1.0f);
282 pM.GetObject()->GetTransform()->SetScale(
Vector3D(-1.0f, 0.625f, 0.7f));
284 pM.GetObject()->UpdateTransform();
void AddParameter(float *parameter)
Adds a parameter to the animation track.
float Update()
Updates the animation track and returns the current parameter value.
A template class for animating eye blinking using keyframes.
Combines multiple materials with specified blending methods and opacities.
void SetOpacity(uint8_t index, float opacity)
Sets the opacity for a specific material.
void AddMaterial(Method method, Material *material, float opacity)
Adds a new material to the combination.
A template class for implementing advanced animation easing.
void AddParameterFrame(uint16_t dictionaryValue, float value) override
Adds a single frame value for a parameter.
void Update() override
Updates the animator, advancing all animations.
void SetInterpolationMethod(uint16_t dictionaryValue, InterpolationMethod interpMethod) override
Sets the interpolation method for a specific parameter.
void AddParameter(float *parameter, uint16_t dictionaryValue, uint16_t frames, float basis, float goal) override
Adds a parameter to the animator.
SimpleMaterial greenMaterial
FunctionGenerator fGenMatYMove
SimpleMaterial pinkMaterial
SimpleMaterial redMaterial
void UpdateKeyFrameTracks()
RainbowSpiral rainbowSpiral
SimpleMaterial blueMaterial
SimpleMaterial yellowMaterial
EasyEaseAnimator< 25 > eEA
void ChangeInterpolationMethods()
void SpectrumAnalyzerFace()
FunctionGenerator fGenMatPos
FunctionGenerator fGenScale
FunctionGenerator fGenRotation
void FadeIn(float stepRatio) override
void FadeOut(float stepRatio) override
RainbowNoise rainbowNoise
FunctionGenerator fGenMatXMove
void Update(float ratio) override
RGBColor gradientSpectrum[4]
FFTVoiceDetection< 128 > voiceDetection
CombineMaterial< 8 > faceMaterial
GradientMaterial< 4 > gradientMat
Detects visemes based on FFT voice analysis.
float GetViseme(MouthShape viseme)
Retrieves the probability of a specific viseme.
void Update(float *peaks, float maxFrequency)
Updates the viseme probabilities based on new FFT data.
A class to generate various waveform functions with customizable parameters.
float Update()
Updates and calculates the next value of the waveform.
Creates a customizable gradient material for rendering.
@ Add
Adds colors together.
@ Replace
Replaces the base color.
static float GetCurrentMagnitude()
Retrieves the current signal magnitude.
static float GetSampleRate()
Retrieves the current sampling rate.
static float * GetFourierFiltered()
Retrieves the filtered FFT output data.
static void Update()
Updates the microphone system, processing new samples and performing FFT.
Represents a 3D object with geometry, material, and transformation data.
Represents an RGB color and provides methods for manipulation.
A dynamic material that creates a rainbow effect using simplex noise.
void Update(float ratio)
Updates the material animation based on the time ratio.
A dynamic material creating a colorful rainbow spiral animation.
void Update(float ratio)
Updates the material animation based on the time ratio.
A material that applies a single, solid RGB color to surfaces.
A material that visualizes audio data as a spectrum.
void SetMirrorYState(bool state)
Sets the mirroring state for the visualization.
void Update(float *readData)
Updates the spectrum visualization with new audio data.
void SetFlipYState(bool state)
Sets the flipping state for the visualization.
void SetHueAngle(float hueAngle)
Sets the hue adjustment angle for the spectrum colors.
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
@ ER
Mouth shape corresponding to the "ER" sound.
@ OO
Mouth shape corresponding to the "OO" sound.
@ AH
Mouth shape corresponding to the "AH" sound.
@ UH
Mouth shape corresponding to the "UH" sound.
@ AR
Mouth shape corresponding to the "AR" sound.
@ EE
Mouth shape corresponding to the "EE" sound.