2#ifndef LIBSBX_ANIMATIONS_VERTEX3D_HPP_
3#define LIBSBX_ANIMATIONS_VERTEX3D_HPP_
7#include <libsbx/math/vector2.hpp>
8#include <libsbx/math/vector3.hpp>
9#include <libsbx/math/vector4.hpp>
12#include <libsbx/graphics/pipeline/vertex_input_description.hpp>
14namespace sbx::animations {
16struct alignas(alignof(std::float_t))
vertex3d {
25static_assert(
sizeof(
vertex3d) == 80,
"Incorrect sbx::animations::vertex3d size");
26static_assert(
alignof(
vertex3d) == 4,
"Incorrect sbx::animations::vertex3d alignment");
28constexpr auto operator==(
const vertex3d& lhs,
const vertex3d& rhs)
noexcept ->
bool {
29 return lhs.position == rhs.position && lhs.normal == rhs.normal && lhs.tangent == rhs.tangent && lhs.uv == rhs.uv && lhs.bone_ids == rhs.bone_ids && lhs.bone_weights == rhs.bone_weights;
39 result.binding_descriptions.push_back(VkVertexInputBindingDescription{
42 .inputRate = VK_VERTEX_INPUT_RATE_VERTEX
45 result.attribute_descriptions.push_back(VkVertexInputAttributeDescription{
48 .format = VK_FORMAT_R32G32B32_SFLOAT,
52 result.attribute_descriptions.push_back(VkVertexInputAttributeDescription{
55 .format = VK_FORMAT_R32G32B32_SFLOAT,
59 result.attribute_descriptions.push_back(VkVertexInputAttributeDescription{
62 .format = VK_FORMAT_R32G32B32A32_SFLOAT,
66 result.attribute_descriptions.push_back(VkVertexInputAttributeDescription{
69 .format = VK_FORMAT_R32G32_SFLOAT,
73 result.attribute_descriptions.push_back(VkVertexInputAttributeDescription{
76 .format = VK_FORMAT_R32G32B32A32_UINT,
80 result.attribute_descriptions.push_back(VkVertexInputAttributeDescription{
83 .format = VK_FORMAT_R32G32B32_SFLOAT,
92struct std::hash<sbx::animations::vertex3d> {
94 auto hash = std::size_t{0};
95 sbx::utility::hash_combine(hash, vertex.position, vertex.normal, vertex.tangent, vertex.uv, vertex.bone_ids, vertex.bone_weights);
A vector in two-dimensional space.
Definition: vector2.hpp:28
Definition: vector3.hpp:23
Definition: vector4.hpp:24
RGBA color representation and utilities.
Definition: vertex3d.hpp:16