ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
SpyroAnimation Class Reference

#include <SpyroAnimation.h>

Inheritance diagram for SpyroAnimation:
Collaboration diagram for SpyroAnimation:

Public Member Functions

 SpyroAnimation ()
 
void Initialize () override
 Initializes the project.
 
void Update (float ratio) override
 Updates the project state based on the given ratio.
 
- Public Member Functions inherited from Project
 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 Attributes

HUB75DeltaCameraManager cameras
 
HUB75Controller controller = HUB75Controller(&cameras, 50, 50)
 
Spyro spyro
 
FunctionGenerator fGenRotation = FunctionGenerator(FunctionGenerator::Sine, -30.0f, 30.0f, 6.0f)
 
FunctionGenerator fGenScale = FunctionGenerator(FunctionGenerator::Sine, 2.0f, 7.0f, 4.2f)
 
FunctionGenerator fGenPersp = FunctionGenerator(FunctionGenerator::Sine, 20.0f, 250.0f, 4.0f)
 
NormalMaterial nM
 
ObjectDeformer oD = ObjectDeformer(spyro.GetObject())
 

Additional Inherited Members

- Protected Member Functions inherited from Project
void RenderStartTimer ()
 Starts the render timer for measuring render performance.
 
void RenderEndTimer ()
 Stops the render timer and records the elapsed time.
 
- Protected Attributes inherited from Project
CameraManagercameras
 Pointer to the CameraManager for managing cameras.
 
Controllercontroller
 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.
 

Detailed Description

Definition at line 12 of file SpyroAnimation.h.

Constructor & Destructor Documentation

◆ SpyroAnimation()

SpyroAnimation ( )
inline

Definition at line 25 of file SpyroAnimation.h.

References Scene::AddObject(), Project::scene, and spyro.

Member Function Documentation

◆ Initialize()

void Initialize ( )
inlineoverridevirtual

Initializes the project.

This method is intended to be overridden by derived classes to define specific initialization logic for the project.

Implements Project.

Definition at line 31 of file SpyroAnimation.h.

References controller, and HUB75Controller::Initialize().

◆ Update()

void Update ( float  ratio)
inlineoverridevirtual

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.

Parameters
ratioA float representing the interpolation ratio for updates.

Implements Project.

Definition at line 35 of file SpyroAnimation.h.

References EulerConstants::EulerOrderXZYS, fGenRotation, fGenScale, Rotation::GetQuaternion(), spyro, and FunctionGenerator::Update().

Member Data Documentation

◆ cameras

HUB75DeltaCameraManager cameras
private

Definition at line 14 of file SpyroAnimation.h.

◆ controller

HUB75Controller controller = HUB75Controller(&cameras, 50, 50)
private

Definition at line 15 of file SpyroAnimation.h.

Referenced by Initialize().

◆ fGenPersp

FunctionGenerator fGenPersp = FunctionGenerator(FunctionGenerator::Sine, 20.0f, 250.0f, 4.0f)
private

Definition at line 20 of file SpyroAnimation.h.

◆ fGenRotation

FunctionGenerator fGenRotation = FunctionGenerator(FunctionGenerator::Sine, -30.0f, 30.0f, 6.0f)
private

Definition at line 18 of file SpyroAnimation.h.

Referenced by Update().

◆ fGenScale

FunctionGenerator fGenScale = FunctionGenerator(FunctionGenerator::Sine, 2.0f, 7.0f, 4.2f)
private

Definition at line 19 of file SpyroAnimation.h.

Referenced by Update().

◆ nM

NormalMaterial nM
private

Definition at line 21 of file SpyroAnimation.h.

◆ oD

ObjectDeformer oD = ObjectDeformer(spyro.GetObject())
private

Definition at line 22 of file SpyroAnimation.h.

◆ spyro

Spyro spyro
private

Definition at line 17 of file SpyroAnimation.h.

Referenced by SpyroAnimation(), and Update().


The documentation for this class was generated from the following file: