@@ -27,30 +27,30 @@ DebugScene::DebugScene(DebugScene &&other)
2727std::tuple<entt::entity, DebugMeshComponent &>
2828DebugScene::addTriad (const Float3 &scale) {
2929 auto triad_datas = loadTriadSolid ();
30- std::vector<GpuVec4 > triad_colors (3 );
30+ std::vector<Float4 > triad_colors (3 );
3131 Mesh triad = createMeshFromBatch (device (), triad_datas, true );
3232 for (size_t i = 0 ; i < 3 ; i++) {
3333 triad_colors[i] = triad_datas[i].material .baseColor ;
3434 }
3535 setupPipelines (triad.layout ());
36- auto entity = m_registry.create ();
36+ entt::entity entity = m_registry.create ();
3737 auto &item = m_registry.emplace <DebugMeshComponent>(
38- entity, DebugPipelines::TRIANGLE_FILL, std::move (triad), triad_colors);
39- item. scale = scale;
38+ entity, DebugPipelines::TRIANGLE_FILL, std::move (triad), triad_colors,
39+ true , scale) ;
4040 m_registry.emplace <TransformComponent>(entity, Mat4f::Identity ());
4141 return {entity, item};
4242}
4343
4444std::tuple<entt::entity, DebugMeshComponent &>
45- DebugScene::addLineGrid (std::optional< Float4> color) {
45+ DebugScene::addLineGrid (const Float4 & color) {
4646 auto grid_data = loadGrid (20 );
4747 Mesh grid = createMesh (device (), grid_data, true );
48- GpuVec4 grid_color = color.value_or (grid_data.material .baseColor );
4948
5049 setupPipelines (grid.layout ());
5150 auto entity = m_registry.create ();
5251 auto &item = m_registry.emplace <DebugMeshComponent>(
53- entity, DebugPipelines::LINE, std::move (grid), std::vector{grid_color});
52+ entity, DebugPipelines::TRIANGLE_LINE, std::move (grid),
53+ std::vector{color});
5454 m_registry.emplace <TransformComponent>(entity, Mat4f::Identity ());
5555 return {entity, item};
5656}
@@ -124,7 +124,7 @@ void DebugScene::render(CommandBuffer &cmdBuf, const Camera &camera) const {
124124 case DebugPipelines::TRIANGLE_FILL:
125125 SDL_BindGPUGraphicsPipeline (render_pass, m_trianglePipeline);
126126 break ;
127- case DebugPipelines::LINE :
127+ case DebugPipelines::TRIANGLE_LINE :
128128 SDL_BindGPUGraphicsPipeline (render_pass, m_linePipeline);
129129 break ;
130130 }
0 commit comments