Mario Kart 64
|
#include <ultra64.h>
#include <mk64.h>
#include <macros.h>
#include <math_util.h>
#include <main.h>
#include "buffers.h"
#include <PR/rcp.h>
#include "data/trig_tables.h"
#include "math.h"
Variables | |
s32 | D_802B91C0 [2] = { 13, 13 } |
Vec3f | D_802B91C8 = { 0.0f, 0.0f, 0.0f } |
Comment from sm64 unverified. mk64 verison is modified
Helper function for atan2s. Does a look up of the arctangent of y/x assuming the resulting angle is in range [0, 0x2000] (1/8 of a circle).
Compute the angle from (0, 0) to (x, y) as a u16. Given that terrain is in the xz-plane, this is commonly called with (z, x) to get a yaw angle. sm64 but x, y swapped and returns u16.
void calculate_rotation_matrix | ( | Mat3 | destMatrix, |
s16 | rotationAngle, | ||
f32 | rotationX, | ||
f32 | rotationY, | ||
f32 | rotationZ ) |
UNUSED s32 func_802B4F60 | ( | UNUSED s32 | arg0, |
Vec3f | arg1, | ||
UNUSED s32 | arg2, | ||
UNUSED f32 | arg3, | ||
UNUSED f32 | arg4 ) |
f32 is_within_render_distance | ( | Vec3f | cameraPos, |
Vec3f | objectPos, | ||
u16 | orientationY, | ||
f32 | minDistance, | ||
f32 | fov, | ||
f32 | maxDistance ) |
Determines whether an object is within the render distance of a camera.
cameraPos | The position of the camera in 3D space. |
objectPos | The position of the object in 3D space. |
orientationY | The orientation angle of the object around the Y-axis. |
minDistance | The minimum distance at which the object is considered within render distance. |
fov | The field of view (FOV) of the camera. |
maxDistance | The maximum render distance. |
Convert float matrix 'src' to fixed point matrix 'dest'. The float matrix may not contain entries larger than 65536 or the console crashes. The fixed point matrix has entries with a 16-bit integer part, so the floating point numbers are multiplied by 2^16 before being cast to a s32 integer. If this doesn't fit, the N64 and iQue consoles will throw an exception. On Wii and Wii U Virtual Console the value will simply be clamped and no crashes occur.
float-to-integer conversion responsible for PU crashes
Inserts matrix into the rsp. Position, rotation and mode of where to render the next object and check number of object already render Note that gMatrixObjectCount gets reset at the beginning of the game loop. So no cleanup needs to be performed.
s32 D_802B91C0[2] = { 13, 13 } |
Vec3f D_802B91C8 = { 0.0f, 0.0f, 0.0f } |