MCPcopy Index your code
hub / github.com/g3n/engine / BoundingBox

Method BoundingBox

core/node.go:118–129  ·  view source on GitHub ↗

BoundingBox satisfies the INode interface. Computes union of own bounding box with those of all descendents.

()

Source from the content-addressed store, hash-verified

116// BoundingBox satisfies the INode interface.
117// Computes union of own bounding box with those of all descendents.
118func (n *Node) BoundingBox() math32.Box3 {
119
120 bbox := math32.Box3{
121 Min: math32.Vector3{X: math.MaxFloat32, Y: math.MaxFloat32, Z: math.MaxFloat32},
122 Max: math32.Vector3{X: -math.MaxFloat32, Y: -math.MaxFloat32, Z: -math.MaxFloat32},
123 }
124 for _, inode := range n.Children() {
125 childBbox := inode.BoundingBox()
126 bbox.Union(&childBbox)
127 }
128 return bbox
129}
130
131// Render satisfies the INode interface.
132func (n *Node) Render(gs *gls.GLS) {}

Callers

nothing calls this directly

Calls 3

ChildrenMethod · 0.95
UnionMethod · 0.95
BoundingBoxMethod · 0.65

Tested by

no test coverage detected