MCPcopy
hub / github.com/g3n/engine / BoundingBox

Method BoundingBox

experimental/physics/object/body.go:231–238  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

229}
230
231func (b *Body) BoundingBox() math32.Box3 {
232
233 // TODO future allow multiple shapes
234 mat4 := math32.NewMatrix4().Compose(b.position, b.quaternion, math32.NewVector3(1, 1, 1))
235 localBB := b.shape.BoundingBox()
236 worldBB := localBB.ApplyMatrix4(mat4)
237 return *worldBB
238}
239
240func (b *Body) SetMass(mass float32) {
241

Callers

nothing calls this directly

Calls 5

NewMatrix4Function · 0.92
NewVector3Function · 0.92
ComposeMethod · 0.80
BoundingBoxMethod · 0.65
ApplyMatrix4Method · 0.45

Tested by

no test coverage detected