Synced animations looks good.

This commit is contained in:
Martin Felis
2021-11-13 00:08:32 +01:00
parent c659caebb9
commit 30f1025947
8 changed files with 185 additions and 42 deletions
+10 -1
View File
@@ -9,7 +9,16 @@
void SpeedScaleNode::DrawDebugUi() {
std::string node_name = "SpeedScaleNode: " + m_name;
if (ImGui::TreeNode(node_name.c_str())) {
ImGui::SliderFloat("Time Scale", &m_time_scale, -5.f, 5.f);
bool is_negative = m_time_scale < 0.f;
if (ImGui::Checkbox("Reverse Time", &is_negative)) {
m_time_scale = m_time_scale * -1.f;
}
// ensure m_time_scale is positive
m_time_scale = m_time_scale * (is_negative ? -1.f : 1.f);
ImGui::SliderFloat("Time Scale", &m_time_scale, 0.01f, 5.f);
// and back to the original negative or positive sign
m_time_scale = m_time_scale * (is_negative ? -1.f : 1.f);
m_input_node->DrawDebugUi();