MCPcopy Create free account
hub / github.com/ByteArena/box2d / SetTransform

Method SetTransform

DynamicsB2Body.go:843–863  ·  view source on GitHub ↗
(position B2Vec2, angle float64)

Source from the content-addressed store, hash-verified

841}
842
843func (body *B2Body) SetTransform(position B2Vec2, angle float64) {
844 B2Assert(body.M_world.IsLocked() == false)
845
846 if body.M_world.IsLocked() == true {
847 return
848 }
849
850 body.M_xf.Q.Set(angle)
851 body.M_xf.P = position
852
853 body.M_sweep.C = B2TransformVec2Mul(body.M_xf, body.M_sweep.LocalCenter)
854 body.M_sweep.A = angle
855
856 body.M_sweep.C0 = body.M_sweep.C
857 body.M_sweep.A0 = angle
858
859 broadPhase := &body.M_world.M_contactManager.M_broadPhase
860 for f := body.M_fixtureList; f != nil; f = f.M_next {
861 f.Synchronize(broadPhase, body.M_xf, body.M_xf)
862 }
863}
864
865func (body *B2Body) SynchronizeFixtures() {
866 xf1 := MakeB2Transform()

Callers

nothing calls this directly

Calls 5

B2AssertFunction · 0.85
B2TransformVec2MulFunction · 0.85
IsLockedMethod · 0.80
SynchronizeMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected