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/MaterialAnimator.h"
19#include "../AnimationTracks/BlinkTrack.h"
21#include "../../Signals/FFTVoiceDetection.h"
57 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Anger), NukudeFace::Anger, 30, 0.0f, 1.0f);
58 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Sadness), NukudeFace::Sadness, 30, 0.0f, 1.0f);
59 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Surprised), NukudeFace::Surprised, 30, 0.0f, 1.0f);
60 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Doubt), NukudeFace::Doubt, 30, 0.0f, 1.0f);
61 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Frown), NukudeFace::Frown, 30, 0.0f, 1.0f);
62 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::LookUp), NukudeFace::LookUp, 30, 0.0f, 1.0f);
63 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::LookDown), NukudeFace::LookDown, 30, 0.0f, 1.0f);
65 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_ee), NukudeFace::vrc_v_ee, 2, 0.0f, 1.0f);
66 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_ih), NukudeFace::vrc_v_ih, 2, 0.0f, 1.0f);
67 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_dd), NukudeFace::vrc_v_dd, 2, 0.0f, 1.0f);
68 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_rr), NukudeFace::vrc_v_rr, 2, 0.0f, 1.0f);
69 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_ch), NukudeFace::vrc_v_ch, 2, 0.0f, 1.0f);
70 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_aa), NukudeFace::vrc_v_aa, 2, 0.0f, 1.0f);
71 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_oh), NukudeFace::vrc_v_oh, 2, 0.0f, 1.0f);
72 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_ss), NukudeFace::vrc_v_ss, 2, 0.0f, 1.0f);
74 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::HideBlush), NukudeFace::HideBlush, 30, 1.0f, 0.0f);
105 scene.AddObject(
pM.GetObject());
117 MenuButtonHandler::Initialize(20, 7, 500);
164 pM.GetObject()->Disable();
172 return pM.GetObject();
176 if(MenuButtonHandler::UseMicrophone()){
195 pM.GetObject()->Enable();
198 bool isBooped = MenuButtonHandler::UseBoopSensor() ?
boop.isBooped() : 0;
199 uint8_t mode = MenuButtonHandler::GetFaceState();
209 if (isBooped && mode != 6){
214 else if (mode == 1)
Angry();
215 else if (mode == 2)
Doubt();
216 else if (mode == 3)
Frown();
217 else if (mode == 4)
LookUp();
218 else if (mode == 5)
Sad();
224 pM.SetMorphWeight(NukudeFace::BiggerNose, 1.0f);
225 pM.SetMorphWeight(NukudeFace::MoveEye, 1.0f);
236 pM.GetObject()->GetTransform()->SetRotation(
Vector3D(0.0f, 0.0f, -7.5f));
238 pM.GetObject()->GetTransform()->SetScale(
Vector3D(-1.05f, 0.585f, 0.8f));
240 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.
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.
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.
@ Triangle
Triangle waveform.
float Update()
Updates and calculates the next value of the waveform.
Creates a customizable gradient material for rendering.
Animates transitions and blends between multiple materials.
void AddMaterial(Material::Method method, Material *material, uint16_t frames, float minOpacity, float maxOpacity)
Adds a material to the animation with specified properties.
void SetBaseMaterial(Material::Method method, Material *material)
Sets the base material for the animation.
void AddMaterialFrame(Material &material, float opacity)
Adds a specific frame for a material in the animation.
void Update()
Updates the animator, advancing the transitions.
@ Lighten
Chooses the lighter color.
@ 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.
FunctionGenerator fGenMatHue
FunctionGenerator fGenMatYMove
EasyEaseAnimator< 20 > eEA
SimpleMaterial redMaterial
void UpdateKeyFrameTracks()
RainbowSpiral rainbowSpiral
SimpleMaterial blueMaterial
void ChangeInterpolationMethods()
GradientMaterial< 2 > gradientMat
void SpectrumAnalyzerFace()
FunctionGenerator fGenMatPos
MaterialAnimator< 5 > materialAnimator
FunctionGenerator fGenScale
FunctionGenerator fGenRotation
void FadeIn(float stepRatio) override
void FadeOut(float stepRatio) override
RainbowNoise rainbowNoise
FunctionGenerator fGenMatXMove
void Update(float ratio) override
FFTVoiceDetection< 128 > voiceDetection
RGBColor gradientSpectrum[2]