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)) {
28 return;
29 }
30
31 temp = is_within_render_distance(arg0->pos, boat->pos, arg0->rot[1], 90000.0f, gCameraZoom[arg0 - camera1],
32 9000000.0f);
33
34 if (temp < 0.0f) {
35 return;
36 }
37
38 gSPSetLights1(gDisplayListHead++, D_800DC610[1]);
39 gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
40
41 mtxf_pos_rotation_xyz(spE0, boat->pos, boat->boatRot);
42 if (render_set_position(spE0, 1) != 0) {
43
44 // Render the boat
47
48 mtxf_rotate_x(spE0, boat->wheelRot);
49 vec3f_set(sp120, 0, 16.0f, -255.0f);
50 mtxf_translate(spA0, sp120);
51 mtxf_multiplication(sp60, spE0, spA0);
52 if (render_set_position(sp60, 3) != 0) {
53 // Render the paddle wheel
54 gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
56 gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
57 gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
58 }
59 }
60}
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:5461
Gfx d_course_dks_jungle_parkway_railings_dl[]
Definition course_data.c:5205
Gfx d_course_dks_jungle_parkway_paddle_wheel_dl[]
Definition course_data.c:5598
#define G_SHADE
Definition gbi.h:339
#define G_CULL_BACK
Definition gbi.h:351
#define G_SHADING_SMOOTH
Definition gbi.h:349
#define G_MTX_MODELVIEW
Definition gbi.h:305
#define G_LIGHTING
Definition gbi.h:355
#define UNUSED
Definition macros.h:23
Gfx * gDisplayListHead
Definition main.c:132
f32 gCameraZoom[4]
Definition main.c:122
void mtxf_rotate_x(Mat4 mat, s16 angle)
Definition math_util.c:322
f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 minDistance, f32 fov, f32 maxDistance)
Definition math_util.c:1114
void mtxf_multiplication(Mat4 dest, Mat4 mat1, Mat4 mat2)
Definition math_util.c:818
void mtxf_pos_rotation_xyz(Mat4 out, Vec3f pos, Vec3s orientation)
Definition math_util.c:468
void vec3f_set(Vec3f arg0, f32 arg1, f32 arg2, f32 arg3)
Definition math_util.c:103
s32 render_set_position(Mat4 arg0, s32 arg1)
Definition math_util.c:47
void mtxf_translate(Mat4 dest, Vec3f b)
Definition math_util.c:215
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:248
Vec3f pos
Definition actor_types.h:257
Vec3s boatRot
Definition actor_types.h:255
s16 wheelRot
Definition actor_types.h:252
signed int s32
Definition ultratypes.h:15
float f32
Definition ultratypes.h:34
unsigned short int u16
Definition ultratypes.h:14