![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Manages animations, rendering, and display operations. More...
#include <Project.h>
Public Member Functions | |
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. | |
virtual void | Initialize ()=0 |
Initializes the project. | |
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 Member Functions | |
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 | |
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. | |
Manages animations, rendering, and display operations.
The Project class integrates various subsystems including camera management, scene rendering, and display updates. It also tracks and reports performance metrics such as frame rate and individual operation times.
Project | ( | CameraManager * | cameras, |
Controller * | controller, | ||
uint8_t | numObjects | ||
) |
Constructs a Project with specified camera manager and controller.
cameras | Pointer to the CameraManager managing the cameras. |
controller | Pointer to the Controller managing the display. |
numObjects | Number of objects to initialize in the scene. |
Definition at line 3 of file Project.cpp.
References previousAnimationTime, previousDisplayTime, and previousRenderTime.
Animates the project state based on the given ratio.
ratio | A float representing the interpolation ratio for animations. |
Definition at line 35 of file Project.cpp.
References animationTime, previousAnimationTime, and Update().
void Display | ( | ) |
Updates the display with the rendered content.
Definition at line 52 of file Project.cpp.
References controller, Controller::Display(), displayTime, and previousDisplayTime.
float GetAnimationTime | ( | ) |
Retrieves the time spent on animations.
Definition at line 19 of file Project.cpp.
References animationTime.
Referenced by PrintStats().
float GetDisplayTime | ( | ) |
Retrieves the time spent on display operations.
Definition at line 27 of file Project.cpp.
References displayTime.
Referenced by PrintStats().
float GetFrameRate | ( | ) |
Retrieves the current frame rate.
Definition at line 31 of file Project.cpp.
References animationTime, avgFPS, displayTime, RunningAverageFilter< memory >::Filter(), and renderTime.
Referenced by PrintStats().
float GetRenderTime | ( | ) |
Retrieves the time spent on rendering.
Definition at line 23 of file Project.cpp.
References renderTime.
Referenced by PrintStats().
Initializes the project.
This method is intended to be overridden by derived classes to define specific initialization logic for the project.
Implemented in ProtogenProject, Boot, SpyroAnimation, and VerifyEngine.
void PrintStats | ( | ) |
Prints performance statistics such as frame rate and operation times.
Definition at line 60 of file Project.cpp.
References Debug::FreeMem(), GetAnimationTime(), GetDisplayTime(), GetFrameRate(), and GetRenderTime().
void Render | ( | ) |
Renders the scene.
Definition at line 43 of file Project.cpp.
References cameras, previousRenderTime, RenderingEngine::Rasterize(), renderTime, and scene.
|
protected |
Stops the render timer and records the elapsed time.
Definition at line 15 of file Project.cpp.
References previousRenderTime, and renderTime.
|
protected |
Starts the render timer for measuring render performance.
Definition at line 11 of file Project.cpp.
References previousRenderTime.
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. |
Implemented in Boot, AceAnimation, ArrowAnimation, DrGonzoProject, DrGonzoTest, SageAnimation, SplatAnimation, UnicornZhenjaAnimation, FursuitEyesV1, BetaProject, ProtogenHUB75Project, ProtogenWS35Project, CreeperAnimation, SpyroAnimation, and VerifyEngine.
Referenced by Animate().
|
protected |
Time spent on animation in milliseconds.
Definition at line 43 of file Project.h.
Referenced by Animate(), GetAnimationTime(), and GetFrameRate().
|
protected |
Running average filter for frame rate calculation.
Definition at line 37 of file Project.h.
Referenced by GetFrameRate().
|
protected |
Pointer to the CameraManager for managing cameras.
Definition at line 33 of file Project.h.
Referenced by Render().
|
protected |
Pointer to the Controller for controlling the display.
Definition at line 34 of file Project.h.
Referenced by Display(), and ProtogenProject::Initialize().
|
protected |
Time spent on display in milliseconds.
Definition at line 45 of file Project.h.
Referenced by Display(), GetDisplayTime(), and GetFrameRate().
|
protected |
|
protected |
|
protected |
Time of the previous render frame in microseconds.
Definition at line 40 of file Project.h.
Referenced by Project(), Render(), RenderEndTimer(), and RenderStartTimer().
|
protected |
Time spent on rendering in milliseconds.
Definition at line 44 of file Project.h.
Referenced by GetFrameRate(), GetRenderTime(), Render(), and RenderEndTimer().
|
protected |
The Scene object representing the rendered environment.
Definition at line 35 of file Project.h.
Referenced by AceAnimation::AceAnimation(), ArrowAnimation::ArrowAnimation(), BetaProject::BetaProject(), Boot::Boot(), CreeperAnimation::CreeperAnimation(), DrGonzoProject::DrGonzoProject(), DrGonzoTest::DrGonzoTest(), FursuitEyesV1::FursuitEyesV1(), ProtogenHUB75Project::ProtogenHUB75Project(), ProtogenProject::ProtogenProject(), ProtogenWS35Project::ProtogenWS35Project(), Render(), SageAnimation::SageAnimation(), SplatAnimation::SplatAnimation(), SpyroAnimation::SpyroAnimation(), UnicornZhenjaAnimation::UnicornZhenjaAnimation(), ProtogenProject::UpdateFace(), and VerifyEngine::VerifyEngine().