Mario Kart 64
Loading...
Searching...
No Matches
render.inc.c
Go to the documentation of this file.
1#include <ultra64.h>
2#include <macros.h>
3#include <actor_types.h>
4#include "camera.h"
5#include "main.h"
6#include "actors.h"
8#include <PR/gbi.h>
9
19void render_actor_paddle_boat(Camera *arg0, struct PaddleWheelBoat *boat, UNUSED Mat4 arg2, u16 pathCounter) {
20 UNUSED s32 pad[3];
21 Vec3f sp120;
22 Mat4 spE0;
23 Mat4 spA0;
24 Mat4 sp60;
25 f32 temp;
26
27 if ((pathCounter > 20) && (pathCounter < 25)) { return; }
28
29 temp = is_within_render_distance(arg0->pos, boat->pos, arg0->rot[1], 90000.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
30
31 if (temp < 0.0f) { return; }
32
33 gSPSetLights1(gDisplayListHead++, D_800DC610[1]);
34 gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
35
36 mtxf_pos_rotation_xyz(spE0, boat->pos, boat->boatRot);
37 if (render_set_position(spE0, 1) != 0) {
38
39 // Render the boat
42
43 mtxf_rotate_x(spE0, boat->wheelRot);
44 vec3f_set(sp120, 0, 16.0f, -255.0f);
45 mtxf_translate(spA0, sp120);
46 mtxf_multiplication(sp60, spE0, spA0);
47 if (render_set_position(sp60, 3) != 0) {
48 // Render the paddle wheel
49 gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
51 gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
52 gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
53 }
54 }
55}
Camera * camera1
Definition camera.c:23
Lights1 D_800DC610[]
Definition code_800029B0.c:64
f32 Vec3f[3]
Definition common_structs.h:6
f32 Mat4[4][4]
Definition common_structs.h:16
Gfx d_course_dks_jungle_parkway_boat_dl[]
Definition course_data.c:5667
Gfx d_course_dks_jungle_parkway_railings_dl[]
Definition course_data.c:5406
Gfx d_course_dks_jungle_parkway_paddle_wheel_dl[]
Definition course_data.c:5805
#define G_SHADE
Definition gbi.h:343
#define G_CULL_BACK
Definition gbi.h:355
#define G_SHADING_SMOOTH
Definition gbi.h:353
#define G_MTX_MODELVIEW
Definition gbi.h:309
#define G_LIGHTING
Definition gbi.h:359
#define UNUSED
Definition macros.h:24
Gfx * gDisplayListHead
Definition main.c:133
f32 gCameraZoom[4]
Definition main.c:123
void mtxf_rotate_x(Mat4 mat, s16 angle)
Definition math_util.c:320
f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 minDistance, f32 fov, f32 maxDistance)
Definition math_util.c:1092
void mtxf_multiplication(Mat4 dest, Mat4 mat1, Mat4 mat2)
Definition math_util.c:820
void mtxf_pos_rotation_xyz(Mat4 out, Vec3f pos, Vec3s orientation)
Definition math_util.c:466
void vec3f_set(Vec3f arg0, f32 arg1, f32 arg2, f32 arg3)
Definition math_util.c:101
s32 render_set_position(Mat4 arg0, s32 arg1)
Definition math_util.c:49
void mtxf_translate(Mat4 dest, Vec3f b)
Definition math_util.c:212
void render_actor_paddle_boat(Camera *arg0, struct PaddleWheelBoat *boat, UNUSED Mat4 arg2, u16 pathCounter)
Renders the paddle boat actor. Actor used in DK's Jungle Parkway.
Definition render.inc.c:19
Definition camera.h:26
Vec3s rot
Definition camera.h:33
Vec3f pos
Definition camera.h:27
Definition actor_types.h:246
Vec3f pos
Definition actor_types.h:255
Vec3s boatRot
Definition actor_types.h:253
s16 wheelRot
Definition actor_types.h:250
signed int s32
Definition ultratypes.h:15
float f32
Definition ultratypes.h:33
unsigned short int u16
Definition ultratypes.h:14