forked from Hartmut/paradiso
fix vertices
This commit is contained in:
parent
b6691561e8
commit
be6832cd24
1 changed files with 14 additions and 18 deletions
|
@ -23,20 +23,13 @@
|
||||||
#ifndef PARADISO_SPRITE_HPP
|
#ifndef PARADISO_SPRITE_HPP
|
||||||
#define PARADISO_SPRITE_HPP
|
#define PARADISO_SPRITE_HPP
|
||||||
|
|
||||||
#include <paradiso/globals.hpp>
|
|
||||||
#include <paradiso/bitmap.hpp>
|
#include <paradiso/bitmap.hpp>
|
||||||
|
#include <paradiso/globals.hpp>
|
||||||
#include <paradiso/matrix.hpp>
|
#include <paradiso/matrix.hpp>
|
||||||
#include <paradiso/vector.hpp>
|
#include <paradiso/vector.hpp>
|
||||||
|
|
||||||
namespace paradiso {
|
namespace paradiso {
|
||||||
|
|
||||||
// 0 3 | y
|
|
||||||
// +------+ | ^
|
|
||||||
// | \ | | -- + - > x
|
|
||||||
// | \ | | / |
|
|
||||||
// +------+ | z
|
|
||||||
// 1 2 |
|
|
||||||
|
|
||||||
struct Sprite final {
|
struct Sprite final {
|
||||||
using ChangeCountType = std::uint64_t;
|
using ChangeCountType = std::uint64_t;
|
||||||
|
|
||||||
|
@ -46,27 +39,30 @@ struct Sprite final {
|
||||||
|
|
||||||
Vector2<float> pivot{Vector2<float>::zero()};
|
Vector2<float> pivot{Vector2<float>::zero()};
|
||||||
|
|
||||||
std::array<std::uint32_t, 6> indices{0, 2, 1, 0, 3, 2};
|
// 0 3 | y
|
||||||
|
// +------+ | ^
|
||||||
|
// | \ | | -- + - > x
|
||||||
|
// | \ | | / |
|
||||||
|
// +------+ | z
|
||||||
|
// 1 2 |
|
||||||
|
|
||||||
|
std::array<std::uint32_t, 6> indices{0, 1, 2, 0, 2, 3};
|
||||||
|
|
||||||
std::array<Vector3<float>, 4> vertices{
|
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),
|
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{
|
std::array<Vector3<float>, 4> normals{
|
||||||
Vector3<float>::z_axis(), Vector3<float>::z_axis(),
|
Vector3<float>::z_axis(), Vector3<float>::z_axis(),
|
||||||
Vector3<float>::z_axis(), Vector3<float>::z_axis()};
|
Vector3<float>::z_axis(), Vector3<float>::z_axis()};
|
||||||
|
|
||||||
std::array<Vector2<float>, 4> texture_coordinates{
|
std::array<Vector2<float>, 4> texture_coordinates{
|
||||||
Vector2<float>::make(0.0f, 0.0f),
|
Vector2<float>::make(0.0f, 0.0f), Vector2<float>::make(1.0f, 0.0f),
|
||||||
Vector2<float>::make(1.0f, 0.0f),
|
Vector2<float>::make(1.0f, 1.0f), Vector2<float>::make(0.0f, 1.0f)};
|
||||||
Vector2<float>::make(1.0f, 1.0f),
|
|
||||||
Vector2<float>::make(0.0f, 1.0f)
|
|
||||||
};
|
|
||||||
|
|
||||||
ChangeCountType change_count{};
|
ChangeCountType change_count{};
|
||||||
|
|
||||||
};
|
};
|
||||||
} // namespace paradiso
|
} // namespace paradiso
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue