feat: improve fps controller / add fog and ambient light to the scene

This commit is contained in:
2026-10-16 09:29:59 +02:00
parent 21621001c2
commit 4c9b77c948
105 changed files with 609 additions and 110 deletions
+10 -1
View File
@@ -106,7 +106,8 @@ nlohmann::json Rigidbody::Serialize() const {
{"friction", m_Friction},
{"restitution", m_Restitution},
{"useGravity", m_UseGravity},
{"allowSleep", m_AllowSleep}
{"allowSleep", m_AllowSleep},
{"freezeRotation", m_FreezeRotation}
};
}
@@ -129,6 +130,9 @@ void Rigidbody::Deserialize(const nlohmann::json& data) {
if (data.contains("allowSleep")) {
m_AllowSleep = data.at("allowSleep").get<bool>();
}
if (data.contains("freezeRotation")) {
m_FreezeRotation = data.at("freezeRotation").get<bool>();
}
}
void Rigidbody::ImGuiInspector() {
@@ -163,6 +167,11 @@ void Rigidbody::ImGuiInspector() {
SetAllowSleep(allowSleep);
}
bool freezeRotation = m_FreezeRotation;
if (ImGui::Checkbox("Freeze rotation", &freezeRotation)) {
SetFreezeRotation(freezeRotation);
}
if (HasPhysicsBody()) {
const glm::vec3 velocity = GetLinearVelocity();
ImGui::Text(