added multi color type at CreateRenderableCube and CreateRenderableBoundingBox

This commit is contained in:
hyzboy 2022-01-10 20:28:02 +08:00
parent 1fa9f300a6
commit 3e920b3bdc

View File

@ -99,8 +99,18 @@ namespace hgl
bool has_tangent; bool has_tangent;
bool has_tex_coord; bool has_tex_coord;
bool has_color; enum class ColorType
Vector4f color; {
NoColor=0, ///<没有颜色
SameColor, ///<一个颜色
FaceColor, ///<每个面一个颜色(请写入6个颜色值)
VertexColor, ///<每个顶点一个颜色(请写入24个颜色值)
ENUM_CLASS_RANGE(NoColor,VertexColor)
};
ColorType color_type;
Vector4f color[24];
public: public:
@ -110,7 +120,7 @@ namespace hgl
has_tangent=false; has_tangent=false;
has_tex_coord=false; has_tex_coord=false;
has_color=false; color_type=ColorType::NoColor;
} }
};//struct CubeCreateInfo };//struct CubeCreateInfo
@ -119,10 +129,36 @@ namespace hgl
*/ */
Renderable *CreateRenderableCube(RenderResource *db,const VAB *vab,const CubeCreateInfo *cci); Renderable *CreateRenderableCube(RenderResource *db,const VAB *vab,const CubeCreateInfo *cci);
struct BoundingBoxCreateInfo
{
bool has_normal;
enum class ColorType
{
NoColor=0, ///<没有颜色
SameColor, ///<一个颜色
VertexColor, ///<每个顶点一个颜色(请写入8个颜色值)
ENUM_CLASS_RANGE(NoColor,VertexColor)
};
ColorType color_type;
Vector4f color[8];
public:
BoundingBoxCreateInfo()
{
has_normal=false;
color_type=ColorType::NoColor;
}
};//struct BoundingBoxCreateInfo
/** /**
* (线) * (线)
*/ */
Renderable *CreateRenderableBoundingBox(RenderResource *db,const VAB *vab,const CubeCreateInfo *cci); Renderable *CreateRenderableBoundingBox(RenderResource *db,const VAB *vab,const BoundingBoxCreateInfo *cci);
/** /**
* 0,0,01() * 0,0,01()