![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
A default project template that includes functionality for an analog microphone, APDS9960 boop sensor, and button control. It provides a small-scale 3D rendering environment and various material animations for prototyping. More...
#include <ProtogenProjectTemplate.h>
Public Member Functions | |
ProtogenProject (CameraManager *cameras, Controller *controller, uint8_t numObjects, Vector2D camMin, Vector2D camMax, uint8_t microphonePin, uint8_t buttonPin, uint8_t faceCount) | |
Constructs a ProtogenProject instance. | |
void | Initialize () override |
Initializes the ProtogenProject, setting up sensors, menus, and hardware. | |
virtual void | SpectrumAnalyzerCallback ()=0 |
Callback invoked when the Spectrum Analyzer face is enabled/updated. | |
virtual void | AudioReactiveGradientCallback ()=0 |
Callback invoked when the Audio Reactive Gradient face is enabled/updated. | |
virtual void | OscilloscopeCallback ()=0 |
Callback invoked when the Oscilloscope face is enabled/updated. | |
![]() | |
Project (CameraManager *cameras, Controller *controller, uint8_t numObjects) | |
Constructs a Project with specified camera manager and controller. | |
float | GetAnimationTime () |
Retrieves the time spent on animations. | |
float | GetRenderTime () |
Retrieves the time spent on rendering. | |
float | GetDisplayTime () |
Retrieves the time spent on display operations. | |
float | GetFrameRate () |
Retrieves the current frame rate. | |
void | Animate (float ratio) |
Animates the project state based on the given ratio. | |
void | Render () |
Renders the scene. | |
void | Display () |
Updates the display with the rendered content. | |
void | PrintStats () |
Prints performance statistics such as frame rate and operation times. | |
Protected Types | |
enum | Color { CBASE , CYELLOW , CORANGE , CWHITE , CGREEN , CPURPLE , CRED , CBLUE , CRAINBOW , CRAINBOWNOISE , CHORIZONTALRAINBOW , CBLACK } |
Enumeration of different color states for the face material. More... | |
Protected Member Functions | |
virtual void | LinkControlParameters ()=0 |
Links external or user-defined control parameters (pure virtual to be implemented). | |
void | UpdateFace (float ratio) |
Updates the face's rendered content, reading any user input and applying changes. | |
void | SetCameraMain (Vector2D min, Vector2D max) |
Sets the camera bounds for the main (front) view. | |
void | SetCameraRear (Vector2D min, Vector2D max) |
Sets the camera bounds for the rear view. | |
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. | |
Transform | GetAlignmentTransform (Vector2D min, Vector2D max, Object3D **objects, uint8_t objectCount, float rotation=0.0f, float margin=2.0f) |
Computes a transform for aligning multiple Object3D objects within the given bounds. | |
void | AlignObject (Vector2D min, Vector2D max, Object3D *obj, float rotation=0.0f, float margin=2.0f, bool mirror=true) |
Aligns a single Object3D within the given bounds, applying scaling. | |
void | AlignObjects (Vector2D min, Vector2D max, Object3D **objects, uint8_t objectCount, float rotation=0.0f, float margin=2.0f, bool mirror=true) |
Aligns multiple Object3D objects, applying scaling. | |
void | AlignObjectNoScale (Vector2D min, Vector2D max, Object3D *obj, float rotation=0.0f, float margin=2.0f, bool mirror=true) |
Aligns a single Object3D without scaling. | |
void | AlignObjectsNoScale (Vector2D min, Vector2D max, Object3D **objects, uint8_t objectCount, float rotation=0.0f, float margin=2.0f, bool mirror=true) |
Aligns multiple Object3D objects without scaling. | |
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. | |
void | AlignObjectsFace (Object3D **objects, uint8_t objectCount, float rotation=0.0f, float margin=2.0f, bool mirror=true) |
Aligns multiple Object3D objects to the "face" camera bounds with scaling. | |
void | AlignObjectNoScaleFace (Object3D *obj, float rotation=0.0f, float margin=2.0f, bool mirror=true) |
Aligns a single Object3D to the "face" camera bounds without scaling. | |
void | AlignObjectsNoScaleFace (Object3D **objects, uint8_t objectCount, float rotation=0.0f, float margin=2.0f, bool mirror=true) |
Aligns multiple Object3D objects to the "face" camera bounds without scaling. | |
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 | AlignObjectsRear (Object3D **objects, uint8_t objectCount, float rotation=0.0f, float margin=2.0f, bool mirror=true) |
Aligns multiple Object3D objects to the rear camera bounds with scaling. | |
void | AlignObjectNoScaleRear (Object3D *obj, float rotation=0.0f, float margin=2.0f, bool mirror=true) |
Aligns a single Object3D to the rear camera bounds without scaling. | |
void | AlignObjectsNoScaleRear (Object3D **objects, uint8_t objectCount, float rotation=0.0f, float margin=2.0f, bool mirror=true) |
Aligns multiple Object3D objects to the rear camera bounds without scaling. | |
ObjectAlign * | GetObjectAlign () |
Gets the generic ObjectAlign instance. | |
ObjectAlign * | GetObjectAlignFace () |
Gets the ObjectAlign instance for the face camera. | |
ObjectAlign * | GetObjectAlignRear () |
Gets the ObjectAlign instance for the rear camera. | |
float | GetFaceScale () |
Computes the face scaling based on a user-defined face size. | |
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 | AddViseme (Viseme::MouthShape visemeName, float *parameter) |
Adds a viseme parameter to the animator (for mouth shapes). | |
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. | |
void | AddMaterial (Material::Method method, Material *material, uint16_t frames=20, float minOpacity=0.0f, float maxOpacity=1.0f) |
Adds a new material to the face's MaterialAnimator with given parameters. | |
void | AddMaterialFrame (Color color, float opacity=0.8f) |
Adds a new material frame to the face's MaterialAnimator from a color enum. | |
void | AddMaterialFrame (Material &material, float opacity=1.0f) |
Adds a new material frame to the face's MaterialAnimator from a Material reference. | |
void | AddBackgroundMaterial (Material::Method method, Material *material, uint16_t frames=20, float minOpacity=0.0f, float maxOpacity=1.0f) |
Adds a new material to the background's MaterialAnimator with given parameters. | |
void | AddBackgroundMaterialFrame (Color color, float opacity=0.8f) |
Adds a material frame to the background from a color enum. | |
void | AddBackgroundMaterialFrame (Material &material, float opacity=1.0f) |
Adds a material frame to the background from a Material reference. | |
void | SpectrumAnalyzerFace () |
Enables the Spectrum Analyzer on the face, updating offsets and calling callbacks. | |
void | AudioReactiveGradientFace () |
Enables the Audio Reactive Gradient on the face, updating offsets and calling callbacks. | |
void | OscilloscopeFace () |
Enables the Oscilloscope on the face, updating offsets and calling callbacks. | |
void | HideFace () |
Hides the face by setting its offset parameter. | |
void | DisableBlinking () |
Disables blinking (pauses and resets the blink track). | |
void | EnableBlinking () |
Enables blinking (resets and plays the blink track). | |
bool | IsBooped () |
Checks if the sensor has detected a boop. | |
Vector3D | GetWiggleOffset () |
Computes and returns a Vector3D offset for a "wiggle" effect using function generators. | |
void | SetWiggleSpeed (float multiplier) |
Sets the overall wiggle speed for both X and Y function generators. | |
void | SetMenuWiggleSpeed (float multiplierX, float multiplierY, float multiplierR) |
Adjusts the menu's wiggle speed along X, Y, and rotation. | |
void | SetMenuOffset (Vector2D offset) |
Sets the menu's position offset. | |
void | SetMenuSize (Vector2D size) |
Sets the menu's size. | |
Material * | GetFaceMaterial () |
Retrieves the current face material animator. | |
Material * | GetBackgroundMaterial () |
Retrieves the current background material animator. | |
![]() | |
virtual void | Update (float ratio)=0 |
Updates the project state based on the given ratio. | |
void | RenderStartTimer () |
Starts the render timer for measuring render performance. | |
void | RenderEndTimer () |
Stops the render timer and records the elapsed time. | |
Protected Attributes | |
EasyEaseAnimator< 60 > | eEA = EasyEaseAnimator<60>(IEasyEaseAnimator::Overshoot, 1.0f, 0.35f) |
Animator that eases parameter transitions. | |
HeadsUpDisplay | hud = HeadsUpDisplay(Vector2D(0.0f, 0.0f), Vector2D(192.0f, 96.0f)) |
Heads-up display (HUD) for the face overlay or additional data. | |
![]() | |
CameraManager * | cameras |
Pointer to the CameraManager for managing cameras. | |
Controller * | controller |
Pointer to the Controller for controlling the display. | |
Scene | scene |
The Scene object representing the rendered environment. | |
RunningAverageFilter< 50 > | avgFPS = RunningAverageFilter<50>(0.05f) |
Running average filter for frame rate calculation. | |
long | previousAnimationTime = 0 |
Time of the previous animation frame in microseconds. | |
long | previousRenderTime = 0 |
Time of the previous render frame in microseconds. | |
long | previousDisplayTime = 0 |
Time of the previous display frame in microseconds. | |
float | fade = 0.0f |
Fade parameter for animations. | |
float | animationTime = 0.0f |
Time spent on animation in milliseconds. | |
float | renderTime = 0.0f |
Time spent on rendering in milliseconds. | |
float | displayTime = 0.0f |
Time spent on display in milliseconds. | |
Private Member Functions | |
void | LinkParameters () |
Links internal parameters to the EasyEaseAnimator or other controllers. | |
void | SetBaseMaterial (Material *material) |
Sets the base material for the face material animator. | |
void | SetMaterialLayers () |
Sets up the initial layering of materials for both the face and background. | |
void | UpdateKeyFrameTracks () |
Updates any keyframe tracks (e.g., blink track). | |
void | UpdateFFTVisemes () |
Updates FFT-based visemes for voice detection and mouth shape animations. | |
void | SetMaterialColor () |
Sets the material color based on menu selection, applying color changes. | |
Private Attributes | |
Background | background |
Background object and associated 3D model. | |
Vector2D | camMin = Vector2D(0.0f, 0.0f) |
Minimum and maximum bounds for the primary (front) camera view. | |
Vector2D | camMax = Vector2D(189.0f, 93.0f) |
Front camera maximum bounds. | |
Vector2D | camMinRear = Vector2D(214.0f, 5.0f) |
Minimum and maximum bounds for the rear camera view. | |
Vector2D | camMaxRear = Vector2D(279.0f, 100.0f) |
Rear camera maximum bounds. | |
bool | isBooped = false |
Flag to indicate if the APDS9960 sensor has detected a "boop". | |
bool | blinkSet = false |
Flag to indicate if the blink parameter has been set. | |
Vector2D | cameraSize |
The size of the camera used for rendering calculations. | |
float | xOffset = 0.0f |
Offsets used for small "wiggle" or motion in the scene. | |
float | yOffset = 0.0f |
Y-axis offset. | |
uint8_t | microphonePin = 0 |
Pin assignments and face count. | |
uint8_t | buttonPin = 0 |
Pin for the button input. | |
uint8_t | faceCount = 10 |
Total number of faces available (e.g., for UI or animations). | |
FlowNoise | flowNoise |
Noise-based animated material. | |
RainbowSpiral | rainbowSpiral |
Spiral rainbow animated material. | |
HorizontalRainbow | hRainbow |
Horizontal rainbow animated material. | |
SimpleMaterial | redMaterial = SimpleMaterial(RGBColor(255, 0, 0)) |
Solid red material. | |
SimpleMaterial | orangeMaterial = SimpleMaterial(RGBColor(255, 165, 0)) |
Solid orange material. | |
SimpleMaterial | whiteMaterial = SimpleMaterial(RGBColor(255, 255, 255)) |
Solid white material. | |
SimpleMaterial | greenMaterial = SimpleMaterial(RGBColor(0, 255, 0)) |
Solid green material. | |
SimpleMaterial | blueMaterial = SimpleMaterial(RGBColor(0, 0, 255)) |
Solid blue material. | |
SimpleMaterial | yellowMaterial = SimpleMaterial(RGBColor(255, 255, 0)) |
Solid yellow material. | |
SimpleMaterial | purpleMaterial = SimpleMaterial(RGBColor(255, 0, 255)) |
Solid purple material. | |
SimpleMaterial | blackMaterial = SimpleMaterial(RGBColor(0, 0, 0)) |
Solid black material. | |
RGBColor | gradientSpectrum [2] = {RGBColor(255, 0, 0), RGBColor(255, 0, 0)} |
Gradient used for color transitions. | |
GradientMaterial< 2 > | gradientMat = GradientMaterial<2>(gradientSpectrum, 350.0f, false) |
MaterialAnimator< 20 > | materialAnimator |
Material animators for face and background layering. | |
MaterialAnimator< 20 > | backgroundMaterial |
Handles layering of background materials. | |
SpectrumAnalyzer | sA = SpectrumAnalyzer(Vector2D(200, 100), Vector2D(100, 50), true, true) |
Audio-reactive materials. | |
AudioReactiveGradient | aRG = AudioReactiveGradient(Vector2D(160, 160), Vector2D(0, 0), true, true) |
Oscilloscope | oSC = Oscilloscope(Vector2D(200, 100), Vector2D(0, 0)) |
BlinkTrack< 2 > | blink |
Blink track handler. | |
ObjectAlign | objA = ObjectAlign(camMin, camMax, Quaternion()) |
Object alignment for the front, rear, and an additional alignment object. | |
ObjectAlign | objARear = ObjectAlign(camMinRear, camMaxRear, Quaternion()) |
Alignment for the rear camera. | |
ObjectAlign | objAOther = ObjectAlign(Vector2D(), Vector2D(), Quaternion()) |
Generic alignment object. | |
FunctionGenerator | fGenMatXMove = FunctionGenerator(FunctionGenerator::Sine, -2.0f, 2.0f, 5.3f) |
Function generators for X/Y wiggle movements. | |
FunctionGenerator | fGenMatYMove = FunctionGenerator(FunctionGenerator::Sine, -2.0f, 2.0f, 6.7f) |
FanController | fanController = FanController(15) |
Fan controller for controlling a fan's PWM. | |
APDS9960 | boop |
Gesture sensor used for detecting "boops.". | |
FFTVoiceDetection< 128 > | voiceDetection |
Voice detection system based on FFT data. | |
float | offsetFace = 0.0f |
Facial offset parameters for layering advanced materials (e.g., Spectrum Analyzer). | |
float | offsetFaceSA = 0.0f |
Offset for SpectrumAnalyzer face. | |
float | offsetFaceARG = 0.0f |
Offset for AudioReactiveGradient face. | |
float | offsetFaceOSC = 0.0f |
Offset for Oscilloscope face. | |
uint8_t | offsetFaceInd = 50 |
Index for generic face offset in EasyEaseAnimator. | |
uint8_t | offsetFaceIndSA = 51 |
Index for SpectrumAnalyzer offset in EasyEaseAnimator. | |
uint8_t | offsetFaceIndARG = 52 |
Index for AudioReactiveGradient offset in EasyEaseAnimator. | |
uint8_t | offsetFaceIndOSC = 53 |
Index for Oscilloscope offset in EasyEaseAnimator. | |
TimeStep | frameLimiter = TimeStep(120) |
A TimeStep object to limit frames (e.g., to 120 FPS). | |
A default project template that includes functionality for an analog microphone, APDS9960 boop sensor, and button control. It provides a small-scale 3D rendering environment and various material animations for prototyping.
This class inherits from Project and extends it with additional features:
Definition at line 54 of file ProtogenProjectTemplate.h.
Enumeration of different color states for the face material.
Definition at line 218 of file ProtogenProjectTemplate.h.
ProtogenProject | ( | CameraManager * | cameras, |
Controller * | controller, | ||
uint8_t | numObjects, | ||
Vector2D | camMin, | ||
Vector2D | camMax, | ||
uint8_t | microphonePin, | ||
uint8_t | buttonPin, | ||
uint8_t | faceCount | ||
) |
Constructs a ProtogenProject instance.
cameras | Pointer to the project's CameraManager. |
controller | Pointer to the main Controller. |
numObjects | Number of objects (including extra for internal usage). |
camMin | The minimum 2D bounds for the main camera. |
camMax | The maximum 2D bounds for the main camera. |
microphonePin | The pin used for the microphone. |
buttonPin | The pin used for the button. |
faceCount | The number of faces for possible UI or animations. |
Definition at line 517 of file ProtogenProjectTemplate.cpp.
References Scene::AddObject(), background, backgroundMaterial, buttonPin, cameraSize, camMax, camMin, Scene::EnableEffect(), faceCount, hud, LinkParameters(), microphonePin, objA, oSC, sA, Project::scene, ObjectAlign::SetCameraMax(), ObjectAlign::SetCameraMin(), HeadsUpDisplay::SetFaceMax(), HeadsUpDisplay::SetFaceMin(), ObjectAlign::SetJustification(), SetMaterialLayers(), Oscilloscope::SetPosition(), SpectrumAnalyzer::SetPosition(), Oscilloscope::SetSize(), SpectrumAnalyzer::SetSize(), and ObjectAlign::Stretch.
|
protected |
Adds a new material to the background's MaterialAnimator with given parameters.
method | The blend method. |
material | The material to add. |
frames | Transition frames. |
minOpacity | Minimum opacity. |
maxOpacity | Maximum opacity. |
Definition at line 386 of file ProtogenProjectTemplate.cpp.
References MaterialAnimator< materialCount >::AddMaterial(), and backgroundMaterial.
Referenced by UnicornZhenjaAnimation::UnicornZhenjaAnimation().
Adds a material frame to the background from a color enum.
color | The color enum to switch to. |
opacity | The target opacity. |
Definition at line 390 of file ProtogenProjectTemplate.cpp.
References MaterialAnimator< materialCount >::AddMaterialFrame(), backgroundMaterial, blackMaterial, blueMaterial, CBLACK, CBLUE, CGREEN, CHORIZONTALRAINBOW, CORANGE, CPURPLE, CRAINBOW, CRAINBOWNOISE, CRED, CWHITE, CYELLOW, flowNoise, greenMaterial, hRainbow, orangeMaterial, purpleMaterial, rainbowSpiral, redMaterial, whiteMaterial, and yellowMaterial.
Referenced by BetaProject::Crash(), and UnicornZhenjaAnimation::Static().
Adds a material frame to the background from a Material reference.
material | The material to add. |
opacity | The target opacity. |
Definition at line 430 of file ProtogenProjectTemplate.cpp.
References MaterialAnimator< materialCount >::AddMaterialFrame(), and backgroundMaterial.
Adds a float parameter to the blink track for controlling blinking.
blinkParameter | Pointer to the float controlling blinking. |
Definition at line 328 of file ProtogenProjectTemplate.cpp.
References AnimationTrack< maxParameters, maxKeyFrames >::AddParameter(), blink, and blinkSet.
Referenced by AceAnimation::LinkControlParameters(), ArrowAnimation::LinkControlParameters(), DrGonzoProject::LinkControlParameters(), DrGonzoTest::LinkControlParameters(), SageAnimation::LinkControlParameters(), UnicornZhenjaAnimation::LinkControlParameters(), FursuitEyesV1::LinkControlParameters(), BetaProject::LinkControlParameters(), ProtogenHUB75Project::LinkControlParameters(), and ProtogenWS35Project::LinkControlParameters().
|
protected |
Adds a new material to the face's MaterialAnimator with given parameters.
method | The blend method (e.g., Material::Add, Material::Replace). |
material | Pointer to the material to add. |
frames | How many frames the transition will take. |
minOpacity | The minimum opacity. |
maxOpacity | The maximum opacity. |
Definition at line 338 of file ProtogenProjectTemplate.cpp.
References MaterialAnimator< materialCount >::AddMaterial(), and materialAnimator.
Referenced by SplatAnimation::SplatAnimation(), and UnicornZhenjaAnimation::UnicornZhenjaAnimation().
Adds a new material frame to the face's MaterialAnimator from a color enum.
color | The color enum to switch to. |
opacity | The target opacity for that color material. |
Definition at line 342 of file ProtogenProjectTemplate.cpp.
References MaterialAnimator< materialCount >::AddMaterialFrame(), blackMaterial, blueMaterial, CBLACK, CBLUE, CGREEN, CHORIZONTALRAINBOW, CORANGE, CPURPLE, CRAINBOW, CRAINBOWNOISE, CRED, CWHITE, CYELLOW, flowNoise, greenMaterial, hRainbow, materialAnimator, orangeMaterial, purpleMaterial, rainbowSpiral, redMaterial, whiteMaterial, and yellowMaterial.
Referenced by BetaProject::AlphaGenCircle(), ArrowAnimation::Angry(), DrGonzoTest::Angry(), SplatAnimation::Angry(), FursuitEyesV1::Angry(), ProtogenHUB75Project::Angry(), ProtogenWS35Project::Angry(), SageAnimation::Angry2(), SageAnimation::Angry3(), BetaProject::AngryFace(), BetaProject::AudioReactiveGradientCallback(), ProtogenHUB75Project::AudioReactiveGradientCallback(), ProtogenWS35Project::AudioReactiveGradientCallback(), AceAnimation::Blush(), SplatAnimation::Confused(), BetaProject::Crash(), UnicornZhenjaAnimation::Dead(), BetaProject::Dead(), SplatAnimation::Default(), UnicornZhenjaAnimation::Default(), SplatAnimation::Disappointed(), UnicornZhenjaAnimation::Dizzy(), BetaProject::Dizzy(), FursuitEyesV1::Dot(), ArrowAnimation::Excited(), SplatAnimation::Excited(), BetaProject::Frustrated(), SplatAnimation::FullCircle(), BetaProject::Gentle(), ArrowAnimation::Happy(), ArrowAnimation::Heart(), SplatAnimation::Heart(), UnicornZhenjaAnimation::Heart(), BetaProject::Heart(), SplatAnimation::HollowCircle(), DrGonzoProject::Loading(), UnicornZhenjaAnimation::Loading(), BetaProject::OscilloscopeCallback(), ProtogenHUB75Project::OscilloscopeCallback(), ProtogenWS35Project::OscilloscopeCallback(), ArrowAnimation::Owo(), BetaProject::OwO(), BetaProject::OwO2(), UnicornZhenjaAnimation::Pupil(), DrGonzoTest::Sad(), UnicornZhenjaAnimation::Sad(), BetaProject::Sad(), ProtogenHUB75Project::Sad(), ProtogenWS35Project::Sad(), UnicornZhenjaAnimation::Salty(), BetaProject::Shocked(), SplatAnimation::Sleepy(), UnicornZhenjaAnimation::Sleepy(), BetaProject::SpectrumAnalyzerCallback(), ProtogenHUB75Project::SpectrumAnalyzerCallback(), ProtogenWS35Project::SpectrumAnalyzerCallback(), BetaProject::StandbyF(), UnicornZhenjaAnimation::Static(), DrGonzoTest::Surprised(), ProtogenHUB75Project::Surprised(), ProtogenWS35Project::Surprised(), UnicornZhenjaAnimation::Update(), UnicornZhenjaAnimation::Upset(), and ArrowAnimation::Uwu().
Adds a new material frame to the face's MaterialAnimator from a Material reference.
material | A reference to the material to add. |
opacity | The target opacity. |
Definition at line 382 of file ProtogenProjectTemplate.cpp.
References MaterialAnimator< materialCount >::AddMaterialFrame(), and materialAnimator.
|
protected |
Adds a parameter to the EasyEaseAnimator for interpolation.
index | The parameter index within the animator. |
parameter | Pointer to the float parameter to animate. |
transitionFrames | How many frames the transition should take. |
interpolationMethod | The interpolation method (overshoot, linear, etc.). |
invertDirection | Whether to invert the animation (1.0f to 0.0f). |
Definition at line 311 of file ProtogenProjectTemplate.cpp.
References EasyEaseAnimator< maxParameters >::AddParameter(), eEA, and EasyEaseAnimator< maxParameters >::SetInterpolationMethod().
Referenced by AceAnimation::LinkControlParameters(), ArrowAnimation::LinkControlParameters(), DrGonzoProject::LinkControlParameters(), DrGonzoTest::LinkControlParameters(), SageAnimation::LinkControlParameters(), SplatAnimation::LinkControlParameters(), UnicornZhenjaAnimation::LinkControlParameters(), FursuitEyesV1::LinkControlParameters(), BetaProject::LinkControlParameters(), ProtogenHUB75Project::LinkControlParameters(), and ProtogenWS35Project::LinkControlParameters().
Adds a frame target to a previously added parameter.
ProjectIndex | The index for the parameter. |
target | The target value for that parameter. |
Definition at line 334 of file ProtogenProjectTemplate.cpp.
References EasyEaseAnimator< maxParameters >::AddParameterFrame(), and eEA.
Referenced by BetaProject::AlphaGenCircle(), AceAnimation::Angry(), ArrowAnimation::Angry(), DrGonzoTest::Angry(), SplatAnimation::Angry(), FursuitEyesV1::Angry(), ProtogenHUB75Project::Angry(), ProtogenWS35Project::Angry(), SageAnimation::Angry1(), SageAnimation::Angry2(), SageAnimation::Angry3(), BetaProject::AngryFace(), DrGonzoProject::Angy(), AceAnimation::Blush(), SageAnimation::Blush(), DrGonzoProject::Boop(), FursuitEyesV1::Close(), SplatAnimation::Confused(), AceAnimation::Content(), BetaProject::Crash(), UnicornZhenjaAnimation::Dead(), BetaProject::Dead(), UnicornZhenjaAnimation::Default(), BetaProject::Default(), FursuitEyesV1::Disappoint(), SplatAnimation::Disappointed(), DrGonzoProject::Dizzy(), SageAnimation::Dizzy(), UnicornZhenjaAnimation::Dizzy(), BetaProject::Dizzy(), FursuitEyesV1::Dot(), DrGonzoTest::Doubt(), ProtogenHUB75Project::Doubt(), ProtogenWS35Project::Doubt(), ArrowAnimation::Excited(), SplatAnimation::Excited(), DrGonzoTest::Frown(), ProtogenHUB75Project::Frown(), ProtogenWS35Project::Frown(), BetaProject::Frustrated(), SplatAnimation::FullCircle(), BetaProject::Gentle(), AceAnimation::Happy(), ArrowAnimation::Happy(), DrGonzoProject::Happy(), ArrowAnimation::Heart(), SplatAnimation::Heart(), UnicornZhenjaAnimation::Heart(), FursuitEyesV1::Heart(), BetaProject::Heart(), SplatAnimation::HollowCircle(), DrGonzoProject::Lewd(), DrGonzoProject::Loading(), UnicornZhenjaAnimation::Loading(), DrGonzoTest::LookDown(), ProtogenHUB75Project::LookDown(), ProtogenWS35Project::LookDown(), DrGonzoTest::LookUp(), ProtogenHUB75Project::LookUp(), ProtogenWS35Project::LookUp(), ArrowAnimation::Owo(), DrGonzoProject::OwO(), SageAnimation::OwO(), BetaProject::OwO(), BetaProject::OwO2(), UnicornZhenjaAnimation::Pupil(), DrGonzoProject::Question(), FursuitEyesV1::Question(), DrGonzoProject::Sad(), DrGonzoTest::Sad(), SageAnimation::Sad(), UnicornZhenjaAnimation::Sad(), FursuitEyesV1::Sad(), BetaProject::Sad(), ProtogenHUB75Project::Sad(), ProtogenWS35Project::Sad(), UnicornZhenjaAnimation::Salty(), AceAnimation::Scrunchy(), AceAnimation::Seriously(), BetaProject::Shocked(), SplatAnimation::Sleepy(), UnicornZhenjaAnimation::Sleepy(), AceAnimation::Smirk(), BetaProject::StandbyF(), UnicornZhenjaAnimation::Static(), AceAnimation::Surprised(), DrGonzoTest::Surprised(), SageAnimation::Surprised(), ProtogenHUB75Project::Surprised(), ProtogenWS35Project::Surprised(), SageAnimation::Tired(), ArrowAnimation::Unamused(), UnicornZhenjaAnimation::Upset(), and ArrowAnimation::Uwu().
|
protected |
Adds a viseme parameter to the animator (for mouth shapes).
visemeName | The mouth shape (e.g., Viseme::EE, Viseme::AH, etc.). |
parameter | Pointer to the float parameter controlling that viseme. |
Definition at line 322 of file ProtogenProjectTemplate.cpp.
References EasyEaseAnimator< maxParameters >::AddParameter(), eEA, IEasyEaseAnimator::Linear, and EasyEaseAnimator< maxParameters >::SetInterpolationMethod().
Referenced by AceAnimation::LinkControlParameters(), ArrowAnimation::LinkControlParameters(), DrGonzoProject::LinkControlParameters(), DrGonzoTest::LinkControlParameters(), SageAnimation::LinkControlParameters(), SplatAnimation::LinkControlParameters(), UnicornZhenjaAnimation::LinkControlParameters(), FursuitEyesV1::LinkControlParameters(), BetaProject::LinkControlParameters(), ProtogenHUB75Project::LinkControlParameters(), and ProtogenWS35Project::LinkControlParameters().
|
protected |
Aligns a single Object3D within the given bounds, applying scaling.
min | The minimum 2D bounds. |
max | The maximum 2D bounds. |
obj | Pointer to the Object3D to align. |
rotation | Rotation to apply. |
margin | Margin spacing. |
mirror | Whether to mirror the object along the X-axis. |
Definition at line 190 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::AlignObject(), objAOther, ObjectAlign::SetCameraMax(), ObjectAlign::SetCameraMin(), ObjectAlign::SetEdgeMargin(), ObjectAlign::SetMirrorX(), and ObjectAlign::SetPlaneOffsetAngle().
Referenced by DrGonzoTest::Update(), and FursuitEyesV1::Update().
|
protected |
Aligns a single Object3D to the "face" camera bounds with scaling.
obj | Pointer to the Object3D to align. |
rotation | Rotation to apply. |
margin | Margin spacing. |
mirror | Whether to mirror along the X-axis. |
Definition at line 234 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::AlignObject(), objA, ObjectAlign::SetEdgeMargin(), ObjectAlign::SetMirrorX(), and ObjectAlign::SetPlaneOffsetAngle().
Referenced by AceAnimation::Update(), ArrowAnimation::Update(), DrGonzoProject::Update(), SageAnimation::Update(), SplatAnimation::Update(), UnicornZhenjaAnimation::Update(), BetaProject::Update(), ProtogenHUB75Project::Update(), and ProtogenWS35Project::Update().
|
protected |
Aligns a single Object3D without scaling.
min | The minimum 2D bounds. |
max | The maximum 2D bounds. |
obj | Pointer to the Object3D to align. |
rotation | Rotation to apply. |
margin | Margin spacing. |
mirror | Whether to mirror the object along the X-axis. |
Definition at line 212 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::AlignObjectNoScale(), objAOther, ObjectAlign::SetCameraMax(), ObjectAlign::SetCameraMin(), ObjectAlign::SetEdgeMargin(), ObjectAlign::SetMirrorX(), and ObjectAlign::SetPlaneOffsetAngle().
|
protected |
Aligns a single Object3D to the "face" camera bounds without scaling.
obj | Pointer to the Object3D to align. |
rotation | Rotation to apply. |
margin | Margin spacing. |
mirror | Whether to mirror along the X-axis. |
Definition at line 248 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::AlignObjectNoScale(), objA, ObjectAlign::SetEdgeMargin(), ObjectAlign::SetMirrorX(), and ObjectAlign::SetPlaneOffsetAngle().
|
protected |
Aligns a single Object3D to the rear camera bounds without scaling.
obj | Pointer to the Object3D to align. |
rotation | Rotation to apply. |
margin | Margin spacing. |
mirror | Whether to mirror along the X-axis. |
Definition at line 276 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::AlignObjectNoScale(), objARear, ObjectAlign::SetEdgeMargin(), ObjectAlign::SetMirrorX(), and ObjectAlign::SetPlaneOffsetAngle().
Referenced by SageAnimation::Update().
|
protected |
Aligns a single Object3D to the rear camera bounds with scaling.
obj | Pointer to the Object3D to align. |
rotation | Rotation to apply. |
margin | Margin spacing. |
mirror | Whether to mirror along the X-axis. |
Definition at line 262 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::AlignObject(), objARear, ObjectAlign::SetEdgeMargin(), ObjectAlign::SetMirrorX(), and ObjectAlign::SetPlaneOffsetAngle().
Referenced by DrGonzoProject::Update(), and BetaProject::Update().
|
protected |
Aligns multiple Object3D objects, applying scaling.
min | The minimum 2D bounds. |
max | The maximum 2D bounds. |
objects | Array of Object3D pointers. |
objectCount | Number of objects. |
rotation | Rotation to apply. |
margin | Margin spacing. |
mirror | Whether to mirror along the X-axis. |
Definition at line 201 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::AlignObjects(), objAOther, ObjectAlign::SetCameraMax(), ObjectAlign::SetCameraMin(), ObjectAlign::SetEdgeMargin(), ObjectAlign::SetMirrorX(), and ObjectAlign::SetPlaneOffsetAngle().
|
protected |
Aligns multiple Object3D objects to the "face" camera bounds with scaling.
objects | Array of Object3D pointers. |
objectCount | Number of objects. |
rotation | Rotation to apply. |
margin | Margin spacing. |
mirror | Whether to mirror along the X-axis. |
Definition at line 241 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::AlignObjects(), objA, ObjectAlign::SetEdgeMargin(), ObjectAlign::SetMirrorX(), and ObjectAlign::SetPlaneOffsetAngle().
|
protected |
Aligns multiple Object3D objects without scaling.
min | The minimum 2D bounds. |
max | The maximum 2D bounds. |
objects | Array of Object3D pointers. |
objectCount | Number of objects. |
rotation | Rotation to apply. |
margin | Margin spacing. |
mirror | Whether to mirror along the X-axis. |
Definition at line 223 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::AlignObjectsNoScale(), objAOther, ObjectAlign::SetCameraMax(), ObjectAlign::SetCameraMin(), ObjectAlign::SetEdgeMargin(), ObjectAlign::SetMirrorX(), and ObjectAlign::SetPlaneOffsetAngle().
Referenced by AceAnimation::Update().
|
protected |
Aligns multiple Object3D objects to the "face" camera bounds without scaling.
objects | Array of Object3D pointers. |
objectCount | Number of objects. |
rotation | Rotation to apply. |
margin | Margin spacing. |
mirror | Whether to mirror along the X-axis. |
Definition at line 255 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::AlignObjectsNoScale(), objA, ObjectAlign::SetEdgeMargin(), ObjectAlign::SetMirrorX(), and ObjectAlign::SetPlaneOffsetAngle().
|
protected |
Aligns multiple Object3D objects to the rear camera bounds without scaling.
objects | Array of Object3D pointers. |
objectCount | Number of objects. |
rotation | Rotation to apply. |
margin | Margin spacing. |
mirror | Whether to mirror along the X-axis. |
Definition at line 283 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::AlignObjectsNoScale(), objARear, ObjectAlign::SetEdgeMargin(), ObjectAlign::SetMirrorX(), and ObjectAlign::SetPlaneOffsetAngle().
|
protected |
Aligns multiple Object3D objects to the rear camera bounds with scaling.
objects | Array of Object3D pointers. |
objectCount | Number of objects. |
rotation | Rotation to apply. |
margin | Margin spacing. |
mirror | Whether to mirror along the X-axis. |
Definition at line 269 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::AlignObjects(), objARear, ObjectAlign::SetEdgeMargin(), ObjectAlign::SetMirrorX(), and ObjectAlign::SetPlaneOffsetAngle().
Callback invoked when the Audio Reactive Gradient face is enabled/updated.
This method is pure virtual and must be implemented by the derived class to define custom behavior upon enabling or updating the Audio Reactive Gradient face.
Implemented in ArrowAnimation, SplatAnimation, BetaProject, ProtogenHUB75Project, and ProtogenWS35Project.
Referenced by AudioReactiveGradientFace().
|
protected |
Enables the Audio Reactive Gradient on the face, updating offsets and calling callbacks.
Definition at line 446 of file ProtogenProjectTemplate.cpp.
References MaterialAnimator< materialCount >::AddMaterialFrame(), EasyEaseAnimator< maxParameters >::AddParameterFrame(), aRG, AudioReactiveGradientCallback(), backgroundMaterial, eEA, MicrophoneFourierBase::GetFourierFiltered(), materialAnimator, offsetFaceARG, offsetFaceInd, offsetFaceIndARG, and AudioReactiveGradient::Update().
Referenced by ArrowAnimation::SelectFace(), SplatAnimation::SelectFace(), BetaProject::SelectFace(), ProtogenHUB75Project::SelectFace(), ProtogenHUB75Project::SelectFaceFromMorse(), AceAnimation::Update(), DrGonzoProject::Update(), DrGonzoTest::Update(), SageAnimation::Update(), UnicornZhenjaAnimation::Update(), and ProtogenWS35Project::Update().
|
protected |
Disables blinking (pauses and resets the blink track).
Definition at line 474 of file ProtogenProjectTemplate.cpp.
References blink, AnimationTrack< maxParameters, maxKeyFrames >::Pause(), and AnimationTrack< maxParameters, maxKeyFrames >::Reset().
Referenced by SageAnimation::Blush(), FursuitEyesV1::Close(), AceAnimation::Content(), BetaProject::Crash(), BetaProject::Dead(), DrGonzoProject::Dizzy(), SageAnimation::Dizzy(), AceAnimation::Happy(), BetaProject::Heart(), DrGonzoProject::Loading(), DrGonzoProject::OwO(), SageAnimation::OwO(), BetaProject::OwO(), BetaProject::OwO2(), DrGonzoProject::Question(), FursuitEyesV1::Question(), AceAnimation::Scrunchy(), BetaProject::Shocked(), BetaProject::StandbyF(), SageAnimation::Surprised(), and SageAnimation::Tired().
|
protected |
Enables blinking (resets and plays the blink track).
Definition at line 479 of file ProtogenProjectTemplate.cpp.
References blink, AnimationTrack< maxParameters, maxKeyFrames >::Play(), and AnimationTrack< maxParameters, maxKeyFrames >::Reset().
Referenced by BetaProject::AlphaGenCircle(), FursuitEyesV1::Angry(), BetaProject::AngryFace(), FursuitEyesV1::Default(), BetaProject::Default(), FursuitEyesV1::Disappoint(), BetaProject::Dizzy(), FursuitEyesV1::Dot(), BetaProject::Frustrated(), BetaProject::Gentle(), FursuitEyesV1::Heart(), FursuitEyesV1::Sad(), BetaProject::Sad(), AceAnimation::Update(), DrGonzoProject::Update(), and SageAnimation::Update().
|
protected |
Computes a transform for aligning multiple Object3D objects within the given bounds.
min | The minimum 2D bounds (bottom-left corner). |
max | The maximum 2D bounds (top-right corner). |
objects | Pointer to an array of Object3D pointers to align. |
objectCount | The number of objects in the array. |
rotation | The rotation angle (in degrees) applied to the objects. |
margin | Additional margin (border spacing). |
Definition at line 180 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::GetTransform(), objAOther, ObjectAlign::SetCameraMax(), ObjectAlign::SetCameraMin(), ObjectAlign::SetEdgeMargin(), and ObjectAlign::SetPlaneOffsetAngle().
|
protected |
Computes a transform for aligning a single Object3D within the given bounds.
min | The minimum 2D bounds (bottom-left corner). |
max | The maximum 2D bounds (top-right corner). |
obj | Pointer to the Object3D to align. |
rotation | The rotation angle (in degrees) applied to the object. |
margin | Additional margin (border spacing). |
Definition at line 170 of file ProtogenProjectTemplate.cpp.
References ObjectAlign::GetTransform(), objAOther, ObjectAlign::SetCameraMax(), ObjectAlign::SetCameraMin(), ObjectAlign::SetEdgeMargin(), and ObjectAlign::SetPlaneOffsetAngle().
Referenced by DrGonzoProject::Update().
|
protected |
Retrieves the current background material animator.
Definition at line 513 of file ProtogenProjectTemplate.cpp.
References backgroundMaterial.
|
protected |
Retrieves the current face material animator.
Definition at line 509 of file ProtogenProjectTemplate.cpp.
References materialAnimator.
Referenced by AceAnimation::AceAnimation(), ArrowAnimation::ArrowAnimation(), BetaProject::BetaProject(), ArrowAnimation::Default(), SplatAnimation::Default(), DrGonzoProject::DrGonzoProject(), DrGonzoTest::DrGonzoTest(), FursuitEyesV1::FursuitEyesV1(), DrGonzoProject::LinkControlParameters(), ProtogenHUB75Project::ProtogenHUB75Project(), ProtogenWS35Project::ProtogenWS35Project(), SageAnimation::SageAnimation(), SplatAnimation::SplatAnimation(), and UnicornZhenjaAnimation::UnicornZhenjaAnimation().
|
protected |
Computes the face scaling based on a user-defined face size.
Definition at line 303 of file ProtogenProjectTemplate.cpp.
References Menu::GetFaceSize().
Referenced by DrGonzoProject::Update().
|
protected |
Gets the generic ObjectAlign instance.
Definition at line 291 of file ProtogenProjectTemplate.cpp.
References objAOther.
|
protected |
Gets the ObjectAlign instance for the face camera.
Definition at line 295 of file ProtogenProjectTemplate.cpp.
References objA.
|
protected |
Gets the ObjectAlign instance for the rear camera.
Definition at line 299 of file ProtogenProjectTemplate.cpp.
References objARear.
|
protected |
Computes and returns a Vector3D offset for a "wiggle" effect using function generators.
Definition at line 488 of file ProtogenProjectTemplate.cpp.
References fGenMatXMove, fGenMatYMove, and FunctionGenerator::Update().
Referenced by AceAnimation::Update(), ArrowAnimation::Update(), DrGonzoProject::Update(), DrGonzoTest::Update(), SageAnimation::Update(), SplatAnimation::Update(), UnicornZhenjaAnimation::Update(), FursuitEyesV1::Update(), BetaProject::Update(), ProtogenHUB75Project::Update(), and ProtogenWS35Project::Update().
|
protected |
Hides the face by setting its offset parameter.
Definition at line 470 of file ProtogenProjectTemplate.cpp.
References EasyEaseAnimator< maxParameters >::AddParameterFrame(), eEA, and offsetFaceInd.
Referenced by AceAnimation::Crash(), and UnicornZhenjaAnimation::Static().
|
overridevirtual |
Initializes the ProtogenProject, setting up sensors, menus, and hardware.
Implements Project.
Definition at line 557 of file ProtogenProjectTemplate.cpp.
References boop, buttonPin, Project::controller, faceCount, fanController, hud, HeadsUpDisplay::Initialize(), FanController::Initialize(), Controller::Initialize(), Menu::Initialize(), MicrophoneFourier::Initialize(), APDS9960::Initialize(), and microphonePin.
|
protected |
Checks if the sensor has detected a boop.
Definition at line 484 of file ProtogenProjectTemplate.cpp.
References isBooped.
Referenced by ArrowAnimation::SelectFace(), SplatAnimation::SelectFace(), BetaProject::SelectFace(), ProtogenHUB75Project::SelectFace(), ProtogenHUB75Project::SelectFaceFromMorse(), AceAnimation::Update(), DrGonzoProject::Update(), DrGonzoTest::Update(), SageAnimation::Update(), UnicornZhenjaAnimation::Update(), and ProtogenWS35Project::Update().
Links external or user-defined control parameters (pure virtual to be implemented).
Implemented in AceAnimation, ArrowAnimation, DrGonzoProject, DrGonzoTest, SageAnimation, SplatAnimation, UnicornZhenjaAnimation, FursuitEyesV1, BetaProject, ProtogenHUB75Project, and ProtogenWS35Project.
|
private |
Links internal parameters to the EasyEaseAnimator or other controllers.
Definition at line 3 of file ProtogenProjectTemplate.cpp.
References EasyEaseAnimator< maxParameters >::AddParameter(), eEA, offsetFace, offsetFaceARG, offsetFaceInd, offsetFaceIndARG, offsetFaceIndOSC, offsetFaceIndSA, offsetFaceOSC, and offsetFaceSA.
Referenced by ProtogenProject().
Callback invoked when the Oscilloscope face is enabled/updated.
This method is pure virtual and must be implemented by the derived class to define custom behavior upon enabling or updating the Oscilloscope face.
Implemented in ArrowAnimation, SplatAnimation, BetaProject, ProtogenHUB75Project, and ProtogenWS35Project.
Referenced by OscilloscopeFace().
|
protected |
Enables the Oscilloscope on the face, updating offsets and calling callbacks.
Definition at line 458 of file ProtogenProjectTemplate.cpp.
References MaterialAnimator< materialCount >::AddMaterialFrame(), EasyEaseAnimator< maxParameters >::AddParameterFrame(), backgroundMaterial, eEA, MicrophoneFourierBase::GetSamples(), materialAnimator, offsetFaceInd, offsetFaceIndOSC, offsetFaceOSC, oSC, OscilloscopeCallback(), and Oscilloscope::Update().
Referenced by ArrowAnimation::SelectFace(), SplatAnimation::SelectFace(), FursuitEyesV1::SelectFace(), BetaProject::SelectFace(), ProtogenHUB75Project::SelectFace(), ProtogenHUB75Project::SelectFaceFromMorse(), AceAnimation::Update(), DrGonzoProject::Update(), DrGonzoTest::Update(), SageAnimation::Update(), UnicornZhenjaAnimation::Update(), and ProtogenWS35Project::Update().
Sets the base material for the face material animator.
material | Pointer to the material to set as the base. |
Definition at line 10 of file ProtogenProjectTemplate.cpp.
References Material::Add, materialAnimator, and MaterialAnimator< materialCount >::SetBaseMaterial().
Sets the camera bounds for the main (front) view.
min | The minimum 2D bounds (bottom-left corner). |
max | The maximum 2D bounds (top-right corner). |
Definition at line 154 of file ProtogenProjectTemplate.cpp.
References camMax, camMin, objA, ObjectAlign::SetCameraMax(), and ObjectAlign::SetCameraMin().
Sets the camera bounds for the rear view.
min | The minimum 2D bounds (bottom-left corner). |
max | The maximum 2D bounds (top-right corner). |
Definition at line 162 of file ProtogenProjectTemplate.cpp.
References camMaxRear, camMinRear, objARear, ObjectAlign::SetCameraMax(), and ObjectAlign::SetCameraMin().
Referenced by BetaProject::BetaProject().
|
private |
Sets the material color based on menu selection, applying color changes.
Definition at line 69 of file ProtogenProjectTemplate.cpp.
References MaterialAnimator< materialCount >::AddMaterialFrame(), blackMaterial, blueMaterial, flowNoise, Menu::GetFaceColor(), greenMaterial, hRainbow, materialAnimator, orangeMaterial, purpleMaterial, rainbowSpiral, redMaterial, whiteMaterial, and yellowMaterial.
Referenced by UpdateFace().
|
private |
Sets up the initial layering of materials for both the face and background.
Definition at line 14 of file ProtogenProjectTemplate.cpp.
References Material::Add, MaterialAnimator< materialCount >::AddMaterial(), aRG, backgroundMaterial, blackMaterial, blueMaterial, flowNoise, Menu::GetMaterial(), gradientMat, greenMaterial, hRainbow, materialAnimator, orangeMaterial, oSC, purpleMaterial, rainbowSpiral, redMaterial, Material::Replace, sA, MaterialAnimator< materialCount >::SetBaseMaterial(), whiteMaterial, and yellowMaterial.
Referenced by ProtogenProject().
Sets the menu's position offset.
offset | The 2D offset to apply. |
Definition at line 501 of file ProtogenProjectTemplate.cpp.
References Menu::SetPositionOffset().
Referenced by ArrowAnimation::ArrowAnimation(), BetaProject::BetaProject(), DrGonzoProject::DrGonzoProject(), DrGonzoTest::DrGonzoTest(), FursuitEyesV1::FursuitEyesV1(), ProtogenHUB75Project::ProtogenHUB75Project(), ProtogenWS35Project::ProtogenWS35Project(), SplatAnimation::SplatAnimation(), UnicornZhenjaAnimation::UnicornZhenjaAnimation(), AceAnimation::Update(), and SageAnimation::Update().
Sets the menu's size.
size | The new 2D size for the menu. |
Definition at line 505 of file ProtogenProjectTemplate.cpp.
References Menu::SetSize().
Referenced by ArrowAnimation::ArrowAnimation(), BetaProject::BetaProject(), DrGonzoProject::DrGonzoProject(), DrGonzoTest::DrGonzoTest(), FursuitEyesV1::FursuitEyesV1(), ProtogenHUB75Project::ProtogenHUB75Project(), ProtogenWS35Project::ProtogenWS35Project(), SplatAnimation::SplatAnimation(), UnicornZhenjaAnimation::UnicornZhenjaAnimation(), AceAnimation::Update(), and SageAnimation::Update().
Adjusts the menu's wiggle speed along X, Y, and rotation.
multiplierX | Speed multiplier for X-axis. |
multiplierY | Speed multiplier for Y-axis. |
multiplierR | Speed multiplier for rotation. |
Definition at line 497 of file ProtogenProjectTemplate.cpp.
References Menu::SetWiggleSpeed().
Referenced by ArrowAnimation::ArrowAnimation(), BetaProject::BetaProject(), DrGonzoProject::DrGonzoProject(), DrGonzoTest::DrGonzoTest(), FursuitEyesV1::FursuitEyesV1(), ProtogenHUB75Project::ProtogenHUB75Project(), ProtogenWS35Project::ProtogenWS35Project(), SplatAnimation::SplatAnimation(), UnicornZhenjaAnimation::UnicornZhenjaAnimation(), AceAnimation::Update(), and SageAnimation::Update().
Sets the overall wiggle speed for both X and Y function generators.
multiplier | The speed multiplier. |
Definition at line 492 of file ProtogenProjectTemplate.cpp.
References fGenMatXMove, fGenMatYMove, and FunctionGenerator::SetPeriod().
Referenced by ArrowAnimation::ArrowAnimation(), BetaProject::BetaProject(), DrGonzoTest::DrGonzoTest(), FursuitEyesV1::FursuitEyesV1(), DrGonzoProject::Loading(), ProtogenHUB75Project::ProtogenHUB75Project(), ProtogenWS35Project::ProtogenWS35Project(), SplatAnimation::SplatAnimation(), UnicornZhenjaAnimation::UnicornZhenjaAnimation(), AceAnimation::Update(), DrGonzoProject::Update(), and SageAnimation::Update().
Callback invoked when the Spectrum Analyzer face is enabled/updated.
This method is pure virtual and must be implemented by the derived class to define custom behavior upon enabling or updating the Spectrum Analyzer face.
Implemented in ArrowAnimation, SplatAnimation, BetaProject, ProtogenHUB75Project, and ProtogenWS35Project.
Referenced by SpectrumAnalyzerFace().
|
protected |
Enables the Spectrum Analyzer on the face, updating offsets and calling callbacks.
Definition at line 434 of file ProtogenProjectTemplate.cpp.
References MaterialAnimator< materialCount >::AddMaterialFrame(), EasyEaseAnimator< maxParameters >::AddParameterFrame(), backgroundMaterial, eEA, MicrophoneFourierBase::GetFourierFiltered(), materialAnimator, offsetFaceInd, offsetFaceIndSA, offsetFaceSA, sA, SpectrumAnalyzerCallback(), and SpectrumAnalyzer::Update().
Referenced by ArrowAnimation::SelectFace(), SplatAnimation::SelectFace(), FursuitEyesV1::SelectFace(), BetaProject::SelectFace(), ProtogenHUB75Project::SelectFace(), ProtogenHUB75Project::SelectFaceFromMorse(), AceAnimation::Update(), DrGonzoProject::Update(), DrGonzoTest::Update(), SageAnimation::Update(), UnicornZhenjaAnimation::Update(), and ProtogenWS35Project::Update().
Updates the face's rendered content, reading any user input and applying changes.
Definition at line 86 of file ProtogenProjectTemplate.cpp.
References aRG, backgroundMaterial, boop, cameraSize, eEA, fanController, fGenMatXMove, fGenMatYMove, flowNoise, frameLimiter, Menu::GetEffect(), Menu::GetFaceSize(), Menu::GetFanSpeed(), Menu::GetHueB(), Menu::GetHueF(), Menu::GetMicLevel(), gradientMat, gradientSpectrum, hRainbow, hud, RGBColor::HueShift(), isBooped, APDS9960::isBooped(), TimeStep::IsReady(), materialAnimator, Menu::MirrorSpectrumAnalyzer(), Vector2D::Multiply(), objA, offsetFace, oSC, rainbowSpiral, sA, Project::scene, ObjectAlign::SetCameraMax(), HeadsUpDisplay::SetEffect(), Scene::SetEffect(), SpectrumAnalyzer::SetFlipYState(), FlowNoise::SetGradient(), AudioReactiveGradient::SetHueAngle(), Oscilloscope::SetHueAngle(), SpectrumAnalyzer::SetHueAngle(), SetMaterialColor(), SpectrumAnalyzer::SetMirrorYState(), AudioReactiveGradient::SetPosition(), FanController::SetPWM(), AudioReactiveGradient::SetRadius(), AudioReactiveGradient::SetRotation(), AudioReactiveGradient::SetSize(), FFTVoiceDetection< peakCount >::SetThreshold(), Menu::ShowMenu(), HeadsUpDisplay::Update(), MicrophoneFourier::Update(), MaterialAnimator< materialCount >::Update(), FunctionGenerator::Update(), EasyEaseAnimator< maxParameters >::Update(), Menu::Update(), FlowNoise::Update(), HorizontalRainbow::Update(), RainbowSpiral::Update(), UpdateFFTVisemes(), GradientMaterial< colorCount >::UpdateGradient(), UpdateKeyFrameTracks(), Menu::UseBoopSensor(), voiceDetection, Vector2D::X, xOffset, Vector2D::Y, and yOffset.
Referenced by AceAnimation::Update(), ArrowAnimation::Update(), DrGonzoProject::Update(), DrGonzoTest::Update(), SageAnimation::Update(), SplatAnimation::Update(), UnicornZhenjaAnimation::Update(), FursuitEyesV1::Update(), ProtogenHUB75Project::Update(), and ProtogenWS35Project::Update().
|
private |
Updates FFT-based visemes for voice detection and mouth shape animations.
Definition at line 52 of file ProtogenProjectTemplate.cpp.
References EasyEaseAnimator< maxParameters >::AddParameterFrame(), Viseme::AH, Viseme::AR, Viseme::EE, eEA, Viseme::ER, MicrophoneFourierBase::GetCurrentMagnitude(), MicrophoneFourierBase::GetFourierFiltered(), MicrophoneFourierBase::GetSampleRate(), FFTVoiceDetection< peakCount >::GetViseme(), Viseme::OO, Viseme::SS, Viseme::UH, FFTVoiceDetection< peakCount >::Update(), Menu::UseMicrophone(), and voiceDetection.
Referenced by UpdateFace().
|
private |
Updates any keyframe tracks (e.g., blink track).
Definition at line 48 of file ProtogenProjectTemplate.cpp.
References blink, and AnimationTrack< maxParameters, maxKeyFrames >::Update().
Referenced by UpdateFace().
|
private |
Definition at line 130 of file ProtogenProjectTemplate.h.
Referenced by AudioReactiveGradientFace(), SetMaterialLayers(), and UpdateFace().
|
private |
Background object and associated 3D model.
Definition at line 59 of file ProtogenProjectTemplate.h.
Referenced by ProtogenProject().
|
private |
Handles layering of background materials.
Definition at line 124 of file ProtogenProjectTemplate.h.
Referenced by AddBackgroundMaterial(), AddBackgroundMaterialFrame(), AddBackgroundMaterialFrame(), AudioReactiveGradientFace(), GetBackgroundMaterial(), OscilloscopeFace(), ProtogenProject(), SetMaterialLayers(), SpectrumAnalyzerFace(), and UpdateFace().
|
private |
Solid black material.
Definition at line 112 of file ProtogenProjectTemplate.h.
Referenced by AddBackgroundMaterialFrame(), AddMaterialFrame(), SetMaterialColor(), and SetMaterialLayers().
|
private |
Blink track handler.
Definition at line 134 of file ProtogenProjectTemplate.h.
Referenced by AddBlinkParameter(), DisableBlinking(), EnableBlinking(), and UpdateKeyFrameTracks().
Flag to indicate if the blink parameter has been set.
Definition at line 81 of file ProtogenProjectTemplate.h.
Referenced by AddBlinkParameter().
|
private |
Solid blue material.
Definition at line 109 of file ProtogenProjectTemplate.h.
Referenced by AddBackgroundMaterialFrame(), AddMaterialFrame(), SetMaterialColor(), and SetMaterialLayers().
|
private |
Gesture sensor used for detecting "boops.".
Definition at line 157 of file ProtogenProjectTemplate.h.
Referenced by Initialize(), and UpdateFace().
|
private |
Pin for the button input.
Definition at line 98 of file ProtogenProjectTemplate.h.
Referenced by Initialize(), and ProtogenProject().
|
private |
The size of the camera used for rendering calculations.
Definition at line 86 of file ProtogenProjectTemplate.h.
Referenced by ProtogenProject(), and UpdateFace().
Front camera maximum bounds.
Definition at line 65 of file ProtogenProjectTemplate.h.
Referenced by ProtogenProject(), and SetCameraMain().
Rear camera maximum bounds.
Definition at line 71 of file ProtogenProjectTemplate.h.
Referenced by SetCameraRear().
Minimum and maximum bounds for the primary (front) camera view.
Front camera minimum bounds.
Definition at line 64 of file ProtogenProjectTemplate.h.
Referenced by ProtogenProject(), and SetCameraMain().
Minimum and maximum bounds for the rear camera view.
Rear camera minimum bounds.
Definition at line 70 of file ProtogenProjectTemplate.h.
Referenced by SetCameraRear().
|
protected |
Animator that eases parameter transitions.
Definition at line 236 of file ProtogenProjectTemplate.h.
Referenced by AddParameter(), AddParameterFrame(), AddViseme(), AudioReactiveGradientFace(), HideFace(), LinkParameters(), OscilloscopeFace(), SpectrumAnalyzerFace(), UpdateFace(), and UpdateFFTVisemes().
|
private |
Total number of faces available (e.g., for UI or animations).
Definition at line 99 of file ProtogenProjectTemplate.h.
Referenced by Initialize(), and ProtogenProject().
|
private |
Fan controller for controlling a fan's PWM.
Definition at line 152 of file ProtogenProjectTemplate.h.
Referenced by Initialize(), and UpdateFace().
|
private |
Function generators for X/Y wiggle movements.
Definition at line 146 of file ProtogenProjectTemplate.h.
Referenced by GetWiggleOffset(), SetWiggleSpeed(), and UpdateFace().
|
private |
Definition at line 147 of file ProtogenProjectTemplate.h.
Referenced by GetWiggleOffset(), SetWiggleSpeed(), and UpdateFace().
|
private |
Noise-based animated material.
Definition at line 102 of file ProtogenProjectTemplate.h.
Referenced by AddBackgroundMaterialFrame(), AddMaterialFrame(), SetMaterialColor(), SetMaterialLayers(), and UpdateFace().
A TimeStep object to limit frames (e.g., to 120 FPS).
Definition at line 211 of file ProtogenProjectTemplate.h.
Referenced by UpdateFace().
|
private |
Definition at line 118 of file ProtogenProjectTemplate.h.
Referenced by SetMaterialLayers(), and UpdateFace().
Gradient used for color transitions.
Definition at line 117 of file ProtogenProjectTemplate.h.
Referenced by UpdateFace().
|
private |
Solid green material.
Definition at line 108 of file ProtogenProjectTemplate.h.
Referenced by AddBackgroundMaterialFrame(), AddMaterialFrame(), SetMaterialColor(), and SetMaterialLayers().
|
private |
Horizontal rainbow animated material.
Definition at line 104 of file ProtogenProjectTemplate.h.
Referenced by AddBackgroundMaterialFrame(), AddMaterialFrame(), SetMaterialColor(), SetMaterialLayers(), and UpdateFace().
|
protected |
Heads-up display (HUD) for the face overlay or additional data.
Definition at line 241 of file ProtogenProjectTemplate.h.
Referenced by AceAnimation::AceAnimation(), ArrowAnimation::ArrowAnimation(), BetaProject::BetaProject(), DrGonzoProject::DrGonzoProject(), DrGonzoTest::DrGonzoTest(), FursuitEyesV1::FursuitEyesV1(), Initialize(), ProtogenHUB75Project::ProtogenHUB75Project(), ProtogenProject(), ProtogenWS35Project::ProtogenWS35Project(), SageAnimation::SageAnimation(), SplatAnimation::SplatAnimation(), UnicornZhenjaAnimation::UnicornZhenjaAnimation(), and UpdateFace().
Flag to indicate if the APDS9960 sensor has detected a "boop".
Definition at line 76 of file ProtogenProjectTemplate.h.
Referenced by IsBooped(), and UpdateFace().
|
private |
Material animators for face and background layering.
Handles layering of face materials.
Definition at line 123 of file ProtogenProjectTemplate.h.
Referenced by AddMaterial(), AddMaterialFrame(), AddMaterialFrame(), AudioReactiveGradientFace(), GetFaceMaterial(), OscilloscopeFace(), SetBaseMaterial(), SetMaterialColor(), SetMaterialLayers(), SpectrumAnalyzerFace(), and UpdateFace().
|
private |
Pin assignments and face count.
Pin for the microphone input.
Definition at line 97 of file ProtogenProjectTemplate.h.
Referenced by Initialize(), and ProtogenProject().
|
private |
Object alignment for the front, rear, and an additional alignment object.
Alignment for the front camera.
Definition at line 139 of file ProtogenProjectTemplate.h.
Referenced by AlignObjectFace(), AlignObjectNoScaleFace(), AlignObjectsFace(), AlignObjectsNoScaleFace(), GetObjectAlignFace(), ProtogenProject(), SetCameraMain(), and UpdateFace().
|
private |
Generic alignment object.
Definition at line 141 of file ProtogenProjectTemplate.h.
Referenced by AlignObject(), AlignObjectNoScale(), AlignObjects(), AlignObjectsNoScale(), GetAlignmentTransform(), GetAlignmentTransform(), and GetObjectAlign().
|
private |
Alignment for the rear camera.
Definition at line 140 of file ProtogenProjectTemplate.h.
Referenced by AlignObjectNoScaleRear(), AlignObjectRear(), AlignObjectsNoScaleRear(), AlignObjectsRear(), GetObjectAlignRear(), and SetCameraRear().
|
private |
Facial offset parameters for layering advanced materials (e.g., Spectrum Analyzer).
Generic face offset.
Definition at line 167 of file ProtogenProjectTemplate.h.
Referenced by LinkParameters(), and UpdateFace().
|
private |
Offset for AudioReactiveGradient face.
Definition at line 169 of file ProtogenProjectTemplate.h.
Referenced by AudioReactiveGradientFace(), and LinkParameters().
|
private |
Index for generic face offset in EasyEaseAnimator.
Definition at line 172 of file ProtogenProjectTemplate.h.
Referenced by AudioReactiveGradientFace(), HideFace(), LinkParameters(), OscilloscopeFace(), and SpectrumAnalyzerFace().
|
private |
Index for AudioReactiveGradient offset in EasyEaseAnimator.
Definition at line 174 of file ProtogenProjectTemplate.h.
Referenced by AudioReactiveGradientFace(), and LinkParameters().
|
private |
Index for Oscilloscope offset in EasyEaseAnimator.
Definition at line 175 of file ProtogenProjectTemplate.h.
Referenced by LinkParameters(), and OscilloscopeFace().
|
private |
Index for SpectrumAnalyzer offset in EasyEaseAnimator.
Definition at line 173 of file ProtogenProjectTemplate.h.
Referenced by LinkParameters(), and SpectrumAnalyzerFace().
|
private |
Offset for Oscilloscope face.
Definition at line 170 of file ProtogenProjectTemplate.h.
Referenced by LinkParameters(), and OscilloscopeFace().
|
private |
Offset for SpectrumAnalyzer face.
Definition at line 168 of file ProtogenProjectTemplate.h.
Referenced by LinkParameters(), and SpectrumAnalyzerFace().
|
private |
Solid orange material.
Definition at line 106 of file ProtogenProjectTemplate.h.
Referenced by AddBackgroundMaterialFrame(), AddMaterialFrame(), SetMaterialColor(), and SetMaterialLayers().
|
private |
Definition at line 131 of file ProtogenProjectTemplate.h.
Referenced by OscilloscopeFace(), ProtogenProject(), SetMaterialLayers(), and UpdateFace().
|
private |
Solid purple material.
Definition at line 111 of file ProtogenProjectTemplate.h.
Referenced by AddBackgroundMaterialFrame(), AddMaterialFrame(), SetMaterialColor(), and SetMaterialLayers().
|
private |
Spiral rainbow animated material.
Definition at line 103 of file ProtogenProjectTemplate.h.
Referenced by AddBackgroundMaterialFrame(), AddMaterialFrame(), SetMaterialColor(), SetMaterialLayers(), and UpdateFace().
|
private |
Solid red material.
Definition at line 105 of file ProtogenProjectTemplate.h.
Referenced by AddBackgroundMaterialFrame(), AddMaterialFrame(), SetMaterialColor(), and SetMaterialLayers().
|
private |
Audio-reactive materials.
Definition at line 129 of file ProtogenProjectTemplate.h.
Referenced by ProtogenProject(), SetMaterialLayers(), SpectrumAnalyzerFace(), and UpdateFace().
|
private |
Voice detection system based on FFT data.
Definition at line 162 of file ProtogenProjectTemplate.h.
Referenced by UpdateFace(), and UpdateFFTVisemes().
|
private |
Solid white material.
Definition at line 107 of file ProtogenProjectTemplate.h.
Referenced by AddBackgroundMaterialFrame(), AddMaterialFrame(), SetMaterialColor(), and SetMaterialLayers().
|
private |
Offsets used for small "wiggle" or motion in the scene.
X-axis offset.
Definition at line 91 of file ProtogenProjectTemplate.h.
Referenced by UpdateFace().
|
private |
Solid yellow material.
Definition at line 110 of file ProtogenProjectTemplate.h.
Referenced by AddBackgroundMaterialFrame(), AddMaterialFrame(), SetMaterialColor(), and SetMaterialLayers().
|
private |