MCPcopy Create free account
hub / github.com/EngoEngine/engo / calcMaxLevel

Function calcMaxLevel

quadtree.go:96–103  ·  view source on GitHub ↗
(width, height float32)

Source from the content-addressed store, hash-verified

94}
95
96func calcMaxLevel(width, height float32) int {
97 res := 0
98 for width > minQuadtreeCellSize && height > minQuadtreeCellSize {
99 res++
100 width, height = width/2, height/2
101 }
102 return res
103}
104
105// NewQuadtree creates a new quadtree for the given bounds.
106// When setting usePool to true, the internal values will be taken from a sync.Pool which reduces the allocation overhead.

Callers 1

NewQuadtreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected