From 5bc9d431a0e22507d46a336047939f955bad7373 Mon Sep 17 00:00:00 2001 From: Lunkhound Date: Sun, 21 May 2017 03:09:57 -0700 Subject: [PATCH] CommonRigidBodyMTBase: replace dynamic_cast (which crashes without RTTI) with static_cast --- .../MultiThreadedDemo/CommonRigidBodyMTBase.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/MultiThreadedDemo/CommonRigidBodyMTBase.cpp b/examples/MultiThreadedDemo/CommonRigidBodyMTBase.cpp index 17c5f802d..81446ee0b 100644 --- a/examples/MultiThreadedDemo/CommonRigidBodyMTBase.cpp +++ b/examples/MultiThreadedDemo/CommonRigidBodyMTBase.cpp @@ -588,6 +588,10 @@ public: ) : btDiscreteDynamicsWorldMt( dispatcher, pairCache, constraintSolver, collisionConfiguration ) { +#if USE_PARALLEL_ISLAND_SOLVER + btSimulationIslandManagerMt* islandMgr = static_cast( m_islandManager ); + islandMgr->setIslandDispatchFunction( parallelIslandDispatch ); +#endif //#if USE_PARALLEL_ISLAND_SOLVER } }; @@ -762,14 +766,7 @@ void CommonRigidBodyMTBase::createEmptyDynamicsWorld() #endif //#if USE_PARALLEL_ISLAND_SOLVER btDiscreteDynamicsWorld* world = new MyDiscreteDynamicsWorld( m_dispatcher, m_broadphase, m_solver, m_collisionConfiguration ); m_dynamicsWorld = world; - -#if USE_PARALLEL_ISLAND_SOLVER - if ( btSimulationIslandManagerMt* islandMgr = dynamic_cast( world->getSimulationIslandManager() ) ) - { - islandMgr->setIslandDispatchFunction( parallelIslandDispatch ); - m_multithreadedWorld = true; - } -#endif //#if USE_PARALLEL_ISLAND_SOLVER + m_multithreadedWorld = true; } else {