Files
Renderive/render_3D/render_3D/Mesh_Visual.h
T
2026-08-17 14:09:34 +08:00

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;
}