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

Method ComputeAABB

CollisionB2ShapeChain.go:178–192  ·  view source on GitHub ↗
(aabb *B2AABB, xf B2Transform, childIndex int)

Source from the content-addressed store, hash-verified

176}
177
178func (chain B2ChainShape) ComputeAABB(aabb *B2AABB, xf B2Transform, childIndex int) {
179 B2Assert(childIndex < chain.M_count)
180
181 i1 := childIndex
182 i2 := childIndex + 1
183 if i2 == chain.M_count {
184 i2 = 0
185 }
186
187 v1 := B2TransformVec2Mul(xf, chain.M_vertices[i1])
188 v2 := B2TransformVec2Mul(xf, chain.M_vertices[i2])
189
190 aabb.LowerBound = B2Vec2Min(v1, v2)
191 aabb.UpperBound = B2Vec2Max(v1, v2)
192}
193
194func (chain B2ChainShape) ComputeMass(massData *B2MassData, density float64) {
195 massData.Mass = 0.0

Callers

nothing calls this directly

Calls 4

B2AssertFunction · 0.85
B2TransformVec2MulFunction · 0.85
B2Vec2MinFunction · 0.85
B2Vec2MaxFunction · 0.85

Tested by

no test coverage detected