Enable/Disable the sleeping technique. The sleeping technique is used to put bodies that are not moving into sleep to speed up the simulation. * @param isSleepingEnabled True if you want to enable the sleeping technique * and false otherwise */
| 936 | * and false otherwise |
| 937 | */ |
| 938 | void PhysicsWorld::enableSleeping(bool isSleepingEnabled) { |
| 939 | mIsSleepingEnabled = isSleepingEnabled; |
| 940 | |
| 941 | if (!mIsSleepingEnabled) { |
| 942 | |
| 943 | // For each body of the world |
| 944 | Array<RigidBody*>::Iterator it; |
| 945 | for (it = mRigidBodies.begin(); it != mRigidBodies.end(); ++it) { |
| 946 | |
| 947 | // Wake up the rigid body |
| 948 | (*it)->setIsSleeping(false); |
| 949 | } |
| 950 | } |
| 951 | |
| 952 | RP3D_LOG(mConfig.worldName, Logger::Level::Information, Logger::Category::World, |
| 953 | "Physics World: isSleepingEnabled=" + (isSleepingEnabled ? std::string("true") : std::string("false")) , __FILE__, __LINE__); |
| 954 | } |
| 955 | |
| 956 | // Set the number of iterations for the position constraint solver |
| 957 | /** |
no test coverage detected