diff --git a/Editor/src/ComponentsPanel/SpritePanel.h b/Editor/src/ComponentsPanel/SpritePanel.h index 5db42544..676368ef 100644 --- a/Editor/src/ComponentsPanel/SpritePanel.h +++ b/Editor/src/ComponentsPanel/SpritePanel.h @@ -65,6 +65,22 @@ public: ImGui::Checkbox("##lockYRotation", &component.LockYRotation); ImGui::TableNextColumn(); + ComponentTableReset(component.LockYRotation, false); + } + ImGui::TableNextColumn(); + { + ImGui::Text("Position Based"); + if (ImGui::BeginItemTooltip()) + { + ImGui::Text("Orientation is based on the position of the camera or the orientation of the camera."); + ImGui::EndTooltip(); + } + + ImGui::TableNextColumn(); + + ImGui::Checkbox("##positionbased", &component.PositionFacing); + ImGui::TableNextColumn(); + ComponentTableReset(component.LockYRotation, false); } } diff --git a/Editor/src/Windows/EditorInterface.cpp b/Editor/src/Windows/EditorInterface.cpp index e763f029..0437a929 100644 --- a/Editor/src/Windows/EditorInterface.cpp +++ b/Editor/src/Windows/EditorInterface.cpp @@ -638,6 +638,23 @@ namespace Nuake { ImGui::PopStyleColor(); } + ImGui::TableNextColumn(); + { + // Title + ImGui::Text("Ambient Term"); + ImGui::TableNextColumn(); + + // Here we create a dropdown for every sky type. + ImGui::DragFloat("##AmbientTerm", &env->AmbientTerm, 0.001f, 0.00f, 1.0f); + ImGui::TableNextColumn(); + + // Reset button + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1, 1, 1, 0)); + std::string ResetType = ICON_FA_UNDO + std::string("##ambient"); + if (ImGui::Button(ResetType.c_str())) env->AmbientTerm = 0.25f; + ImGui::PopStyleColor(); + } + ImGui::EndTable(); } END_COLLAPSE_HEADER() diff --git a/Nuake/src/Scene/Components/SpriteComponent.cpp b/Nuake/src/Scene/Components/SpriteComponent.cpp index 20e5d5f9..2c4b7341 100644 --- a/Nuake/src/Scene/Components/SpriteComponent.cpp +++ b/Nuake/src/Scene/Components/SpriteComponent.cpp @@ -42,9 +42,10 @@ namespace Nuake json SpriteComponent::Serialize() { BEGIN_SERIALIZE(); - SERIALIZE_VAL(Billboard) - SERIALIZE_VAL(LockYRotation) - SERIALIZE_VAL(SpritePath) + SERIALIZE_VAL(Billboard); + SERIALIZE_VAL(LockYRotation); + SERIALIZE_VAL(SpritePath); + SERIALIZE_VAL(PositionFacing); END_SERIALIZE(); } @@ -60,6 +61,11 @@ namespace Nuake LockYRotation = j["LockYRotation"]; } + if (j.contains("PositionFacing")) + { + PositionFacing = j["PositionFacing"]; + } + if (j.contains("SpritePath")) { SpritePath = j["SpritePath"]; diff --git a/Nuake/src/Scene/Components/SpriteComponent.h b/Nuake/src/Scene/Components/SpriteComponent.h index 36ee0fbe..e22dc0ff 100644 --- a/Nuake/src/Scene/Components/SpriteComponent.h +++ b/Nuake/src/Scene/Components/SpriteComponent.h @@ -11,6 +11,8 @@ namespace Nuake public: bool Billboard; bool LockYRotation; + bool PositionFacing; + std::string SpritePath; Ref SpriteMesh;