DirectZ
Loading...
Searching...
No Matches
dz::ecs::Shape Struct Reference

#include <Shape.hpp>

Inheritance diagram for dz::ecs::Shape:
dz::Provider< Shape >

Static Public Member Functions

static std::pair< int, int > RegisterShape (const std::string &shape_name, const std::string &get_vertex_fn_string, const std::string &get_normal_fn_string)
Static Public Member Functions inherited from dz::Provider< Shape >
static constexpr size_t GetPID ()
static constexpr bool GetIsComponent ()
static constexpr char GetComponentID ()
static constexpr bool GetIsDrawProvider ()
static constexpr bool GetIsCameraProvider ()
static constexpr bool GetIsSceneProvider ()
static float GetPriority ()
static const std::string & GetProviderName ()
static const std::string & GetStructName ()
static const std::string & GetGLSLStruct ()
static const std::unordered_map< ShaderModuleType, std::string > & GetGLSLMethods ()
static std::vector< std::tuple< float, std::string, ShaderModuleType > > & GetGLSLMain ()
static std::shared_ptr< ReflectableGroupTryMakeGroup (BufferGroup *buffer_group)

Public Attributes

int type = 0
int vertex_count = 0

Static Public Attributes

static constexpr size_t PID = 2
static float Priority = 1.0f
static std::string ProviderName = "Shape"
static std::string StructName = "Shape"
static std::string GLSLStruct
static std::unordered_map< ShaderModuleType, std::string > GLSLMethods
static std::vector< std::tuple< float, std::string, ShaderModuleType > > GLSLMain
static std::unordered_map< std::string, size_t > registered_shapes = {}

Member Function Documentation

◆ RegisterShape()

std::pair< int, int > dz::ecs::Shape::RegisterShape ( const std::string & shape_name,
const std::string & get_vertex_fn_string,
const std::string & get_normal_fn_string )
inlinestatic

Member Data Documentation

◆ GLSLMain

std::vector<std::tuple<float, std::string, ShaderModuleType> > dz::ecs::Shape::GLSLMain
inlinestatic
Initial value:
= {
{0.0, R"(
vec3 shape_vertex = GetShapeVertex(entity);
vec3 shape_normal = GetShapeNormal(entity);
}
@ Vertex
Definition Shader.hpp:16

◆ GLSLMethods

std::unordered_map<ShaderModuleType, std::string> dz::ecs::Shape::GLSLMethods
inlinestatic
Initial value:
= {
vec3 GetShapeVertex(in Entity entity) {
Shape shape = Shapes.data[entity.shape_index];
switch (shape.type) {
// [INSERT_SHAPE_VERTEX_CASE]
default: return vec3(0, 0, 0);
}
}
vec3 GetShapeNormal(in Entity entity) {
Shape shape = Shapes.data[entity.shape_index];
switch (shape.type) {
// [INSERT_SHAPE_NORMAL_CASE]
default: return vec3(0, 0, 0);
}
}
)" }
}

◆ GLSLStruct

std::string dz::ecs::Shape::GLSLStruct
inlinestatic
Initial value:
= R"(
struct Shape {
int type;
int vertex_count;
};
)"

◆ PID

size_t dz::ecs::Shape::PID = 2
inlinestaticconstexpr

◆ Priority

float dz::ecs::Shape::Priority = 1.0f
inlinestatic

◆ ProviderName

std::string dz::ecs::Shape::ProviderName = "Shape"
inlinestatic

◆ registered_shapes

std::unordered_map<std::string, size_t> dz::ecs::Shape::registered_shapes = {}
inlinestatic

◆ StructName

std::string dz::ecs::Shape::StructName = "Shape"
inlinestatic

◆ type

int dz::ecs::Shape::type = 0

◆ vertex_count

int dz::ecs::Shape::vertex_count = 0

The documentation for this struct was generated from the following file: