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

Method Synchronize

DynamicsB2Fixture.go:305–327  ·  view source on GitHub ↗
(broadPhase *B2BroadPhase, transform1 B2Transform, transform2 B2Transform)

Source from the content-addressed store, hash-verified

303}
304
305func (fix *B2Fixture) Synchronize(broadPhase *B2BroadPhase, transform1 B2Transform, transform2 B2Transform) {
306
307 if fix.M_proxyCount == 0 {
308 return
309 }
310
311 for i := 0; i < fix.M_proxyCount; i++ {
312
313 proxy := &fix.M_proxies[i]
314
315 // Compute an AABB that covers the swept shape (may miss some rotation effect).
316 aabb1 := MakeB2AABB()
317 aabb2 := MakeB2AABB()
318 fix.M_shape.ComputeAABB(&aabb1, transform1, proxy.ChildIndex)
319 fix.M_shape.ComputeAABB(&aabb2, transform2, proxy.ChildIndex)
320
321 proxy.Aabb.CombineTwoInPlace(aabb1, aabb2)
322
323 displacement := B2Vec2Sub(transform2.P, transform1.P)
324
325 broadPhase.MoveProxy(proxy.ProxyId, proxy.Aabb, displacement)
326 }
327}
328
329func (fix *B2Fixture) SetFilterData(filter B2Filter) {
330 fix.M_filter = filter

Callers 2

SetTransformMethod · 0.80
SynchronizeFixturesMethod · 0.80

Calls 5

MakeB2AABBFunction · 0.85
B2Vec2SubFunction · 0.85
CombineTwoInPlaceMethod · 0.80
ComputeAABBMethod · 0.65
MoveProxyMethod · 0.45

Tested by

no test coverage detected