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

Method ComputeAABB

CollisionB2ShapeEdge.go:128–139  ·  view source on GitHub ↗
(aabb *B2AABB, xf B2Transform, childIndex int)

Source from the content-addressed store, hash-verified

126}
127
128func (edge B2EdgeShape) ComputeAABB(aabb *B2AABB, xf B2Transform, childIndex int) {
129
130 v1 := B2TransformVec2Mul(xf, edge.M_vertex1)
131 v2 := B2TransformVec2Mul(xf, edge.M_vertex2)
132
133 lower := B2Vec2Min(v1, v2)
134 upper := B2Vec2Max(v1, v2)
135
136 r := MakeB2Vec2(edge.M_radius, edge.M_radius)
137 aabb.LowerBound = B2Vec2Sub(lower, r)
138 aabb.UpperBound = B2Vec2Sub(upper, r)
139}
140
141func (edge B2EdgeShape) ComputeMass(massData *B2MassData, density float64) {
142 massData.Mass = 0.0

Callers

nothing calls this directly

Calls 5

B2TransformVec2MulFunction · 0.85
B2Vec2MinFunction · 0.85
B2Vec2MaxFunction · 0.85
MakeB2Vec2Function · 0.85
B2Vec2SubFunction · 0.85

Tested by

no test coverage detected