Mario Kart 64
Loading...
Searching...
No Matches
render.inc.c
Go to the documentation of this file.
1#include <actors.h>
2#include <code_800029B0.h>
3#include <PR/gbi.h>
4
12void render_actor_banana(Camera* camera, UNUSED Mat4 arg1, struct BananaActor* banana) {
13 UNUSED s32 pad[2];
14 s32 maxObjectsReached;
15 Vec3s sp7C;
16 Mat4 sp3C;
17
18 f32 temp = is_within_render_distance(camera->pos, banana->pos, camera->rot[1], 0, gCameraZoom[camera - camera1],
19 490000.0f);
20 if (temp < 0.0f) {
21 actor_not_rendered(camera, (struct Actor*) banana);
22 return;
23 }
24
25 if ((banana->pos[1] > gCourseMaxY + 800.0f)) {
26 actor_not_rendered(camera, (struct Actor*) banana);
27 return;
28 }
29 if (banana->pos[1] < (gCourseMinY - 800.0f)) {
30 actor_not_rendered(camera, (struct Actor*) banana);
31 return;
32 }
33
34 actor_rendered(camera, (struct Actor*) banana);
35
36 if (banana->state == 5) {
37 mtxf_pos_rotation_xyz(sp3C, banana->pos, banana->rot);
38 } else {
39 sp7C[0] = 0;
40 sp7C[1] = 0;
41 sp7C[2] = 0;
42 mtxf_pos_rotation_xyz(sp3C, banana->pos, sp7C);
43 }
44
45 maxObjectsReached = render_set_position(sp3C, 0) == 0;
46 if (maxObjectsReached) {
47 return;
48 }
49
50 if (banana->state != 5) {
51 gSPDisplayList(gDisplayListHead++, &common_model_banana);
52 } else {
54 }
55}
void actor_not_rendered(Camera *arg0, struct Actor *arg1)
Definition actors.c:283
void actor_rendered(Camera *arg0, struct Actor *arg1)
Definition actors.c:300
void render_actor_banana(Camera *camera, UNUSED Mat4 arg1, struct BananaActor *banana)
Render the banana actor.
Definition render.inc.c:12
Camera * camera1
Definition camera.c:23
s16 gCourseMaxY
Definition code_800029B0.c:89
s16 gCourseMinY
Definition code_800029B0.c:90
Gfx common_model_flat_banana[]
Gfx common_model_banana[]
s16 Vec3s[3]
Definition common_structs.h:11
f32 Mat4[4][4]
Definition common_structs.h:16
#define UNUSED
Definition macros.h:23
Gfx * gDisplayListHead
Definition main.c:132
f32 gCameraZoom[4]
Definition main.c:122
f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 minDistance, f32 fov, f32 maxDistance)
Definition math_util.c:1114
void mtxf_pos_rotation_xyz(Mat4 out, Vec3f pos, Vec3s orientation)
Definition math_util.c:468
s32 render_set_position(Mat4 arg0, s32 arg1)
Definition math_util.c:47
Definition actor_types.h:120
Definition actor_types.h:380
Vec3s rot
Definition actor_types.h:389
Vec3f pos
Definition actor_types.h:397
s16 state
Definition actor_types.h:384
Definition camera.h:26
Vec3s rot
Definition camera.h:33
Vec3f pos
Definition camera.h:27
signed int s32
Definition ultratypes.h:15
float f32
Definition ultratypes.h:34