#pragma once
#include "math/vector3.h"
#include "math/vector2.h"
#include "refl/refl.h"
// 顶点最多关联4个骨骼
#define MAX_NUM_BONES_PER_VERTEX 4
namespace engineapi {
	struct Vertex {};
	struct PosVertex : public Vertex {
		UPROPERTY_vk({}, uint32_t{ VK_FORMAT_R32G32B32_SFLOAT })
		Vector3 Position = {};
	};
	struct TexVertex : public Vertex {
		UPROPERTY_vk({}, uint32_t{ VK_FORMAT_R32G32B32_SFLOAT })
		Vector3 Position = {};
		UPROPERTY_vk()
		Vector3 Normal = {};
		UPROPERTY_vk()
		Vector2 TexCoords = {};
	};
	struct BoneVertex : public Vertex
	{
		UPROPERTY_vk({}, uint32_t{ VK_FORMAT_R32G32B32_SFLOAT })
		Vector3 Position = {};
		UPROPERTY_vk()
		Vector2 TexCoords = {};
		UPROPERTY_vk()
		Vector3 Normal = {};
		UPROPERTY_vk()
		Vector3 Tangent = {};
		// 骨骼蒙皮数据
		UPROPERTY_vk()
		float    Weights[MAX_NUM_BONES_PER_VERTEX] = {};
		UPROPERTY_vk()
		uint32_t BoneIDs[MAX_NUM_BONES_PER_VERTEX] = {};

		void AddBoneData(uint32_t boneID, float weight);
	};
};
#include "vertex_gen.inl"