MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / enableSleeping

Method enableSleeping

src/engine/PhysicsWorld.cpp:938–954  ·  view source on GitHub ↗

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 */

Source from the content-addressed store, hash-verified

936 * and false otherwise
937 */
938void 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/**

Callers 1

updateEngineSettingsMethod · 0.80

Calls 3

beginMethod · 0.45
endMethod · 0.45
setIsSleepingMethod · 0.45

Tested by

no test coverage detected