feat: improve fps controller / add fog and ambient light to the scene
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user