![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
#include <BetaProject.h>
Public Member Functions | |
BetaProject () | |
void | Update (float ratio) override |
Updates the project state based on the given ratio. | |
void | SelectFace (uint8_t code) |
![]() | |
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. | |
![]() | |
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. | |
Private Member Functions | |
void | LinkControlParameters () override |
Links external or user-defined control parameters (pure virtual to be implemented). | |
void | AddBotFinKeyFrames () |
void | UpdateKeyFrameTracks () |
void | Default () |
void | OwO () |
void | Sad () |
void | Dead () |
void | Heart () |
void | OwO2 () |
void | AlphaGenCircle () |
void | AngryFace () |
void | Crash () |
void | Frustrated () |
void | Dizzy () |
void | Shocked () |
void | StandbyF () |
void | Gentle () |
void | UpdateKeyframeTracks () |
void | SpectrumAnalyzerCallback () override |
Callback invoked when the Spectrum Analyzer face is enabled/updated. | |
void | AudioReactiveGradientCallback () override |
Callback invoked when the Audio Reactive Gradient face is enabled/updated. | |
void | OscilloscopeCallback () override |
Callback invoked when the Oscilloscope face is enabled/updated. | |
Additional Inherited Members | |
![]() | |
enum | Color { CBASE , CYELLOW , CORANGE , CWHITE , CGREEN , CPURPLE , CRED , CBLUE , CRAINBOW , CRAINBOWNOISE , CHORIZONTALRAINBOW , CBLACK } |
Enumeration of different color states for the face material. More... | |
![]() | |
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. | |
![]() | |
void | RenderStartTimer () |
Starts the render timer for measuring render performance. | |
void | RenderEndTimer () |
Stops the render timer and records the elapsed time. | |
![]() | |
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. | |
Definition at line 17 of file BetaProject.h.
|
inline |
Definition at line 294 of file BetaProject.h.
References AddBotFinKeyFrames(), Scene::AddObject(), faceArray, ProtogenProject::GetFaceMaterial(), greenMaterial, ProtogenProject::hud, ledStripBackground, LinkControlParameters(), pM, rear, Project::scene, ProtogenProject::SetCameraRear(), HeadsUpDisplay::SetFaceArray(), ProtogenProject::SetMenuOffset(), ProtogenProject::SetMenuSize(), ProtogenProject::SetMenuWiggleSpeed(), ProtogenProject::SetWiggleSpeed(), and standby.
|
inlineprivate |
Definition at line 86 of file BetaProject.h.
References KeyFrameTrack< maxParameters, maxKeyFrames >::AddKeyFrame(), botFinLR1, botFinLR2, botFinLR3, botFinLR4, and botFinLR5.
Referenced by BetaProject().
|
inlineprivate |
Definition at line 187 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), ProtogenProject::AddParameterFrame(), ProtogenProject::CRAINBOWNOISE, and ProtogenProject::EnableBlinking().
|
inlineprivate |
Definition at line 197 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), ProtogenProject::AddParameterFrame(), ProtogenProject::CRED, and ProtogenProject::EnableBlinking().
Referenced by SelectFace().
|
inlineoverrideprivatevirtual |
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.
Implements ProtogenProject.
Definition at line 285 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), and ProtogenProject::CHORIZONTALRAINBOW.
Definition at line 208 of file BetaProject.h.
References ProtogenProject::AddBackgroundMaterialFrame(), ProtogenProject::AddMaterialFrame(), ProtogenProject::AddParameterFrame(), ProtogenProject::CBLUE, ProtogenProject::CWHITE, and ProtogenProject::DisableBlinking().
Referenced by SelectFace().
|
inlineprivate |
Definition at line 160 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), ProtogenProject::AddParameterFrame(), ProtogenProject::CRED, and ProtogenProject::DisableBlinking().
Referenced by SelectFace().
|
inlineprivate |
Definition at line 133 of file BetaProject.h.
References ProtogenProject::AddParameterFrame(), and ProtogenProject::EnableBlinking().
Referenced by SelectFace().
|
inlineprivate |
Definition at line 230 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), ProtogenProject::AddParameterFrame(), ProtogenProject::CPURPLE, and ProtogenProject::EnableBlinking().
Referenced by SelectFace().
|
inlineprivate |
Definition at line 219 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), ProtogenProject::AddParameterFrame(), ProtogenProject::CRED, and ProtogenProject::EnableBlinking().
Referenced by SelectFace().
|
inlineprivate |
Definition at line 262 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), ProtogenProject::AddParameterFrame(), ProtogenProject::CGREEN, and ProtogenProject::EnableBlinking().
Referenced by SelectFace().
|
inlineprivate |
Definition at line 169 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), ProtogenProject::AddParameterFrame(), ProtogenProject::CRAINBOW, and ProtogenProject::DisableBlinking().
Referenced by SelectFace().
|
inlineoverrideprivatevirtual |
Links external or user-defined control parameters (pure virtual to be implemented).
Implements ProtogenProject.
Definition at line 43 of file BetaProject.h.
References ProtogenProject::AddBlinkParameter(), KeyFrameTrack< maxParameters, maxKeyFrames >::AddParameter(), ProtogenProject::AddParameter(), ProtogenProject::AddViseme(), Viseme::AH, Viseme::AR, botFinLR1, botFinLR2, botFinLR3, botFinLR4, botFinLR5, IEasyEaseAnimator::Cosine, Viseme::EE, Viseme::ER, Viseme::OO, pM, rear, showStandby, Viseme::SS, standbyIndex, and Viseme::UH.
Referenced by BetaProject().
|
inlineoverrideprivatevirtual |
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.
Implements ProtogenProject.
Definition at line 289 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), and ProtogenProject::CHORIZONTALRAINBOW.
|
inlineprivate |
Definition at line 139 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), ProtogenProject::AddParameterFrame(), ProtogenProject::CRAINBOW, and ProtogenProject::DisableBlinking().
Referenced by SelectFace().
|
inlineprivate |
Definition at line 179 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), ProtogenProject::AddParameterFrame(), ProtogenProject::CRAINBOW, and ProtogenProject::DisableBlinking().
|
inlineprivate |
Definition at line 150 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), ProtogenProject::AddParameterFrame(), ProtogenProject::CBLUE, and ProtogenProject::EnableBlinking().
Referenced by SelectFace().
Definition at line 359 of file BetaProject.h.
References AngryFace(), ProtogenProject::AudioReactiveGradientFace(), Crash(), Dead(), Default(), Dizzy(), Frustrated(), Gentle(), Heart(), ProtogenProject::IsBooped(), ProtogenProject::OscilloscopeFace(), OwO(), Sad(), Shocked(), ProtogenProject::SpectrumAnalyzerFace(), and StandbyF().
Referenced by Update().
|
inlineprivate |
Definition at line 241 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), ProtogenProject::AddParameterFrame(), ProtogenProject::CYELLOW, and ProtogenProject::DisableBlinking().
Referenced by SelectFace().
|
inlineoverrideprivatevirtual |
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.
Implements ProtogenProject.
Definition at line 281 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), and ProtogenProject::CHORIZONTALRAINBOW.
|
inlineprivate |
Definition at line 252 of file BetaProject.h.
References ProtogenProject::AddMaterialFrame(), ProtogenProject::AddParameterFrame(), ProtogenProject::CBLACK, ProtogenProject::DisableBlinking(), and standbyIndex.
Referenced by SelectFace().
Updates the project state based on the given ratio.
This method is intended to be overridden by derived classes to define specific update logic for animations or state transitions.
ratio | A float representing the interpolation ratio for updates. |
Implements Project.
Definition at line 318 of file BetaProject.h.
References ProtogenProject::AlignObjectFace(), ProtogenProject::AlignObjectRear(), controller, fGen, fGen2, fGen3, Menu::GetAccentBrightness(), Menu::GetBrightness(), Menu::GetFaceState(), ProtogenProject::GetWiggleOffset(), pM, rear, SelectFace(), WS35BetaController::SetAccentBrightness(), WS35BetaController::SetBrightness(), showStandby, standby, FunctionGenerator::Update(), Menu::Update(), and UpdateKeyFrameTracks().
|
inlineprivate |
Definition at line 124 of file BetaProject.h.
References botFinLR1, botFinLR2, botFinLR3, botFinLR4, botFinLR5, and KeyFrameTrack< maxParameters, maxKeyFrames >::Update().
Referenced by Update().
|
inlineprivate |
Definition at line 273 of file BetaProject.h.
References botFinLR1, botFinLR2, botFinLR3, botFinLR4, botFinLR5, and KeyFrameTrack< maxParameters, maxKeyFrames >::Update().
|
private |
Definition at line 34 of file BetaProject.h.
Referenced by AddBotFinKeyFrames(), LinkControlParameters(), UpdateKeyFrameTracks(), and UpdateKeyframeTracks().
|
private |
Definition at line 35 of file BetaProject.h.
Referenced by AddBotFinKeyFrames(), LinkControlParameters(), UpdateKeyFrameTracks(), and UpdateKeyframeTracks().
|
private |
Definition at line 36 of file BetaProject.h.
Referenced by AddBotFinKeyFrames(), LinkControlParameters(), UpdateKeyFrameTracks(), and UpdateKeyframeTracks().
|
private |
Definition at line 37 of file BetaProject.h.
Referenced by AddBotFinKeyFrames(), LinkControlParameters(), UpdateKeyFrameTracks(), and UpdateKeyframeTracks().
|
private |
Definition at line 38 of file BetaProject.h.
Referenced by AddBotFinKeyFrames(), LinkControlParameters(), UpdateKeyFrameTracks(), and UpdateKeyframeTracks().
|
private |
Definition at line 19 of file BetaProject.h.
|
private |
Definition at line 20 of file BetaProject.h.
Referenced by Update().
|
private |
Definition at line 32 of file BetaProject.h.
Referenced by BetaProject().
|
private |
Definition at line 28 of file BetaProject.h.
Referenced by Update().
|
private |
Definition at line 29 of file BetaProject.h.
Referenced by Update().
|
private |
Definition at line 30 of file BetaProject.h.
Referenced by Update().
|
private |
Definition at line 26 of file BetaProject.h.
Referenced by BetaProject().
|
private |
Definition at line 24 of file BetaProject.h.
Referenced by BetaProject().
|
private |
Definition at line 21 of file BetaProject.h.
Referenced by BetaProject(), LinkControlParameters(), and Update().
|
private |
Definition at line 22 of file BetaProject.h.
Referenced by BetaProject(), LinkControlParameters(), and Update().
|
private |
Definition at line 41 of file BetaProject.h.
Referenced by LinkControlParameters(), and Update().
|
private |
Definition at line 23 of file BetaProject.h.
Referenced by BetaProject(), and Update().
|
private |
Definition at line 40 of file BetaProject.h.
Referenced by LinkControlParameters(), and StandbyF().