3#include "../Animation.h"
4#include "../KeyFrameTrack.h"
5#include "../EasyEaseAnimator.h"
6#include "../../Objects/Background.h"
7#include "../../Morph/Commissions/GalaxyFace.h"
8#include "../../Render/Scene.h"
9#include "../../Signals/FunctionGenerator.h"
10#include "../../Menu/SingleButtonMenu.h"
11#include "../../Sensors/APDS9960.h"
13#include "../../Materials/Animated/SpectrumAnalyzer.h"
14#include "../../Materials/Animated/AudioReactiveGradient.h"
15#include "../../Materials/Animated/Oscilloscope.h"
16#include "../../Materials/Animated/RainbowNoise.h"
17#include "../../Materials/Animated/RainbowSpiral.h"
19#include "../../Materials/MaterialAnimator.h"
20#include "../../Materials/MaterialMask.h"
21#include "../../Shapes/Ellipse.h"
23#include "../AnimationTracks/BlinkTrack.h"
24#include "../AnimationTracks/EyeMoveTrack.h"
25#include "../../Sensors/MicrophoneFourier_MAX9814.h"
26#include "../../Render/ObjectAlign.h"
91 eEA.
AddParameter(
pM.GetMorphWeightReference(GalaxyFace::OvO), GalaxyFace::OvO, 30, 0.0f, 1.0f);
92 eEA.
AddParameter(
pM.GetMorphWeightReference(GalaxyFace::EyeBack), GalaxyFace::EyeBack, 100, 0.0f, 1.0f);
94 eEA.
AddParameter(
pM.GetMorphWeightReference(GalaxyFace::HappyEye), GalaxyFace::HappyEye, 50, 0.0f, 1.0f);
95 eEA.
AddParameter(
pM.GetMorphWeightReference(GalaxyFace::HappyMouth), GalaxyFace::HappyMouth, 90, 0.0f, 1.0f);
97 eEA.
AddParameter(
pM.GetMorphWeightReference(GalaxyFace::Talk), GalaxyFace::Talk, 4, 0.0f, 1.0f);
99 eEA.
AddParameter(
pM.GetMorphWeightReference(GalaxyFace::HideBlush), GalaxyFace::HideBlush, 60, 1.0f, 0.0f);
196 if(MicrophoneFourierIT::GetCurrentMagnitude() > 0.05f){
227 scene.AddObject(
pM.GetObject());
242 MicrophoneFourierIT::Initialize(22, 8000, 30.0f, 100.0f);
261 return pM.GetObject();
283 MicrophoneFourierIT::Update();
289 aRG.
SetSize(
Vector2D((xOffset + 2.0f) * 10.0f + 50.0f, (xOffset + 2.0f) * 10.0f + 50.0f));
306 else if (mode == 2)
Happy();
331 pM.GetObject()->GetTransform()->SetRotation(
Vector3D(0.0f, 0.0f, -7.5f));
335 float scale = menuRatio * 0.5f + 0.5f;
336 float faceSizeOffset = faceSize * 8.0f;
343 pM.GetObject()->GetTransform()->SetPosition(
Vector3D(xOffset + 5.0f, yOffset - 150.0f *
offsetFace + 5.0f, 0.0f));
344 pM.GetObject()->UpdateTransform();
362 pM.GetObject()->GetTransform()->SetRotation(
Vector3D(0.0f, 0.0f, -7.5f));
367 float scale = menuRatio * 0.5f + 0.5f;
368 float faceSizeOffset = faceSize * 8.0f;
375 pM.GetObject()->GetTransform()->SetPosition(
Vector3D(xOffset + 5.0f, yOffset - 150.0f *
offsetFace + 5.0f, 0.0f));
376 pM.GetObject()->UpdateTransform();
A class for managing the Adafruit APDS9960 sensor.
static bool Initialize(uint8_t threshold)
Initializes the APDS9960 sensor.
static bool isBooped()
Checks if the sensor is "booped" (close proximity detected).
void AddParameter(float *parameter)
Adds a parameter to the animation track.
float Update()
Updates the animation track and returns the current parameter value.
A material class for creating an audio-reactive gradient effect.
void SetRadius(float radius)
Sets the radius for circular gradient patterns.
void SetPosition(Vector2D offset)
Sets the position of the gradient.
void SetSize(Vector2D size)
Sets the size of the gradient.
void SetRotation(float angle)
Sets the rotation angle of the gradient.
void SetHueAngle(float hueAngle)
Sets the hue angle for color adjustments.
A template class for animating eye blinking using keyframes.
A template class for implementing advanced animation easing.
float GetValue(uint16_t dictionaryValue) override
Gets the current value of a parameter.
void SetParameters() override
Applies the current animation values to the parameters.
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.
Represents an ellipse in 2D space.
A template class for animating eye movements using keyframes.
A class to generate various waveform functions with customizable parameters.
@ Triangle
Triangle waveform.
float Update()
Updates and calculates the next value of the waveform.
FunctionGenerator fGenMatHue
SimpleMaterial greenMaterial
FunctionGenerator fGenMatYMove
EyeMoveTrack< 1 > eyeMove
EasyEaseAnimator< 20 > eEA
SimpleMaterial redMaterial
void UpdateKeyFrameTracks()
RainbowSpiral rainbowSpiral
SimpleMaterial blueMaterial
void AudioReactiveGradientFace()
SimpleMaterial yellowMaterial
void ChangeInterpolationMethods()
GradientMaterial< 2 > gradientMat
void SpectrumAnalyzerFace()
FunctionGenerator fGenMatPos
FunctionGenerator fGenScale
FunctionGenerator fGenRotation
SimpleMaterial orangeMaterial
void SetCameraMirror(bool mirror)
void FadeIn(float stepRatio) override
void FadeOut(float stepRatio) override
RainbowNoise rainbowNoise
FunctionGenerator fGenMatXMove
MaterialAnimator< 10 > materialAnimator
SimpleMaterial purpleMaterial
void Update(float ratio) override
RGBColor gradientSpectrum[2]
MaterialAnimator< 4 > backgroundMaterial
uint8_t GetAccentBrightness()
SimpleMaterial whiteMaterial
AudioReactiveGradient aRG
FunctionGenerator fGenEyeLook1
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.
Combines two materials using a shape as a mask.
void SetOpacity(float opacity)
Sets the opacity of the mask effect.
@ Lighten
Chooses the lighter color.
@ Add
Adds colors together.
@ Replace
Replaces the base color.
static T Map(T value, T inLow, T inMax, T outMin, T outMax)
Maps a value from one range to another.
Represents a 3D object with geometry, material, and transformation data.
Handles aligning and transforming 3D objects to fit within specified 2D camera bounds.
void SetEdgeMargin(float edgeMargin)
Sets the margin to keep from the edges when aligning objects.
@ Stretch
Attempt to scale the object(s) to fill the entire area.
void SetJustification(Justification jst)
Sets the justification mode for alignment.
void SetCameraMax(Vector2D camMax)
Updates the maximum bounds for the 2D camera region.
void AlignObjects(Object3D **objs, uint8_t numObjects)
Aligns multiple objects within the camera bounds, including scale factors.
void SetMirrorX(bool mirrorX)
Enables or disables mirroring along the X-axis for the aligned objects.
A dynamic oscilloscope material for visualizing audio signals.
void SetPosition(Vector2D offset)
Sets the position of the oscilloscope visualization.
void SetSize(Vector2D size)
Sets the size of the oscilloscope visualization.
void SetHueAngle(float hueAngle)
Sets the hue angle for color adjustments.
A mathematical construct representing a rotation in 3D space.
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 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.