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

Method SetTransform

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

Source from the content-addressed store, hash-verified

400}
401
402void b2Body::SetTransform(const b2Vec2& position, float32 angle)
403{
404 b2Assert(m_world->IsLocked() == false);
405 if (m_world->IsLocked() == true)
406 {
407 return;
408 }
409
410 m_xf.q.Set(angle);
411 m_xf.p = position;
412
413 m_sweep.c = b2Mul(m_xf, m_sweep.localCenter);
414 m_sweep.a = angle;
415
416 m_sweep.c0 = m_sweep.c;
417 m_sweep.a0 = angle;
418
419 b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase;
420 for (b2Fixture* f = m_fixtureList; f; f = f->m_next)
421 {
422 f->Synchronize(broadPhase, m_xf, m_xf);
423 }
424
425 m_world->m_contactManager.FindNewContacts();
426}
427
428void b2Body::SynchronizeFixtures()
429{

Callers 2

scrollIslandsMethod · 0.80
setPositionMethod · 0.80

Calls 5

b2MulFunction · 0.85
IsLockedMethod · 0.80
SynchronizeMethod · 0.80
FindNewContactsMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected