Mario Kart 64
Loading...
Searching...
No Matches
render.inc.c
Go to the documentation of this file.
1#include <camera.h>
2#include <actors.h>
3#include <defines.h>
4#include <main.h>
6
16void render_actor_yoshi_egg(Camera* arg0, Mat4 arg1, struct YoshiValleyEgg* egg, u16 arg3) {
17 Mat4 sp60;
18 Vec3s sp5C;
19 Vec3f sp54;
20 f32 temp_f0;
21
23 temp_f0 = is_within_render_distance(arg0->pos, egg->pos, arg0->rot[1], 200.0f, gCameraZoom[arg0 - camera1],
24 16000000.0f);
25 if (temp_f0 < 0.0f) {
26 return;
27 }
28 } else {
29 arg3 = 15;
30 temp_f0 = 0.0f;
31 }
32
33 gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
34 if ((arg3 > 12) && (arg3 < 20)) {
35 if (temp_f0 < 640000.0f) {
36 sp54[0] = egg->pos[0];
37 sp54[1] = 3.0f;
38 sp54[2] = egg->pos[2];
39 func_802976D8(sp5C);
40 func_8029794C(sp54, sp5C, 10.0f);
41 }
42 sp5C[0] = 0;
43 sp5C[1] = egg->eggRot;
44 sp5C[2] = 0;
45 mtxf_pos_rotation_xyz(sp60, egg->pos, sp5C);
46 if (render_set_position(sp60, 0) == 0) {
47 return;
48 }
49
50 gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
52 } else {
53 arg1[3][0] = egg->pos[0];
54 arg1[3][1] = egg->pos[1];
55 arg1[3][2] = egg->pos[2];
56
57 if (render_set_position(arg1, 0) != 0) {
58 gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
60 }
61 }
62}
void func_802976D8(Vec3s arg0)
Definition actors.c:356
void func_8029794C(Vec3f pos, Vec3s rot, f32 scale)
Definition actors.c:423
Camera * camera1
Definition camera.c:23
f32 Vec3f[3]
Definition common_structs.h:6
s16 Vec3s[3]
Definition common_structs.h:11
f32 Mat4[4][4]
Definition common_structs.h:16
#define CREDITS_SEQUENCE
Definition defines.h:193
#define G_SHADING_SMOOTH
Definition gbi.h:349
#define G_LIGHTING
Definition gbi.h:355
Gfx * gDisplayListHead
Definition main.c:132
f32 gCameraZoom[4]
Definition main.c:122
s32 gGamestate
Definition main.c:167
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 camera.h:26
Vec3s rot
Definition camera.h:33
Vec3f pos
Definition camera.h:27
Definition actor_types.h:212
s16 eggRot
Definition actor_types.h:220
Vec3f pos
Definition actor_types.h:223
float f32
Definition ultratypes.h:34
unsigned short int u16
Definition ultratypes.h:14
void render_actor_yoshi_egg(Camera *arg0, Mat4 arg1, struct YoshiValleyEgg *egg, u16 arg3)
Renders the Yoshi egg actor. Actor used in Yoshi Valley.
Definition render.inc.c:16
Gfx d_course_yoshi_valley_dl_egg_lod0[]
Definition course_data.c:8698
Gfx d_course_yoshi_valley_dl_16D70[]
Definition course_data.c:8619