I'm really not sure whether this is intended behavior or not, so I'm not going to submit a bug report unless told otherwise, but-
When I create an AABB that spans from (-INF, -INF, -INF) to (INF, INF, INF), I get some NaN coordinates and I'm not sure why.
For example, this script:
extends Spatial
var boundary = AABB(Vector3(-INF, -INF, -INF), Vector3(INF, INF, INF))
func _ready():
print(AABB_get_end_points())
func AABB_get_end_points():
var endpoints = []
for i in 8:
var endpoint = boundary.get_endpoint(i)
endpoints.append(endpoint)
return(endpoints)
Prints the following:
[(-1.#INF, -1.#INF, -1.#INF), (-1.#INF, -1.#INF, nan), (-1.#INF, nan, -1.#INF), (-1.#INF, nan, nan), (nan, -1.#INF, -1.#INF), (nan, -1.#INF, nan), (nan, nan, -1.#INF), (nan, nan, nan)]
Even though I would expect it to print this:
[(-1.#INF, -1.#INF, -1.#INF), (-1.#INF, -1.#INF, 1.#INF), (-1.#INF, 1.#INF, -1.#INF), (-1.#INF, 1.#INF, 1.#INF), (1.#INF, -1.#INF, -1.#INF), (1.#INF, -1.#INF, 1.#INF), (1.#INF, 1.#INF, -1.#INF), (1.#INF, 1.#INF, 1.#INF)]
Why's this happening? Is there a better way to get an AABB's endpoints? (For context, I'm trying to construct a PR octree with octants that may have either discreet or infinite positions and sizes.) I suppose I could go through and replace the nans with infinity, but that seems hacky. Thanks!