3#include "../Templates/ProtogenProjectTemplate.h"
4#include "../../Assets/Models/FBX/Commissions/DrGonzoFace.h"
5#include "../../Assets/Models/FBX/Commissions/DrGonzoSD.h"
6#include "../../Assets/Models/FBX/Commissions/DrGonzoTears.h"
8#include "../../Camera/CameraManager/Implementations/HUB75DeltaCameras.h"
9#include "../../Controller/HUB75Controller.h"
11#include "../../Animation/MorphTransform.h"
39 const __FlashStringHelper*
faceArray[14] = {F(
"DEFAULT"), F(
"HAPPY"), F(
"ANGY"), F(
"LEWD"), F(
"LOADING"), F(
"QUESTION"), F(
"DIZZY"), F(
"SAD"), F(
"OWO"), F(
"BOOP"), F(
"AUDIO1"), F(
"AUDIO2"), F(
"AUDIO3")};
42 AddParameter(DrGonzoFace::Happy,
pM.GetMorphWeightReference(DrGonzoFace::Happy), 30);
43 AddParameter(DrGonzoFace::Angy,
pM.GetMorphWeightReference(DrGonzoFace::Angy), 15);
44 AddParameter(DrGonzoFace::Lewd,
pM.GetMorphWeightReference(DrGonzoFace::Lewd), 35);
45 AddParameter(DrGonzoFace::Loading,
pM.GetMorphWeightReference(DrGonzoFace::Loading), 20);
51 AddParameter(DrGonzoFace::Question,
pM.GetMorphWeightReference(DrGonzoFace::Question), 45);
52 AddParameter(DrGonzoFace::Dizzy,
pM.GetMorphWeightReference(DrGonzoFace::Dizzy), 45);
54 AddParameter(DrGonzoFace::OwO,
pM.GetMorphWeightReference(DrGonzoFace::OwO), 40);
55 AddParameter(DrGonzoFace::Boop,
pM.GetMorphWeightReference(DrGonzoFace::Boop), 35);
85 tears.GetObject()->Disable();
89 tears.GetObject()->Disable();
95 tears.GetObject()->Disable();
103 tears.GetObject()->Disable();
113 tears.GetObject()->Disable();
122 float setRatio = 0.0f;
124 if(loadingRatio < 0.15f){
127 else if(loadingRatio < 0.30f){
132 else if(loadingRatio < 0.55f){
138 else if(loadingRatio < 0.7f){
145 else if(loadingRatio < 0.85f){
165 tears.GetObject()->Disable();
173 tears.GetObject()->Disable();
180 tears.GetObject()->Enable();
190 tears.GetObject()->Disable();
200 tears.GetObject()->Disable();
234 tears.GetObject()->ResetVertices();
247 else if (mode == 1)
Happy();
248 else if (mode == 2)
Angy();
249 else if (mode == 3)
Lewd();
252 else if (mode == 6)
Dizzy();
253 else if (mode == 7)
Sad();
254 else if (mode == 8)
OwO();
255 else if (mode == 9) {
258 else if (mode == 10){
268 *
sideDisplay.GetMorphWeightReference(DrGonzoSD::Merge) = 1.0f;
269 *
sideDisplay.GetMorphWeightReference(DrGonzoSD::LoadingB1) = *
pM.GetMorphWeightReference(DrGonzoFace::LoadingB1);
270 *
sideDisplay.GetMorphWeightReference(DrGonzoSD::LoadingB2) = *
pM.GetMorphWeightReference(DrGonzoFace::LoadingB2);
271 *
sideDisplay.GetMorphWeightReference(DrGonzoSD::LoadingB3) = *
pM.GetMorphWeightReference(DrGonzoFace::LoadingB3);
272 *
sideDisplay.GetMorphWeightReference(DrGonzoSD::LoadingB4) = *
pM.GetMorphWeightReference(DrGonzoFace::LoadingB4);
273 *
sideDisplay.GetMorphWeightReference(DrGonzoSD::LoadingB5) = *
pM.GetMorphWeightReference(DrGonzoFace::LoadingB5);
285 pM.GetObject()->UpdateTransform();
305 tears.GetObject()->UpdateTransform();
void LinkControlParameters() override
Links external or user-defined control parameters (pure virtual to be implemented).
FunctionGenerator loadingBar
void Update(float ratio) override
Updates the project state based on the given ratio.
HUB75Controller controller
HUB75DeltaCameraManager cameras
MaterialAnimator< 2 > sideDisplayMaterial
const __FlashStringHelper * faceArray[14]
MorphTransform< 5 > morphTransform
A class to generate various waveform functions with customizable parameters.
@ Gravity
Gravity-like function.
@ Sawtooth
Sawtooth waveform.
float Update()
Updates and calculates the next value of the waveform.
Manages HUB75 LED matrices with camera integration.
void SetAccentBrightness(uint8_t maxAccentBrightness) override
Sets the maximum accent brightness of the secondary display.
void SetBrightness(uint8_t maxBrightness) override
Sets the maximum brightness of the LED matrix.
void SetFaceArray(const __FlashStringHelper **faceNames)
Sets the array of face names.
@ Cosine
Smooth cosine interpolation.
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.
@ Replace
Replaces the base color.
@ Base
The base material color.
static T Map(T value, T inLow, T inMax, T outMin, T outMax)
Maps a value from one range to another.
Scene scene
The Scene object representing the rendered environment.
A default project template that includes functionality for an analog microphone, APDS9960 boop sensor...
void SetMenuWiggleSpeed(float multiplierX, float multiplierY, float multiplierR)
Adjusts the menu's wiggle speed along X, Y, and rotation.
Vector3D GetWiggleOffset()
Computes and returns a Vector3D offset for a "wiggle" effect using function generators.
void EnableBlinking()
Enables blinking (resets and plays the blink track).
void AudioReactiveGradientFace()
Enables the Audio Reactive Gradient on the face, updating offsets and calling callbacks.
void SetMenuOffset(Vector2D offset)
Sets the menu's position offset.
void SetMenuSize(Vector2D size)
Sets the menu's size.
void OscilloscopeFace()
Enables the Oscilloscope on the face, updating offsets and calling callbacks.
void UpdateFace(float ratio)
Updates the face's rendered content, reading any user input and applying changes.
void AlignObjectRear(Object3D *obj, float rotation=0.0f, float margin=2.0f, bool mirror=true)
Aligns a single Object3D to the rear camera bounds with scaling.
void SetWiggleSpeed(float multiplier)
Sets the overall wiggle speed for both X and Y function generators.
EasyEaseAnimator< 60 > eEA
Animator that eases parameter transitions.
bool IsBooped()
Checks if the sensor has detected a boop.
void SpectrumAnalyzerFace()
Enables the Spectrum Analyzer on the face, updating offsets and calling callbacks.
void AddParameter(uint8_t index, float *parameter, uint16_t transitionFrames, IEasyEaseAnimator::InterpolationMethod interpolationMethod=IEasyEaseAnimator::InterpolationMethod::Overshoot, bool invertDirection=false)
Adds a parameter to the EasyEaseAnimator for interpolation.
void DisableBlinking()
Disables blinking (pauses and resets the blink track).
void AlignObjectFace(Object3D *obj, float rotation=0.0f, float margin=2.0f, bool mirror=true)
Aligns a single Object3D to the "face" camera bounds with scaling.
float GetFaceScale()
Computes the face scaling based on a user-defined face size.
void AddViseme(Viseme::MouthShape visemeName, float *parameter)
Adds a viseme parameter to the animator (for mouth shapes).
HeadsUpDisplay hud
Heads-up display (HUD) for the face overlay or additional data.
void AddMaterialFrame(Color color, float opacity=0.8f)
Adds a new material frame to the face's MaterialAnimator from a color enum.
void AddBlinkParameter(float *blinkParameter)
Adds a float parameter to the blink track for controlling blinking.
void AddParameterFrame(uint16_t ProjectIndex, float target)
Adds a frame target to a previously added parameter.
Transform GetAlignmentTransform(Vector2D min, Vector2D max, Object3D *obj, float rotation=0.0f, float margin=2.0f)
Computes a transform for aligning a single Object3D within the given bounds.
Material * GetFaceMaterial()
Retrieves the current face material animator.
Represents an RGB color and provides methods for manipulation.
void AddObject(Object3D *object)
Adds a 3D object to the scene.
A material that applies a single, solid RGB color to surfaces.
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.
@ SS
Mouth shape corresponding to the "SS" sound (optional).
@ EE
Mouth shape corresponding to the "EE" sound.