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

Method QueryCallback

CollisionB2BroadPhase.go:205–223  ·  view source on GitHub ↗

This is called from b2DynamicTree::Query when we are gathering pairs.

(proxyId int)

Source from the content-addressed store, hash-verified

203
204// This is called from b2DynamicTree::Query when we are gathering pairs.
205func (bp *B2BroadPhase) QueryCallback(proxyId int) bool {
206
207 // A proxy cannot form a pair with itself.
208 if proxyId == bp.M_queryProxyId {
209 return true
210 }
211
212 // Grow the pair buffer as needed.
213 if bp.M_pairCount == bp.M_pairCapacity {
214 bp.M_pairBuffer = append(bp.M_pairBuffer, make([]B2Pair, bp.M_pairCapacity)...)
215 bp.M_pairCapacity *= 2
216 }
217
218 bp.M_pairBuffer[bp.M_pairCount].ProxyIdA = MinInt(proxyId, bp.M_queryProxyId)
219 bp.M_pairBuffer[bp.M_pairCount].ProxyIdB = MaxInt(proxyId, bp.M_queryProxyId)
220 bp.M_pairCount++
221
222 return true
223}
224
225func (bp *B2BroadPhase) Query(callback B2TreeQueryCallback, aabb B2AABB) {
226 bp.M_tree.Query(callback, aabb)

Callers

nothing calls this directly

Calls 2

MinIntFunction · 0.85
MaxIntFunction · 0.85

Tested by

no test coverage detected