25 lines
673 B
C++
25 lines
673 B
C++
#pragma once
|
|
#include "visuals/Basic_Visual.h"
|
|
namespace renderive::render_3d {
|
|
struct Mesh_Vertex {
|
|
Vec3 position;
|
|
Rgba8 color;
|
|
Vec3 normal;
|
|
Vec2 texture_coordinate;
|
|
bool operator==(const Mesh_Vertex&) const = default;
|
|
};
|
|
namespace detail {
|
|
struct Mesh_Spec {
|
|
using Item = Mesh_Vertex;
|
|
using Settings = Visual_Settings;
|
|
static constexpr const char* name = "Mesh";
|
|
static bool valid(const Item& item) noexcept {
|
|
return finite(item.position) && finite(item.normal) &&
|
|
finite(item.texture_coordinate);
|
|
}
|
|
};
|
|
}
|
|
using Mesh_Visual = detail::Attached_Visual<detail::Mesh_Spec>;
|
|
using Mesh_State = Mesh_Visual::Properties;
|
|
}
|