paradiso-win/src/lib/include/paradiso/sprite.hpp

42 lines
No EOL
1.1 KiB
C++

#ifndef PARADISO_SPRITE_HPP
#define PARADISO_SPRITE_HPP
#include "bitmap.hpp"
#include "matrix.hpp"
#include "vector.hpp"
#include <array>
namespace paradiso {
struct Sprite final {
using ChangeCountType = std::uint64_t;
static constexpr Sprite create() noexcept { return {}; }
Vector2<float> pivot{Vector2<float>::zero()};
std::array<std::uint32_t, 6> indices{0, 3, 2, 2, 1, 0};
std::array<Vector3<float>, 4> vertices{
Vector3<float>::make(-1.0f, -1.0f, 0.0f),
Vector3<float>::make(-1.0f, +1.0f, 0.0f),
Vector3<float>::make(+1.0f, +1.0f, 0.0f),
Vector3<float>::make(+1.0f, -1.0f, 0.0f)};
std::array<Vector3<float>, 4> normals{
Vector3<float>::z_axis(), Vector3<float>::z_axis(),
Vector3<float>::z_axis(), Vector3<float>::z_axis()};
std::array<Vector2<float>, 4> texture_coordinates{
Vector2<float>::make(0.0f, 0.0f), /// 0
Vector2<float>::make(0.0f, 1.0f), /// 1
Vector2<float>::make(1.0f, 1.0f), /// 2
Vector2<float>::make(1.0f, 0.0f) /// 3
};
ChangeCountType change_count{};
};
} // namespace paradiso
#endif