Had a feeling Z was involved haha. Also it’s worth mentioning here that I am NOT using the normal math sin/cos/atan2 functions, as they deal with floats which are slower. I’m using custom routines. As of now, sin/cos are using lookup tables and generate a char that is the “fpart”, which gets added to your location, which is a signed int, formatted 1 byte sector, 1 byte coordinate, and 1 byte fpart. If I need more map space, I can use a long and make the coordinate 2 bytes.
For the arctan, I might end up doing something like char angle_decimal = non_x_vector * 256 / x_vector, (which should give me the decimal, mapped to a byte), then locating angle_decimal in the sinLUT to get the angle.
Edit: One of the caveats being encountered is the domain of arctan. While cos/sin have a domain of [0, 2pi], arctan goes from [-∞, ∞]. How can I deal with this?
Edit 2: Anyone skilled with spritework want to draw a sprite of the Narada from Star Trek 2009?
For the arctan, I might end up doing something like char angle_decimal = non_x_vector * 256 / x_vector, (which should give me the decimal, mapped to a byte), then locating angle_decimal in the sinLUT to get the angle.
Edit: One of the caveats being encountered is the domain of arctan. While cos/sin have a domain of [0, 2pi], arctan goes from [-∞, ∞]. How can I deal with this?
Edit 2: Anyone skilled with spritework want to draw a sprite of the Narada from Star Trek 2009?