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-23 02:19:40 +08:00
|
|
|
|
#include<hgl/graph/VK.h>
|
2024-04-27 03:09:16 +08:00
|
|
|
|
|
2022-06-24 17:51:39 +08:00
|
|
|
|
VK_NAMESPACE_BEGIN
|
|
|
|
|
/**
|
2024-05-28 02:21:33 +08:00
|
|
|
|
* 原始图元数据访问接口<br>
|
|
|
|
|
* Primitive的存为是为了屏蔽PrimitiveData的初始化之类的访问接口,以便于更好的管理和使用
|
2022-06-24 17:51:39 +08:00
|
|
|
|
*/
|
|
|
|
|
class Primitive
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
|
2024-05-25 01:46:19 +08:00
|
|
|
|
AnsiString prim_name;
|
2024-05-22 01:21:05 +08:00
|
|
|
|
|
2024-05-25 01:46:19 +08:00
|
|
|
|
PrimitiveData * prim_data;
|
2022-06-24 17:51:39 +08:00
|
|
|
|
|
2024-05-23 02:19:40 +08:00
|
|
|
|
protected:
|
2022-06-24 17:51:39 +08:00
|
|
|
|
|
2024-05-25 01:46:19 +08:00
|
|
|
|
AABB BoundingBox;
|
|
|
|
|
|
2024-05-23 02:19:40 +08:00
|
|
|
|
public:
|
|
|
|
|
|
2024-05-25 01:46:19 +08:00
|
|
|
|
Primitive(const AnsiString &pn,PrimitiveData *pd);
|
|
|
|
|
virtual ~Primitive();
|
2022-06-24 17:51:39 +08:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2024-05-23 02:19:40 +08:00
|
|
|
|
const AnsiString & GetName ()const{ return prim_name; }
|
2024-05-25 22:08:01 +08:00
|
|
|
|
|
2024-05-23 02:19:40 +08:00
|
|
|
|
const VkDeviceSize GetVertexCount ()const;
|
2024-05-25 01:46:19 +08:00
|
|
|
|
const int GetVABCount ()const;
|
2024-05-28 23:10:50 +08:00
|
|
|
|
const int GetVABIndex (const AnsiString &name)const;
|
|
|
|
|
VAB * GetVAB (const int);
|
|
|
|
|
VAB * GetVAB (const AnsiString &name){return GetVAB(GetVABIndex(name));}
|
|
|
|
|
const int32_t GetVertexOffset ()const; ///<取得顶点偏移(注意是顶点不是字节)
|
2024-05-28 02:21:33 +08:00
|
|
|
|
|
2024-05-28 23:10:50 +08:00
|
|
|
|
const uint32_t GetIndexCount ()const;
|
2024-05-25 22:08:01 +08:00
|
|
|
|
IndexBuffer * GetIBO ();
|
2024-05-28 23:10:50 +08:00
|
|
|
|
const uint32_t GetFirstIndex ()const; ///<取得第一个索引
|
2024-04-27 02:19:01 +08:00
|
|
|
|
|
2024-05-23 02:19:40 +08:00
|
|
|
|
const AABB & GetBoundingBox ()const{return BoundingBox;}
|
2022-06-24 17:51:39 +08:00
|
|
|
|
};//class Primitive
|
|
|
|
|
VK_NAMESPACE_END
|