forked from Hartmut/paradiso
reorganized repo to show clear module boundaries
This commit is contained in:
parent
8e00b668ea
commit
536a639bfd
396 changed files with 355 additions and 391 deletions
42
src/lib/include/paradiso/sprite.hpp
Normal file
42
src/lib/include/paradiso/sprite.hpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
#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
|
Loading…
Add table
Add a link
Reference in a new issue