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"
63 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Anger), NukudeFace::Anger, 60, 0.0f, 1.0f);
64 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Sadness), NukudeFace::Sadness, 60, 0.0f, 1.0f);
65 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Surprised), NukudeFace::Surprised, 60, 0.0f, 1.0f);
66 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Doubt), NukudeFace::Doubt, 60, 0.0f, 1.0f);
67 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Frown), NukudeFace::Frown, 60, 0.0f, 1.0f);
68 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::LookUp), NukudeFace::LookUp, 60, 0.0f, 1.0f);
69 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::LookDown), NukudeFace::LookDown, 60, 0.0f, 1.0f);
71 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_ee), NukudeFace::vrc_v_ee, 2, 0.0f, 1.0f);
72 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_ih), NukudeFace::vrc_v_ih, 2, 0.0f, 1.0f);
73 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_dd), NukudeFace::vrc_v_dd, 2, 0.0f, 1.0f);
74 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_rr), NukudeFace::vrc_v_rr, 2, 0.0f, 1.0f);
75 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_ch), NukudeFace::vrc_v_ch, 2, 0.0f, 1.0f);
76 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_aa), NukudeFace::vrc_v_aa, 2, 0.0f, 1.0f);
77 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_oh), NukudeFace::vrc_v_oh, 2, 0.0f, 1.0f);
78 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::vrc_v_ss), NukudeFace::vrc_v_ss, 2, 0.0f, 1.0f);
80 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::HideBlush), NukudeFace::HideBlush, 30, 1.0f, 0.0f);
118 scene.AddObject(
pM.GetObject());
130 MenuButtonHandler::Initialize(20, 7, 1000);
176 pM.GetObject()->Disable();
184 return pM.GetObject();
188 if(MenuButtonHandler::UseMicrophone()){
207 pM.GetObject()->Enable();
210 bool isBooped = MenuButtonHandler::UseBoopSensor() ?
boop.isBooped() : 0;
211 uint8_t mode = MenuButtonHandler::GetFaceState();
221 if (isBooped && mode != 6){
226 else if (mode == 1)
Angry();
227 else if (mode == 2)
Doubt();
228 else if (mode == 3)
Frown();
229 else if (mode == 4)
LookUp();
230 else if (mode == 5)
Sad();
236 pM.SetMorphWeight(NukudeFace::BiggerNose, 1.0f);
237 pM.SetMorphWeight(NukudeFace::MoveEye, 1.0f);
251 pM.GetObject()->GetTransform()->SetRotation(
Vector3D(0.0f, 0.0f, -7.5f));
253 pM.GetObject()->GetTransform()->SetScale(
Vector3D(-1.05f, 0.585f, 0.8f));
255 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.
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.
void HueShift(float hueDeg)
Shifts the hue of the gradient by a specified degree.
@ 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.
FunctionGenerator fGenMatHue
FunctionGenerator fGenMatYMove
EasyEaseAnimator< 20 > eEA
SimpleMaterial redMaterial
void UpdateKeyFrameTracks()
RainbowSpiral rainbowSpiral
SimpleMaterial blueMaterial
CombineMaterial< 5 > faceMaterial
void ChangeInterpolationMethods()
GradientMaterial< 2 > gradientMat
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
FFTVoiceDetection< 128 > voiceDetection
RGBColor gradientSpectrum[2]
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.