2024-05-05 15:44:51 +08:00
|
|
|
|
#pragma once
|
2022-06-24 17:51:39 +08:00
|
|
|
|
|
|
|
|
|
#include<hgl/type/Map.h>
|
|
|
|
|
#include<hgl/type/String.h>
|
2024-04-27 03:09:16 +08:00
|
|
|
|
#include<hgl/graph/AABB.h>
|
2024-05-20 02:12:13 +08:00
|
|
|
|
#include<hgl/graph/VKPrimitiveData.h>
|
2024-04-27 03:09:16 +08:00
|
|
|
|
|
2022-06-24 17:51:39 +08:00
|
|
|
|
VK_NAMESPACE_BEGIN
|
2024-04-27 03:09:16 +08:00
|
|
|
|
|
2022-06-24 17:51:39 +08:00
|
|
|
|
/**
|
2024-05-14 21:09:19 +08:00
|
|
|
|
* 单一图元数据访问接口<br>
|
|
|
|
|
*
|
|
|
|
|
* 这个只是单纯的提供原始VAB/IB数据,派生为两类
|
|
|
|
|
*
|
|
|
|
|
* 一类是传统的,使用独统的独立VAB的
|
|
|
|
|
* 一类是使用VDM的
|
2024-05-16 20:58:44 +08:00
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* WIP: *** 1.将数据全部转移到PrimitiveData,完成旧的渲染测试
|
|
|
|
|
* 2.改成抽象类,将独立VAB的做成一个实现
|
|
|
|
|
* 3.实现VDM支持
|
2022-06-24 17:51:39 +08:00
|
|
|
|
*/
|
|
|
|
|
class Primitive
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
|
2024-05-20 18:04:30 +08:00
|
|
|
|
AnsiString prim_name;
|
2022-06-24 17:51:39 +08:00
|
|
|
|
|
2024-05-22 01:21:05 +08:00
|
|
|
|
PrimitiveData *prim_data;
|
|
|
|
|
|
2022-06-24 17:51:39 +08:00
|
|
|
|
protected:
|
|
|
|
|
|
2024-05-20 18:04:30 +08:00
|
|
|
|
AABB BoundingBox;
|
2022-06-24 17:51:39 +08:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2024-05-20 18:04:30 +08:00
|
|
|
|
Primitive(const AnsiString &n)
|
2023-10-12 05:55:39 +08:00
|
|
|
|
{
|
|
|
|
|
prim_name=n;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-20 18:04:30 +08:00
|
|
|
|
virtual ~Primitive()=0;
|
2022-06-24 17:51:39 +08:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2024-05-20 18:04:30 +08:00
|
|
|
|
virtual const VkDeviceSize GetVertexCount ()const=0;
|
|
|
|
|
virtual const int GetVACount ()const=0;
|
|
|
|
|
virtual const bool GetVABAccess (const AnsiString &,VABAccess *)=0;
|
|
|
|
|
virtual const IBAccess * GetIBAccess ()const=0;
|
2024-04-27 02:19:01 +08:00
|
|
|
|
|
2024-05-20 18:04:30 +08:00
|
|
|
|
const AABB & GetBoundingBox ()const{return BoundingBox;}
|
2022-06-24 17:51:39 +08:00
|
|
|
|
};//class Primitive
|
2024-05-20 18:04:30 +08:00
|
|
|
|
|
|
|
|
|
Primitive *CreatePrimitive(const PrimitiveData *);
|
2022-06-24 17:51:39 +08:00
|
|
|
|
VK_NAMESPACE_END
|