MCPcopy Index your code
hub / github.com/fogleman/Minecraft / normalize

Function normalize

main.py:94–109  ·  view source on GitHub ↗

Accepts `position` of arbitrary precision and returns the block containing that position. Parameters ---------- position : tuple of len 3 Returns ------- block_position : tuple of ints of len 3

(position)

Source from the content-addressed store, hash-verified

92
93
94def normalize(position):
95 """ Accepts `position` of arbitrary precision and returns the block
96 containing that position.
97
98 Parameters
99 ----------
100 position : tuple of len 3
101
102 Returns
103 -------
104 block_position : tuple of ints of len 3
105
106 """
107 x, y, z = position
108 x, y, z = (int(round(x)), int(round(y)), int(round(z)))
109 return (x, y, z)
110
111
112def sectorize(position):

Callers 3

sectorizeFunction · 0.85
hit_testMethod · 0.85
collideMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected