This is called from b2DynamicTree::Query when we are gathering pairs.
(proxyId int)
| 203 | |
| 204 | // This is called from b2DynamicTree::Query when we are gathering pairs. |
| 205 | func (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 | |
| 225 | func (bp *B2BroadPhase) Query(callback B2TreeQueryCallback, aabb B2AABB) { |
| 226 | bp.M_tree.Query(callback, aabb) |