6#include "../Morph/NukudeFace.h"
7#include "../Render/Scene.h"
8#include "../Materials/GradientMaterial.h"
9#include "../Materials/SimplexNoise.h"
10#include "../Math/FunctionGenerator.h"
11#include "../Sensors/SerialSync.h"
12#include "../Sensors/MicrophoneSimple.h"
13#include "../Sensors/ButtonHandler.h"
14#include "../Materials/NormalMaterial.h"
16#include "Flash/ImageSequences/Rainbow.h"
23 RGBColor spectrum[4] = {
RGBColor(0, 255, 0),
RGBColor(255, 0, 0),
RGBColor(0, 255, 0),
RGBColor(0, 0, 255)};
42 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Anger), NukudeFace::Anger, 40, 0.0f);
43 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Sadness), NukudeFace::Sadness, 90, 0.0f);
44 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Surprised), NukudeFace::Surprised, 30, 0.0f);
45 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Doubt), NukudeFace::Doubt, 60, 0.0f);
46 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::Frown), NukudeFace::Frown, 90, 0.0f);
47 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::LookUp), NukudeFace::LookUp, 60, 0.0f);
48 eEA.
AddParameter(
pM.GetMorphWeightReference(NukudeFace::LookDown), NukudeFace::LookDown, 60, 0.0f);
78 scene->AddObject(
pM.GetObject());
86 pM.GetObject()->SetMaterial(&
gif);
179 return pM.GetObject();
186 pM.GetObject()->Enable();
198 ratio = fmod(ratio -
offset, 1.0f);
204 uint8_t mode = (uint8_t)(ratio * 8.0f);
211 if (mode == 0)
Angry();
212 else if (mode == 1)
Sad();
214 else if (mode == 3)
Doubt();
215 else if (mode == 4)
Frown();
216 else if (mode == 5)
LookUp();
222 if(
talk)
pM.SetMorphWeight(NukudeFace::vrc_v_aa, mouthMove);
226 float x = sinf(ratio * 3.14159f / 180.0f * 360.0f * 2.0f) * 3.0f;
227 float y = cosf(ratio * 3.14159f / 180.0f * 360.0f * 3.0f) * 3.0f;
229 float linSweep = ratio > 0.5f ? 1.0f - ratio : ratio;
230 float sShift = linSweep * 0.002f + 0.005f;
239 gif.SetPosition(
Vector2D(20.0f + shift, 135.0f + shift));
241 gif.SetRotation(15.0f);
244 pM.GetObject()->GetTransform()->SetRotation(
Vector3D(0.0f, 0.0f, 0.0f));
245 pM.GetObject()->GetTransform()->SetPosition(
Vector3D(x + 72.5f, y - 22.5f, 600.0f));
246 pM.GetObject()->GetTransform()->Scale(
Vector3D(1.0f, 1.0f, 1.0f));
248 pM.GetObject()->UpdateTransform();
Declares the EasyEaseAnimator template class for advanced animation easing.
Declares the KeyFrameTrack template class for managing keyframe-based animations.
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 AddParameter(float *parameter, uint16_t dictionaryValue, uint16_t frames, float basis, float goal) override
Adds a parameter to the animator.
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.
void HueShift(float hueDeg)
Shifts the hue of the gradient by a specified degree.
void SetGradientPeriod(float gradientPeriod)
Sets the gradient's period of repetition.
@ Cosine
Smooth cosine interpolation.
@ Cosine
Smooth cosine interpolation.
A template class for managing animations with multiple parameters and keyframes.
void AddParameter(float *parameter)
Adds a parameter to the track.
void Play()
Resumes the animation.
void AddKeyFrame(float time, float value)
Adds a keyframe to the track.
float Update()
Updates the animation track and computes the new parameter value.
A simple class for processing microphone signals.
float Update()
Updates the microphone reading and processes the signal.
A material that visualizes surface normals as RGB colors.
NormalMaterial normalMaterial
void UpdateKeyFrameTracks()
FunctionGenerator fGenMatPos
FunctionGenerator fGenScale
FunctionGenerator fGenRotation
void FadeIn(float stepRatio) override
void FadeOut(float stepRatio) override
void Update(float ratio) override
GradientMaterial gNoiseMat
Represents a 3D object with geometry, material, and transformation data.
Represents an RGB color and provides methods for manipulation.
static void SetMouthMove(float ratio)
static void SetMode(uint8_t mode)
static void SetRatio(float ratio)
static float GetMouthMove()
A material class for rendering Simplex Noise.
void SetScale(Vector3D noiseScale)
Sets the scale for noise generation.
void SetZPosition(float zPosition)
Sets the Z-position for 3D noise generation.
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.