From c1fa4c62ce0c1200ac952c8415ec96d898127599 Mon Sep 17 00:00:00 2001 From: SweetId <2630750+SweetId@users.noreply.github.com> Date: Fri, 17 Nov 2023 14:47:09 +0530 Subject: [PATCH] fix box construction --- src/NazaraEditor/Editor/Application.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/NazaraEditor/Editor/Application.cpp b/src/NazaraEditor/Editor/Application.cpp index c10398d..24ce8cf 100644 --- a/src/NazaraEditor/Editor/Application.cpp +++ b/src/NazaraEditor/Editor/Application.cpp @@ -47,14 +47,10 @@ namespace NzEditor auto cube = CreateEntity("Cube"); Nz::GraphicsComponent& graphicsComponent = cube.emplace(); - std::shared_ptr boxMesh = Nz::GraphicalMesh::Build(Nz::Primitive::Box(Nz::Vector3f(4.f), Nz::Vector3ui::Zero(), Nz::Matrix4f::Scale(Nz::Vector3f(-1.f)), Nz::Rectf(0.f, 0.f, 2.f, 2.f))); + std::shared_ptr boxMesh = Nz::GraphicalMesh::Build(Nz::Primitive::Box(Nz::Vector3f(1.f), Nz::Vector3ui::Zero(), Nz::Matrix4f::Scale(Nz::Vector3f(1.f)), Nz::Rectf(0.f, 0.f, 2.f, 2.f))); std::shared_ptr boxMat = Nz::MaterialInstance::Instantiate(Nz::MaterialType::Phong); - boxMat->DisablePass("ShadowPass"); - boxMat->UpdatePassesStates([&](Nz::RenderStates& states) - { - states.frontFace = Nz::FrontFace::Clockwise; - }); + std::shared_ptr boxModel = std::make_shared(std::move(boxMesh)); boxModel->SetMaterial(0, std::move(boxMat)); graphicsComponent.AttachRenderable(boxModel);