Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iRi-E/938497 to your computer and use it in GitHub Desktop.
Save iRi-E/938497 to your computer and use it in GitHub Desktop.
diff --git a/QMA/QMAWindow.cc b/QMA/QMAWindow.cc
index ad68606..366fe57 100644
--- a/QMA/QMAWindow.cc
+++ b/QMA/QMAWindow.cc
@@ -261,8 +261,11 @@ void QMAWindow::togglePhysicSimulation()
MMDAI::SceneController *controller = m_widget->getSceneController();
int count = controller->countPMDObjects();
m_enablePhysicsSimulation = !m_enablePhysicsSimulation;
- for (int i = 0; i < count; i++)
- controller->getPMDObject(i)->getPMDModel()->setPhysicsControl(m_enablePhysicsSimulation);
+ for (int i = 0; i < count; i++) {
+ MMDAI::PMDObject *object = controller->getPMDObject(i);
+ if (object->isEnable())
+ object->getPMDModel()->setPhysicsControl(m_enablePhysicsSimulation);
+ }
}
void QMAWindow::toggleShadowMapping()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment