(aabb *B2AABB, xf B2Transform, childIndex int)
| 333 | } |
| 334 | |
| 335 | func (poly B2PolygonShape) ComputeAABB(aabb *B2AABB, xf B2Transform, childIndex int) { |
| 336 | |
| 337 | lower := B2TransformVec2Mul(xf, poly.M_vertices[0]) |
| 338 | upper := lower |
| 339 | |
| 340 | for i := 1; i < poly.M_count; i++ { |
| 341 | v := B2TransformVec2Mul(xf, poly.M_vertices[i]) |
| 342 | lower = B2Vec2Min(lower, v) |
| 343 | upper = B2Vec2Max(upper, v) |
| 344 | } |
| 345 | |
| 346 | r := MakeB2Vec2(poly.M_radius, poly.M_radius) |
| 347 | aabb.LowerBound = B2Vec2Sub(lower, r) |
| 348 | aabb.UpperBound = B2Vec2Sub(upper, r) |
| 349 | } |
| 350 | |
| 351 | func (poly B2PolygonShape) ComputeMass(massData *B2MassData, density float64) { |
| 352 | // Polygon mass, centroid, and inertia. |
nothing calls this directly
no test coverage detected