| 439 | } |
| 440 | |
| 441 | void 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 | |
| 486 | void b2Body::Dump() |
| 487 | { |
nothing calls this directly
no test coverage detected