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

Method Refilter

DynamicsB2Fixture.go:334–364  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

332}
333
334func (fix *B2Fixture) Refilter() {
335
336 if fix.M_body == nil {
337 return
338 }
339
340 // Flag associated contacts for filtering.
341 edge := fix.M_body.GetContactList()
342 for edge != nil {
343 contact := edge.Contact
344 fixtureA := contact.GetFixtureA()
345 fixtureB := contact.GetFixtureB()
346 if fixtureA == fix || fixtureB == fix {
347 contact.FlagForFiltering()
348 }
349
350 edge = edge.Next
351 }
352
353 world := fix.M_body.GetWorld()
354
355 if world == nil {
356 return
357 }
358
359 // Touch each proxy so that new pairs may be created
360 broadPhase := &world.M_contactManager.M_broadPhase
361 for i := 0; i < fix.M_proxyCount; i++ {
362 broadPhase.TouchProxy(fix.M_proxies[i].ProxyId)
363 }
364}
365
366func (fix *B2Fixture) SetSensor(sensor bool) {
367 if sensor != fix.M_isSensor {

Callers 1

SetFilterDataMethod · 0.95

Calls 6

GetWorldMethod · 0.80
TouchProxyMethod · 0.80
GetFixtureAMethod · 0.65
GetFixtureBMethod · 0.65
FlagForFilteringMethod · 0.65
GetContactListMethod · 0.45

Tested by

no test coverage detected