Package gameobjects :: Module util
[hide private]
[frames] | no frames]

Module util

source code

Functions [hide private]
 
format_number(n, accuracy=6)
Formats a number in a friendly manner (removes trailing zeros and unneccesary point.
source code
 
lerp(a, b, i)
Linear enterpolate from a to b.
source code
 
range2d(range_x, range_y)
Creates a 2D range.
source code
 
xrange2d(range_x, range_y)
Iterates over a 2D range.
source code
 
saturate(value, low, high) source code
 
is_power_of_2(n)
Returns True if a value is a power of 2.
source code
 
next_power_of_2(n)
Returns the next power of 2 that is >= n
source code
Variables [hide private]
  e = 2.71828182846
  pi = 3.14159265359