MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / SetActive

Method SetActive

engine/source/Box2D/Dynamics/b2Body.cpp:456–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

454}
455
456void b2Body::SetActive(bool flag)
457{
458 b2Assert(m_world->IsLocked() == false);
459
460 if (flag == IsActive())
461 {
462 return;
463 }
464
465 if (flag)
466 {
467 m_flags |= e_activeFlag;
468
469 // Create all proxies.
470 b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase;
471 for (b2Fixture* f = m_fixtureList; f; f = f->m_next)
472 {
473 f->CreateProxies(broadPhase, m_xf);
474 }
475
476 // Contacts are created the next time step.
477 }
478 else
479 {
480 m_flags &= ~e_activeFlag;
481
482 // Destroy all proxies.
483 b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase;
484 for (b2Fixture* f = m_fixtureList; f; f = f->m_next)
485 {
486 f->DestroyProxies(broadPhase);
487 }
488
489 // Destroy the attached contacts.
490 b2ContactEdge* ce = m_contactList;
491 while (ce)
492 {
493 b2ContactEdge* ce0 = ce;
494 ce = ce->next;
495 m_world->m_contactManager.Destroy(ce0->contact);
496 }
497 m_contactList = NULL;
498 }
499}
500
501void b2Body::SetFixedRotation(bool flag)
502{

Callers 3

OnRegisterSceneMethod · 0.80
setEnabledMethod · 0.80
setActiveMethod · 0.80

Calls 4

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

Tested by

no test coverage detected