22 template <
typename Tvertex>
39 shared<index_buffer> IndexBuffer {};
40 shared<material> Material {};
41 matr4 LocalTransform {};
58 template <
typename Ttopology>
61 submesh_data new_sub_mesh {};
64 (
u32)TopologyObject.GetVertices().size(),
67 (
u32)TopologyObject.GetIndices().size());
68 new_sub_mesh.VertexArray->SetIndexBuffer(new_sub_mesh.IndexBuffer);
69 new_sub_mesh.VertexArray->SetVertexBuffer(new_sub_mesh.VertexBuffer);
71 new_sub_mesh.Material = Material;
83 template <
typename Tvertex>
86 for (
const auto &submesh_prop : SubmeshesProperties)
88 submesh_data new_sub_mesh {};
91 (
u32)submesh_prop.Topology.GetVertices().size(),
94 (
u32)submesh_prop.Topology.GetIndices().size());
95 new_sub_mesh.VertexArray->SetIndexBuffer(new_sub_mesh.IndexBuffer);
96 new_sub_mesh.VertexArray->SetVertexBuffer(new_sub_mesh.VertexBuffer);
98 new_sub_mesh.Material = submesh_prop.Material;
102 SCL_CORE_INFO(
"Mesh with {} sub-mesh(es) created.", SubmeshesProperties.size());
117 template <
typename Ttopology>
120 return CreateShared<mesh>(TopologyObject, Material);
128 template <
typename Tvertex>
131 return CreateShared<mesh>(SubmeshesProperties);
Buffer interfaces implementation module.
static shared< index_buffer > Create(u32 *Indices, u32 Count)
static shared< mesh > Create(const Ttopology &TopologyObject, shared< material > Material)
std::vector< submesh_data > SubMeshes
mesh(const std::vector< submesh_props< Tvertex > > &SubmeshesProperties)
mesh(const Ttopology &TopologyObject, shared< material > Material)
static shared< mesh > Create(const std::vector< submesh_props< Tvertex > > &SubmeshesProperties)
static shared< vertex_array > Create(mesh_type Mesh_type)
static shared< vertex_buffer > Create(u32 Count, const vertex_layout &VertexLayout)
#define SCL_CORE_INFO(...)
Mesh material class deinition module.
std::shared_ptr< T > shared
math::matr4< float > matr4
shared< material > Material
topology::trimesh Topology
static vertex_layout GetVertexLayout()
Topology object triangles mesh class declaration module.
Vertex array interfaces implementation module.