ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
RocksAnimation.h
Go to the documentation of this file.
1#pragma once
2
3#include "Animation.h"
4#include "../Math/FunctionGenerator.h"
5#include "../Objects/Rocks.h"
6
7class RocksAnimation : public Animation{
8private:
9 Rocks rocks;
12
13public:
14 RocksAnimation() : Animation(1) {
15 scene->AddObject(rocks.GetObject());
16 }
17
18 void FadeIn(float stepRatio) override {}
19 void FadeOut(float stepRatio) override {}
20
21 void Update(float ratio) override {
22 float x = fGenRotation.Update();
23 float sx = fGenScale.Update();
24
26
27 rocks.GetObject()->ResetVertices();
28
29 rocks.GetObject()->GetTransform()->SetRotation(rotation);
30 rocks.GetObject()->GetTransform()->SetScale(Vector3D(sx, sx, sx));
31 rocks.GetObject()->GetTransform()->SetPosition(Vector3D(0.0f, 125.0f, 600.0f));
32
33 rocks.GetObject()->UpdateTransform();
34 }
35};
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.
A mathematical construct representing a rotation in 3D space.
Definition Quaternion.h:30
FunctionGenerator fGenScale
FunctionGenerator fGenRotation
void FadeIn(float stepRatio) override
void FadeOut(float stepRatio) override
void Update(float ratio) override
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
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.