diff --git a/src/AnimNodes/SpeedScaleNode.cc b/src/AnimNodes/SpeedScaleNode.cc index 5df07e2..c48a750 100644 --- a/src/AnimNodes/SpeedScaleNode.cc +++ b/src/AnimNodes/SpeedScaleNode.cc @@ -14,7 +14,11 @@ void SpeedScaleNode::DrawDebugUi() { // 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); + if (ImGui::SliderFloat("Time Scale", &m_time_scale, 0.01f, 2.f)) { + if (fabs(m_time_scale - 1.0) < 0.2) { + m_time_scale = 1.0; + } + } // and back to the original negative or positive sign m_time_scale = m_time_scale * (is_negative ? -1.f : 1.f); } \ No newline at end of file diff --git a/src/AnimationController.cc b/src/AnimationController.cc index cb266d3..75c44f1 100644 --- a/src/AnimationController.cc +++ b/src/AnimationController.cc @@ -35,14 +35,14 @@ AnimationController::AnimationController(SkinnedMesh* skinned_mesh) sampler_node1->SetAnimation(skinned_mesh->m_animations[2], skinned_mesh->m_animation_sync_track[2]); m_anim_nodes.push_back(sampler_node1); -// SpeedScaleNode* speed_node = new SpeedScaleNode(this); -// speed_node->m_name = "SpeedNode0"; -// speed_node->m_input_node = sampler_node0; -// m_anim_nodes.push_back(speed_node); + SpeedScaleNode* speed_node = new SpeedScaleNode(this); + speed_node->m_name = "SpeedNode0"; + speed_node->m_input_node = sampler_node0; + m_anim_nodes.push_back(speed_node); BlendNode* blend_node = new BlendNode(this); blend_node->m_name = "Blend0"; - blend_node->m_input_A = sampler_node0; + blend_node->m_input_A = speed_node; blend_node->m_input_B = sampler_node1; blend_node->m_sync_inputs = true; m_anim_nodes.push_back(blend_node);