Mario Kart 64
|
#include <libultraship.h>
#include <mk64.h>
#include <macros.h>
#include <math_util.h>
#include <main.h>
#include "buffers.h"
#include "buffers/trig_tables.h"
#include "math.h"
#include "memory.h"
#include "engine/Matrix.h"
#include "course.h"
#include "port/Game.h"
#include <port/interpolation/FrameInterpolation.h>
#include <port/interpolation/matrix.h>
Functions | |
UNUSED s32 | func_802B4F60 (UNUSED s32 arg0, Vec3f arg1, UNUSED s32 arg2, UNUSED f32 arg3, UNUSED f32 arg4) |
UNUSED void | func_802B4FF0 () |
s32 | render_set_position (Mat4 mtx, s32 arg1) |
f32 | func_802B51E8 (Vec3f arg0, Vec3f arg1) |
s32 | get_angle_between_two_vectors (Vec3f arg0, Vec3f arg1) |
u32 | func_802B5258 (Vec3f arg0, Vec3s arg1) |
void | vec3f_set (Vec3f arg0, f32 arg1, f32 arg2, f32 arg3) |
void | vec3s_set (Vec3s arg0, s16 arg1, s16 arg2, s16 arg3) |
void * | vec3f_copy_return (Vec3f dest, Vec3f src) |
void | vec3s_copy (Vec3s dest, Vec3s src) |
UNUSED void * | vec3f_set_return (Vec3f dest, f32 x, f32 y, f32 z) |
void | mtxf_copy (Mat4 mat1, Mat4 mat2) |
void | mtxf_copy_n_element (s32 *dest, s32 *src, s32 n) |
void | mtxf_identity (Mat4 mtx) |
void | add_translate_mat4_vec3f (Mat4 mat, Mat4 dest, Vec3f pos) |
UNUSED void | add_translate_mat4_vec3f_lite (Mat4 mat, Mat4 dest, Vec3f pos) |
void | mtxf_translate (Mat4 dest, Vec3f b) |
void | func_802B5564 (Mat4 arg0, u16 *arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) |
void | func_802B5794 (Mat4 mtx, Vec3f from, Vec3f to) |
void | mtxf_rotate_x (Mat4 mat, s16 angle) |
void | mtxf_rotate_y (Mat4 mat, s16 angle) |
void | mtxf_s16_rotate_z (Mat4 mat, s16 angle) |
void | func_802B5CAC (s16 arg0, s16 arg1, Vec3f arg2) |
void | func_802B5D30 (s16 arg0, s16 arg1, s32 arg2) |
void | set_track_light_direction (Lights1 *addr, s16 pitch, s16 yaw, s32 numLights) |
void | mtxf_scale (Mat4 mat, f32 coef) |
void | mtxf_pos_rotation_xyz (Mat4 out, Vec3f pos, Vec3s orientation) |
UNUSED void | func_802B60B4 (Mat4 arg0, Vec3s arg1, Vec3s arg2) |
UNUSED void | func_802B6214 (Mat4 arg0, Vec3s arg1, Vec3s arg2) |
UNUSED void | func_802B6374 (Vec3f arg0) |
void | mtxf_translate_vec3f_mat3 (Vec3f pos, Mat3 mat) |
void | mtxf_translate_vec3f_mat4 (Vec3f pos, Mat4 mat) |
UNUSED void | func_802B64B0 (UNUSED s32 arg0, UNUSED s32 arg1, UNUSED s32 arg2, UNUSED s32 arg3) |
void | func_802B64C4 (Vec3f arg0, s16 arg1) |
void | calculate_orientation_matrix (Mat3 dest, f32 x, f32 y, f32 z, s16 rotationAngle) |
UNUSED void | func_802B68F8 (Mat3 matrix, f32 arg1, f32 arg2, f32 arg3) |
void | calculate_rotation_matrix (Mat3 destMatrix, s16 rotationAngle, f32 rotationX, f32 rotationY, f32 rotationZ) |
UNUSED void | func_802B6BC0 (Mat4 arg0, s16 arg1, f32 arg2, f32 arg3, f32 arg4) |
void | func_802B6D58 (Mat4 arg0, Vec3f arg1, Vec3f arg2) |
void | mtxf_multiplication (Mat4 dest, Mat4 mat1, Mat4 mat2) |
void | mtxf_to_mtx (Mtx *dest, Mat4 src) |
u16 | atan2_lookup (f32 y, f32 x) |
u16 | atan2s (f32 x, f32 y) |
f32 | _atan2f (f32 arg0, f32 arg1) |
UNUSED f32 | func_802B79F0 (f32 arg0, f32 arg1) |
UNUSED u16 | func_802B7B50 (f32 arg0, f32 arg1) |
UNUSED void | func_802B7C18 (f32 arg0) |
s16 | func_802B7C40 (f32 arg0) |
UNUSED void | func_802B7C6C (f32 arg0) |
s16 | func_802B7CA8 (f32 arg0) |
f32 | calculate_vector_angle_xy (f32 vectorX) |
UNUSED s16 | func_802B7D28 (f32 arg0) |
u16 | random_u16 (void) |
u16 | random_int (u16 arg0) |
s16 | func_802B7F34 (f32 arg0, f32 arg1, f32 arg2, f32 arg3) |
void | func_802B7F7C (Vec3f arg0, Vec3f arg1, Vec3s dest) |
f32 | sins (u16 arg0) |
f32 | coss (u16 arg0) |
s32 | is_visible_between_angle (u16 arg0, u16 arg1, u16 arg2) |
f32 | is_within_render_distance (Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 minDistance, f32 fov, f32 maxDistance) |
UNUSED void | func_802B8414 (uintptr_t addr, Mat4 arg1, s16 arg2, s16 arg3, s32 arg4) |
Variables | |
s32 | D_802B91C0 [2] = { 13, 13 } |
Vec3f | D_802B91C8 = { 0.0f, 0.0f, 0.0f } |
f32 _atan2f | ( | f32 | arg0, |
f32 | arg1 ) |
u16 atan2_lookup | ( | f32 | y, |
f32 | x ) |
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).
u16 atan2s | ( | f32 | x, |
f32 | y ) |
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_orientation_matrix | ( | Mat3 | dest, |
f32 | x, | ||
f32 | y, | ||
f32 | z, | ||
s16 | rotationAngle ) |
void calculate_rotation_matrix | ( | Mat3 | destMatrix, |
s16 | rotationAngle, | ||
f32 | rotationX, | ||
f32 | rotationY, | ||
f32 | rotationZ ) |
f32 calculate_vector_angle_xy | ( | f32 | vectorX | ) |
f32 coss | ( | u16 | arg0 | ) |
UNUSED s32 func_802B4F60 | ( | UNUSED s32 | arg0, |
Vec3f | arg1, | ||
UNUSED s32 | arg2, | ||
UNUSED f32 | arg3, | ||
UNUSED f32 | arg4 ) |
UNUSED void func_802B4FF0 | ( | ) |
void func_802B5564 | ( | Mat4 | arg0, |
u16 * | arg1, | ||
f32 | arg2, | ||
f32 | arg3, | ||
f32 | arg4, | ||
f32 | arg5, | ||
f32 | arg6 ) |
void func_802B5CAC | ( | s16 | arg0, |
s16 | arg1, | ||
Vec3f | arg2 ) |
void func_802B5D30 | ( | s16 | arg0, |
s16 | arg1, | ||
s32 | arg2 ) |
void func_802B64C4 | ( | Vec3f | arg0, |
s16 | arg1 ) |
UNUSED f32 func_802B79F0 | ( | f32 | arg0, |
f32 | arg1 ) |
UNUSED u16 func_802B7B50 | ( | f32 | arg0, |
f32 | arg1 ) |
UNUSED void func_802B7C18 | ( | f32 | arg0 | ) |
s16 func_802B7C40 | ( | f32 | arg0 | ) |
UNUSED void func_802B7C6C | ( | f32 | arg0 | ) |
s16 func_802B7CA8 | ( | f32 | arg0 | ) |
UNUSED s16 func_802B7D28 | ( | f32 | arg0 | ) |
s16 func_802B7F34 | ( | f32 | arg0, |
f32 | arg1, | ||
f32 | arg2, | ||
f32 | arg3 ) |
s32 is_visible_between_angle | ( | u16 | arg0, |
u16 | arg1, | ||
u16 | arg2 ) |
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. |
void mtxf_copy_n_element | ( | s32 * | dest, |
s32 * | src, | ||
s32 | n ) |
void mtxf_identity | ( | Mat4 | mtx | ) |
void mtxf_rotate_x | ( | Mat4 | mat, |
s16 | angle ) |
void mtxf_rotate_y | ( | Mat4 | mat, |
s16 | angle ) |
void mtxf_s16_rotate_z | ( | Mat4 | mat, |
s16 | angle ) |
void mtxf_scale | ( | Mat4 | mat, |
f32 | coef ) |
void mtxf_to_mtx | ( | Mtx * | dest, |
Mat4 | src ) |
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
u16 random_int | ( | u16 | arg0 | ) |
u16 random_u16 | ( | void | ) |
s32 render_set_position | ( | Mat4 | mtx, |
s32 | arg1 ) |
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.
void set_track_light_direction | ( | Lights1 * | addr, |
s16 | pitch, | ||
s16 | yaw, | ||
s32 | numLights ) |
f32 sins | ( | u16 | arg0 | ) |
void vec3f_set | ( | Vec3f | arg0, |
f32 | arg1, | ||
f32 | arg2, | ||
f32 | arg3 ) |
void vec3s_set | ( | Vec3s | arg0, |
s16 | arg1, | ||
s16 | arg2, | ||
s16 | arg3 ) |
s32 D_802B91C0[2] = { 13, 13 } |
Vec3f D_802B91C8 = { 0.0f, 0.0f, 0.0f } |