MCPcopy Create free account
hub / github.com/cinder/Cinder / SetActive

Method SetActive

blocks/Box2D/src/Box2D/Dynamics/b2Body.cpp:441–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439}
440
441void b2Body::SetActive(bool flag)
442{
443 b2Assert(m_world->IsLocked() == false);
444
445 if (flag == IsActive())
446 {
447 return;
448 }
449
450 if (flag)
451 {
452 m_flags |= e_activeFlag;
453
454 // Create all proxies.
455 b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase;
456 for (b2Fixture* f = m_fixtureList; f; f = f->m_next)
457 {
458 f->CreateProxies(broadPhase, m_xf);
459 }
460
461 // Contacts are created the next time step.
462 }
463 else
464 {
465 m_flags &= ~e_activeFlag;
466
467 // Destroy all proxies.
468 b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase;
469 for (b2Fixture* f = m_fixtureList; f; f = f->m_next)
470 {
471 f->DestroyProxies(broadPhase);
472 }
473
474 // Destroy the attached contacts.
475 b2ContactEdge* ce = m_contactList;
476 while (ce)
477 {
478 b2ContactEdge* ce0 = ce;
479 ce = ce->next;
480 m_world->m_contactManager.Destroy(ce0->contact);
481 }
482 m_contactList = NULL;
483 }
484}
485
486void b2Body::Dump()
487{

Callers

nothing calls this directly

Calls 4

IsLockedMethod · 0.80
CreateProxiesMethod · 0.80
DestroyProxiesMethod · 0.80
DestroyMethod · 0.45

Tested by

no test coverage detected