ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
CoelaBonkAnimation.h
Go to the documentation of this file.
1#pragma once
2
3#include "Animation.h"
4#include "../Objects/SolidCube.h"
5#include "../Materials/DepthMaterial.h"
6#include "../Materials/LightMaterial.h"
7#include "../Math/FunctionGenerator.h"
8
9//#include "Flash\Images\CoelaToot.h"
10#include "Flash/ImageSequences/Bonk.h"
11
12class CoelaBonkAnimation : public Animation{
13private:
14 SolidCube cube;
20 BonkSequence gif = BonkSequence(Vector2D(200, 145), Vector2D(100, 70), 30);
21
22public:
23 CoelaBonkAnimation() : Animation(1) {
24 scene->AddObject(cube.GetObject());
25
26 cube.GetObject()->SetMaterial(&gif);
27 }
28
29 void FadeIn(float stepRatio) override {}
30 void FadeOut(float stepRatio) override {}
31
32 void Reset(){
33 gif.Reset();
34 }
35
36 void Update(float ratio) override {
37 float x = fGenObjRotation.Update();
38 float sx = fGenObjScale.Update();
39 float shift = fGenMatPos.Update();
40 float size = fGenMatSize.Update();
41 float rotate = fGenMatRot.Update();
42
44
45 gif.SetPosition(Vector2D(140.0f + shift, 90.0f + shift));
46 gif.SetSize(Vector2D(-size, size));
47 gif.SetRotation(rotate);
48 gif.Update();
49
50 cube.GetObject()->ResetVertices();
51
52 cube.GetObject()->GetTransform()->SetRotation(rotation);
53 cube.GetObject()->GetTransform()->SetScale(Vector3D(sx, sx, sx));
54 cube.GetObject()->GetTransform()->SetScaleOffset(cube.GetObject()->GetCenterOffset());
55 cube.GetObject()->GetTransform()->SetPosition(Vector3D(125.0f, 75.0f, 600.0f));
56
57 cube.GetObject()->UpdateTransform();
58 }
59};
FunctionGenerator fGenObjScale
FunctionGenerator fGenMatPos
void FadeIn(float stepRatio) override
void FadeOut(float stepRatio) override
FunctionGenerator fGenObjRotation
void Update(float ratio) override
FunctionGenerator fGenMatRot
FunctionGenerator fGenMatSize
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
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 2D vector (X, Y) and provides methods for vector arithmetic.
Definition Vector2D.h:27
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.