ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
CreeperAnimation.h
Go to the documentation of this file.
1#pragma once
2
3#include "../Templates/Project.h"
4#include "../../Utils/Signals/FunctionGenerator.h"
5#include "../../Assets/Models/OBJ/Creeper.h"
6#include "../../Scene/Materials/Static/NormalMaterial.h"
7#include "../../Scene/Objects/ObjectDeformer.h"
8
9#include "../../Camera/CameraManager/Implementations/HUB75DeltaCameras.h"
10#include "../../Controller/HUB75Controller.h"
11
13private:
14 Creeper creeper;
18
19public:
20 CreeperAnimation() : Animation(1) {
21 scene->AddObject(creeper.GetObject());
22 }
23
24 void Update(float ratio) override {
25 float x = fGenRotation.Update();
26 float sx = fGenScale.Update();
27 float px = fGenPos.Update() / 4.0f;
28
30
31 creeper.GetObject()->ResetVertices();
32
33 creeper.GetObject()->GetTransform()->SetRotation(rotation);
34 creeper.GetObject()->GetTransform()->SetScale(Vector3D(sx * 0.25f, sx * -0.25f, sx * 0.25f));
35 //spyro.GetObject()->GetTransform()->SetScaleOffset(Vector3D(100.0f, 75.0f, 0.0f));
36 creeper.GetObject()->GetTransform()->SetPosition(Vector3D(0.0f + 96.0f, px - 0.0f, 600.0f));
37
38 creeper.GetObject()->UpdateTransform();
39 }
40};
FunctionGenerator fGenPos
FunctionGenerator fGenScale
FunctionGenerator fGenRotation
void Update(float ratio) override
Updates the project state based on the given ratio.
Encapsulates a 3D rotation using Euler angles and a specific order of application.
Definition EulerAngles.h:25
A class to generate various waveform functions with customizable parameters.
@ Sine
Sine waveform.
float Update()
Updates and calculates the next value of the waveform.
Manages animations, rendering, and display operations.
Definition Project.h:31
Scene scene
The Scene object representing the rendered environment.
Definition Project.h:35
A mathematical construct representing a rotation in 3D space.
Definition Quaternion.h:30
Handles 3D rotations and conversions between various rotation representations.
Definition Rotation.h:32
Quaternion GetQuaternion()
Gets the quaternion representation of the rotation.
Definition Rotation.cpp:234
void AddObject(Object3D *object)
Adds a 3D object to the scene.
Definition Scene.cpp:31
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
Definition Vector3D.h:26
const EulerOrder EulerOrderXZYS
Order: X → Z → Y, static frame.