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

Method SetTransform

engine/source/Box2D/Dynamics/b2Body.cpp:417–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417void b2Body::SetTransform(const b2Vec2& position, float32 angle)
418{
419 b2Assert(m_world->IsLocked() == false);
420 if (m_world->IsLocked() == true)
421 {
422 return;
423 }
424
425 m_xf.q.Set(angle);
426 m_xf.p = position;
427
428 m_sweep.c = b2Mul(m_xf, m_sweep.localCenter);
429 m_sweep.a = angle;
430
431 m_sweep.c0 = m_sweep.c;
432 m_sweep.a0 = angle;
433
434 b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase;
435 for (b2Fixture* f = m_fixtureList; f; f = f->m_next)
436 {
437 f->Synchronize(broadPhase, m_xf, m_xf);
438 }
439
440 m_world->m_contactManager.FindNewContacts();
441}
442
443void b2Body::SynchronizeFixtures()
444{

Callers 2

setPositionMethod · 0.80
setAngleMethod · 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