Skip to content

Commit

Permalink
Fixed topology applying and rotation angle conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
denyskryvytskyi committed May 9, 2024
1 parent 218a9b6 commit bf7f871
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Engine/src/Renderer/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void Renderer::Submit(const SharedPtr<Shader>& shader, const SharedPtr<Mesh>& me

void Renderer::Submit(const SharedPtr<VertexArray>& vertexArray, std::uint32_t indexCount, const RenderTopology topology)
{
m_rendererAPI->DrawIndexed(vertexArray, indexCount);
m_rendererAPI->DrawIndexed(vertexArray, indexCount, topology);
}

void Renderer::OnWindowResize(std::uint32_t width, std::uint32_t height)
Expand Down
1 change: 1 addition & 0 deletions Engine/src/Scene/Components/TransformComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class TransformComponent {
void SetPositionX(const float x);
void SetPositionY(const float y);
void SetPositionZ(const float z);
// Rotation angles in radians
void SetRotation(const lia::vec3& rotation);
void SetScale(const lia::vec3& scale);

Expand Down
4 changes: 2 additions & 2 deletions Sandbox3D/src/PrimitivesSandbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ PrimitivesSandbox::PrimitivesSandbox()
scene.AddComponent<elv::TagComponent>(plane, "Plane");
auto& planeTransform = scene.AddComponent<elv::TransformComponent>(plane,
lia::vec3(0.0f, -0.51f, 0.0f),
lia::vec3(-90.0f, 0.0f, 1.0f),
lia::vec3(3.0f, 3.0f, 1.0f));
lia::vec3(3.0f, 3.0f, 1.0f),
lia::vec3(lia::radians(-90.0f), 0.0f, 0.0f));
auto& planeMesh = scene.AddComponent<elv::StaticMeshComponent>(plane, "plane", elv::RenderTopology::TriangleStrip);
auto planeMaterial = planeMesh.GetMaterial();
planeMaterial->SetAmbientColor(lia::vec3(1.0f, 1.0f, 0.0f));
Expand Down

0 comments on commit bf7f871

Please sign in to comment.