mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-18 03:59:20 +01:00
Init
This commit is contained in:
24
Engine/Transform.h
Normal file
24
Engine/Transform.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
#include "base.h"
|
||||
#include "Vector2f.h"
|
||||
|
||||
struct Transform
|
||||
{
|
||||
public:
|
||||
void ApplyTransformation() const
|
||||
{
|
||||
glPushMatrix();
|
||||
glTranslatef(Position.x, Position.y, 0);
|
||||
glRotatef(Rotation, 0, 0, 1);
|
||||
glScalef(Scale.x, Scale.y, 1);
|
||||
}
|
||||
|
||||
void ResetTransformation() const
|
||||
{
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
Vector2f Position{};
|
||||
float Rotation{};
|
||||
Vector2f Scale{ 1.f, 1.f };
|
||||
};
|
||||
Reference in New Issue
Block a user