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

Method setBodyDisabled

src/engine/PhysicsWorld.cpp:168–186  ·  view source on GitHub ↗

Notify the world if a body is disabled (sleeping) or not

Source from the content-addressed store, hash-verified

166
167// Notify the world if a body is disabled (sleeping) or not
168void PhysicsWorld::setBodyDisabled(Entity bodyEntity, bool isDisabled) {
169
170 if (isDisabled == mBodyComponents.getIsEntityDisabled(bodyEntity)) return;
171
172 // Notify all the components
173 mBodyComponents.setIsEntityDisabled(bodyEntity, isDisabled);
174 mTransformComponents.setIsEntityDisabled(bodyEntity, isDisabled);
175
176 assert(mRigidBodyComponents.hasComponent(bodyEntity));
177
178 mRigidBodyComponents.setIsEntityDisabled(bodyEntity, isDisabled);
179
180 // For each collider of the body
181 const Array<Entity>& collidersEntities = mBodyComponents.getColliders(bodyEntity);
182 const uint32 nbColliderEntities = static_cast<uint32>(collidersEntities.size());
183 for (uint32 i=0; i < nbColliderEntities; i++) {
184 mCollidersComponents.setIsEntityDisabled(collidersEntities[i], isDisabled);
185 }
186}
187
188// Notify the world whether a joint is disabled or not
189void PhysicsWorld::setJointDisabled(Entity jointEntity, bool isDisabled) {

Callers 2

setTypeMethod · 0.80
setIsSleepingMethod · 0.80

Calls 4

getIsEntityDisabledMethod · 0.80
setIsEntityDisabledMethod · 0.80
hasComponentMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected