Better scene management.
This commit is contained in:
23
include/Engine/Entity/Animation.h
Normal file
23
include/Engine/Entity/Animation.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <JGL/types/Texture.h>
|
||||
|
||||
using JGL::Texture;
|
||||
|
||||
class Animation {
|
||||
protected:
|
||||
std::string name{};
|
||||
float ms_between_frames = 1.0f;
|
||||
std::vector<Texture> textures{};
|
||||
public:
|
||||
[[nodiscard]] std::string GetName() const;
|
||||
[[nodiscard]] float GetMsBetweenFrames() const;
|
||||
|
||||
/// @param animation_time a float from 0 to 1. 0 being the beginning of the animation and 1 being the end.
|
||||
[[nodiscard]] const JGL::Texture* GetTexture(float animation_time) const;
|
||||
public:
|
||||
void SetMsBetweenFrames(float new_ms_between_frames);
|
||||
public:
|
||||
Animation(const std::string& name, float ms_between_frames, std::vector<Texture>& textures) : name(name), ms_between_frames(ms_between_frames), textures(textures) {};
|
||||
~Animation() = default;
|
||||
};
|
Reference in New Issue
Block a user