Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Data Structures | Macros | Typedefs | Functions | Variables
camera.h File Reference
#include "types.h"
#include "area.h"
#include "engine/geo_layout.h"

Go to the source code of this file.

Data Structures

struct  CameraPlayerStatus
 
struct  TransitionCamera
 
struct  Struct8033B2B8
 
struct  Struct80287404
 
struct  TableCamera
 
struct  CutsceneTableEntry
 
struct  Struct8033B230
 
struct  CinematicCameraTable
 
struct  PlayerGeometry
 
struct  Struct8033B418_sub
 
struct  Struct8033B418
 
struct  ParallelTrackingTable
 
struct  Struct8033B4B8
 
struct  Struct8033B6F0
 
struct  CameraState
 

Macros

#define ABS(x)   ((x) > 0.f ? (x) : -(x))
 
#define ABS2(x)   ((x) >= 0.f ? (x) : -(x))
 
#define AREA_BBH   0x0041
 
#define AREA_CCM_OUTSIDE   0x0051
 
#define AREA_CCM_SLIDE   0x0052
 
#define AREA_CASTLE_LOBBY   0x0061
 
#define AREA_CASTLE_TIPPY   0x0062
 
#define AREA_CASTLE_BASTEMENT   0x0063
 
#define AREA_HMC   0x0071
 
#define AREA_SSL_OUTSIDE   0x0081
 
#define AREA_SSL_PYRAMID   0x0082
 
#define AREA_SSL_EYEROK   0x0083
 
#define AREA_BOB   0x0091
 
#define AREA_SL_OUTSIDE   0x00A1
 
#define AREA_SL_IGLOO   0x00A2
 
#define AREA_WDW_MAIN   0x00B1
 
#define AREA_WDW_TOWN   0x00B2
 
#define AREA_JRB_MAIN   0x00C1
 
#define AREA_JRB_SHIP   0x00C2
 
#define AREA_THI_HUGE   0x00D1
 
#define AREA_THI_TINY   0x00D2
 
#define AREA_THI_WIGGLER   0x00D3
 
#define AREA_TTC   0x00E1
 
#define AREA_RR   0x00F1
 
#define AREA_OUTSIDE_CASTLE   0x0101
 
#define AREA_BITDW   0x0111
 
#define AREA_VCUTM   0x0121
 
#define AREA_BITFS   0x0131
 
#define AREA_SA   0x0141
 
#define AREA_BITS   0x0151
 
#define AREA_LLL_OUTSIDE   0x0161
 
#define AREA_LLL_VOLCANO   0x0162
 
#define AREA_DDD_WHIRLPOOL   0x0171
 
#define AREA_DDD_SUB   0x0172
 
#define AREA_WF   0x0181
 
#define AREA_ENDING   0x0191
 
#define AREA_COURTYARD   0x01A1
 
#define AREA_PSS   0x01B1
 
#define AREA_COTMC   0x01C1
 
#define AREA_TOTWC   0x01D1
 
#define AREA_BOWSER_1   0x01E1
 
#define AREA_WMOTR   0x01F1
 
#define AREA_BOWSER_2   0x0211
 
#define AREA_BOWSER_3   0x0221
 
#define AREA_TTM_OUTSIDE   0x0241
 
#define CAM_MODE_MARIO_ACTIVE   0x01
 
#define CAM_MODE_LAKITU_WAS_ZOOMED_OUT   0x02
 
#define CAM_MODE_MARIO_SELECTED   0x04
 
#define CAM_MOVE_RETURN_TO_MIDDLE   0x0001
 
#define CAM_MOVE_ZOOMED_OUT   0x0002
 
#define CAM_MOVE_ROTATE_RIGHT   0x0004
 
#define CAM_MOVE_ROTATE_LEFT   0x0008
 
#define CAM_MOVE_UNKNOWN_5   0x0010
 
#define CAM_MOVE_UNKNOWN_6   0x0020
 
#define CAM_MOVE_UNKNOWN_7   0x0040
 
#define CAM_MOVE_UNKNOWN_8   0x0080
 
#define CAM_MOVE_INTO_C_UP   0x0100
 
#define CAM_MOVE_UNKNOWN_10   0x0200
 
#define CAM_MOVE_UNKNOWN_11   0x0400
 
#define CAM_MOVE_INIT_CAMERA   0x0800
 
#define CAM_MOVE_UNK1000   0x1000
 
#define CAM_MOVE_C_UP_MODE   0x2000
 
#define CAM_MOVE_SUBMERGED   0x4000
 
#define CAM_MOVE_PAUSE_SCREEN   0x8000
 
#define CAM_FLAG_1_UNKNOWN_0   0x01
 
#define CAM_FLAG_1_UNKNOWN_1   0x02
 
#define CAM_FLAG_1_UNKNOWN_2   0x04
 
#define CAM_FLAG_1_UNUSED_3   0x08
 
#define CAM_FLAG_1_UNUSED_4   0x10
 
#define CAM_FLAG_1_UNKNOWN_5   0x20
 
#define CAM_FLAG_2_SMOOTH_MOVEMENT   0x0001
 
#define CAM_FLAG_2_UNKNOWN_1   0x0002
 
#define CAM_FLAG_2_FRAME_AFTER_CAM_INIT   0x0004
 
#define CAM_FLAG_2_UNKNOWN_3   0x0008
 
#define CAM_FLAG_2_CCM_SLIDE_SHORTCUT   0x0010
 
#define CAM_FLAG_2_COLLIDING_WITH_WALL   0x0020
 
#define CAM_FLAG_2_SLEEPING   0x0040
 
#define CAM_FLAG_2_UNUSED_7   0x0080
 
#define CAM_FLAG_2_UNUSED_8   0x0100
 
#define CAM_FLAG_2_UNKNOWN_9   0x0200
 
#define CAM_FLAG_2_UNKNOWN_10   0x0400
 
#define CAM_FLAG_2_UNKNOWN_11   0x0800
 
#define CAM_FLAG_2_BLOCK_LEVEL_SPECIFIC_UPDATES   0x1000
 
#define CAM_FLAG_2_UNUSED_13   0x2000
 
#define CAM_FLAG_2_UNUSED_CUTSCENE_ACTIVE   0x4000
 
#define CAM_FLAG_2_BEHIND_MARIO_POST_DOOR   0x8000
 
#define SHAKE_ATTACK   1
 
#define SHAKE_GROUND_POUND   2
 
#define SHAKE_SMALL_DAMAGE   3
 
#define SHAKE_MED_DAMAGE   4
 
#define SHAKE_LARGE_DAMAGE   5
 
#define SHAKE_HIT_FROM_BELOW   8
 
#define SHAKE_FALL_DAMAGE   9
 
#define SHAKE_SHOCK   10
 
#define SHAKE_2_UNKNOWN_1   1
 
#define SHAKE_2_UNKNOWN_2   2
 
#define SHAKE_2_UNKNOWN_3   3
 
#define SHAKE_2_UNKNOWN_5   5
 
#define SHAKE_2_UNKNOWN_6   6
 
#define SHAKE_2_UNKNOWN_7   7
 
#define SHAKE_2_UNKNOWN_8   8
 
#define SHAKE_2_JRB_SHIP_DRAIN   9
 
#define SHAKE_2_FALLING_BITS_PLAT   10
 
#define CUTSCENE_DOOR_0   130
 
#define CUTSCENE_DOOR_1   131
 
#define CUTSCENE_ENTER_CANNON   133
 
#define CUTSCENE_ENTER_PAINTING   134
 
#define CUTSCENE_DEATH_EXIT   135
 
#define CUTSCENE_DOOR_WARP   139
 
#define CUTSCENE_DOOR_A   140
 
#define CUTSCENE_DOOR_B   141
 
#define CUTSCENE_INTRO_PEACH   142
 
#define CUTSCENE_STAR_DANCE_1_1   143
 
#define CUTSCENE_ENTER_BOWSER_ARENA   144
 
#define CUTSCENE_0F_TODO   145
 
#define CUTSCENE_11_TODO   147
 
#define CUTSCENE_SLIDING_DOORS_OPEN   149
 
#define CUTSCENE_PREPARE_CANNON   150
 
#define CUTSCENE_UNLOCK_KEY_DOOR   151
 
#define CUTSCENE_STANDING_DEATH   152
 
#define CUTSCENE_DEATH_2   153
 
#define CUTSCENE_DEATH_ON_BACK   154
 
#define CUTSCENE_QUICKSAND_DEATH   155
 
#define CUTSCENE_SUFFOCATION_DEATH   156
 
#define CUTSCENE_EXIT_BOWSER_SUCC   157
 
#define CUTSCENE_1C_TODO   158
 
#define CUTSCENE_WATER_DEATH   159
 
#define CUTSCENE_EXIT_PAINTING_SUCC   160
 
#define CUTSCENE_CAP_SWITCH_PRESS   161
 
#define CUTSCENE_DIALOG_1   162
 
#define CUTSCENE_DIALOG_2   163
 
#define CUTSCENE_ENTER_PYRAMID_TOP   164
 
#define CUTSCENE_STAR_DANCE_2   165
 
#define CUTSCENE_STAR_DANCE_3   166
 
#define CUTSCENE_KEY_DANCE   167
 
#define CUTSCENE_26_TODO   168
 
#define CUTSCENE_EXIT_BBH_SUCC   169
 
#define CUTSCENE_NONPAINTING_DEATH   170
 
#define CUTSCENE_READ_MESSAGE   171
 
#define CUTSCENE_PEACH_END   172
 
#define CUTSCENE_STAR_SPAWN   173
 
#define CUTSCENE_GRAND_STAR   174
 
#define CUTSCENE_STAR_DANCE_1_2   175
 
#define CUTSCENE_SPECIAL_STAR_SPAWN   176
 
#define CUTSCENE_END_WAVING   177
 
#define CUTSCENE_CREDITS   178
 
#define CUTSCENE_EXIT_WATERFALL   179
 
#define CUTSCENE_EXIT_FALL_WMOTR   180
 
#define CUTSCENE_ENTER_POOL   181
 

Typedefs

typedef s32 CmdRet
 
typedef CmdRet(* CameraCommandProc) (struct LevelCamera *a)
 

Functions

void set_camera_shake (s16)
 
void set_camera_shake_2 (s16)
 
void func_8027F440 (s16, f32, f32, f32)
 
void operate_c_up_looking (struct LevelCamera *)
 
void init_transitional_movement (UNUSED struct LevelCamera *, s16)
 
void func_80285BD8 (struct LevelCamera *, s16, s16)
 
void update_camera (struct LevelCamera *)
 
void reset_camera (struct LevelCamera *)
 
void init_camera (struct LevelCamera *)
 
void select_mario_cam_mode (void)
 
void dummy_802877D8 (struct LevelCamera *)
 
void dummy_802877EC (struct LevelCamera *)
 
void vec3f_sub (Vec3f, Vec3f)
 
void object_pos_to_vec3f (Vec3f, struct Object *)
 
void vec3f_to_object_pos (struct Object *, Vec3f)
 
s32 func_80287CFC (Vec3f, struct CinematicCameraTable[], s16 *, f32 *)
 
s32 select_or_activate_mario_cam (s32)
 
s32 test_or_set_mario_cam_active (s32)
 
void set_spline_values (u8)
 
void set_face_angle_from_spline (Vec3f, Vec3f)
 
s32 find_c_buttons_pressed (u16, u16, u16)
 
s32 update_camera_status (struct LevelCamera *)
 
s32 find_and_return_count_wall_collisions (Vec3f, f32, f32)
 
s32 clamp_pitch (Vec3f a, Vec3f b, s16 c, s16 d)
 
s32 is_within_100_units_of_mario (f32, f32, f32)
 
s32 set_or_approach_f32_exponential (f32 *, f32, f32)
 
s32 approach_f32_exponential_bool (f32 *, f32, f32)
 Approaches an f32 value by taking the difference between the target and current value and adding a fraction of that to the current value. More...
 
f32 approach_f32_exponential (f32, f32, f32)
 Nearly the same as the above function, returns new value instead. More...
 
s32 approach_s16_exponential_bool (s16 *, s16, s16)
 Approaches an s16 value in the same fashion as approach_f32_exponential_bool, returns TRUE if target is reached. More...
 
s32 approach_s16_exponential (s16, s16, s16)
 Approaches an s16 value in the same fashion as approach_f32_exponential, returns the new value. More...
 
void approach_vec3f_exponential (Vec3f, Vec3f, f32, f32, f32)
 Applies the approach_f32_exponential_bool function to each of the X, Y, & Z components of the given vector. More...
 
void set_or_approach_vec3f_exponential (Vec3f, Vec3f, f32, f32, f32)
 
s32 camera_approach_s16_symmetric_bool (s16 *a, s16 b, s16 c)
 
s32 set_or_approach_s16_symmetric (s16 *a, s16 b, s16 c)
 
s32 camera_approach_f32_symmetric_bool (f32 *, f32, f32)
 Approaches a value by a given increment, returns FALSE if the target is reached. More...
 
f32 camera_approach_f32_symmetric (f32, f32, f32)
 Nearly the same as the above function, this one returns the new value in place of a bool. More...
 
void random_vec3s (Vec3s a, s16 b, s16 c, s16 d)
 Generate a vector with all three values about zero. More...
 
s32 clamp_positions_and_find_yaw_angle (Vec3f, Vec3f, f32, f32, f32, f32)
 
s32 func_8028A0D4 (Vec3f a, Vec3f b, struct Surface *c, s16 d, s16 e)
 
void scale_along_line (Vec3f, Vec3f, Vec3f, f32)
 Calculates the distance between two points and sets a vector to a point scaled along a line between them. More...
 
s16 calculate_verticle_angle (Vec3f, Vec3f)
 
s16 calculate_yaw (Vec3f, Vec3f)
 
void calculate_angles (Vec3f, Vec3f, s16 *, s16 *)
 
f32 calc_abs_dist (Vec3f, Vec3f)
 Finds the distance between two vectors. More...
 
f32 calc_hor_dist (Vec3f, Vec3f)
 Finds the horizontal distance between two vectors. More...
 
void rotate_in_xz (Vec3f, Vec3f, s16)
 Rotates a vector in the horizontal plane and copies it to a new vector. More...
 
void rotate_in_yz (Vec3f, Vec3f, s16)
 Rotates a vector in the YZ plane and copies it to a new vector. More...
 
void set_camera_pitch_shake (s16, s16, s16)
 
void set_camera_yaw_shake (s16, s16, s16)
 
void set_camera_roll_shake (s16, s16, s16)
 
void func_8028AA80 (s16, s16, s16, f32, f32, f32, f32)
 
void shake_camera_pitch ()
 
void shake_camera_yaw ()
 
void shake_camera_roll (s16 *)
 
s32 func_8028AF24 (struct LevelCamera *a, s16 b)
 
void play_camera_buzz_if_cdown (void)
 
void play_camera_buzz_if_cbutton (void)
 
void play_camera_buzz_if_c_sideways (void)
 
void play_sound_cbutton_up (void)
 
void play_sound_cbutton_down (void)
 
void play_sound_cbutton_side (void)
 
void play_sound_button_change_blocked (void)
 
void play_sound_rbutton_changed (void)
 
void func_8028B36C (void)
 
s32 func_8028B3DC (struct LevelCamera *a, f32 b)
 
s32 stop_mario (s32)
 
void handle_c_button_movement (struct LevelCamera *)
 
void set_camera_cutscene_table (struct LevelCamera *a, u8 b)
 If camera's cutscene table is not already set to a value, set it to that value. More...
 
u8 return_cutscene_table ()
 
void instant_warp_camera_update (f32, f32, f32)
 
void approach_camera_height (struct LevelCamera *, f32, f32)
 
void set_pos_from_face_angle_and_vec3f (Vec3f, Vec3f, Vec3f, Vec3s)
 
s16 func_8028C824 (Vec3f a, Vec3f b, Vec3f c, Vec3f d, Vec3f e, Vec3f f, s16 g)
 
void set_fixed_cam_axis_sa_lobby (s16 preset)
 
s16 level_specific_camera_update (struct LevelCamera *)
 
void resolve_geometry_collisions (Vec3f, Vec3f)
 
s32 func_8028F2F0 (struct LevelCamera *, Vec3f, s16 *, s16)
 
void find_mario_relative_geometry (struct PlayerGeometry *)
 
u8 func_8028F834 (u8)
 
s16 func_8028F8E0 (u8, struct Object *, s16)
 
s16 func_8028F9A4 (u8, struct Object *)
 
s16 func_8028F9E8 (u8, struct Object *)
 
void handle_cutscenes (struct LevelCamera *)
 
s32 call_cutscene_func_in_time_range (CameraCommandProc, struct LevelCamera *, s16, s16)
 
s32 func_80299C60 (s32, s16)
 
void func_80299C98 (s16, s16, s16)
 
void set_fov_function (u8)
 
void func_8029A494 (u8)
 
void func_8029A514 (u8, f32, f32, f32)
 
void func_8029A7DC (struct Object *, Vec3f, s16, s16, s16, s16)
 

Variables

struct CameraPlayerStatus gPlayerStatusForCamera [2]
 
s16 gCameraModeFlags
 
s16 sCameraSideCFlags
 
s16 gCameraFlags1
 
u16 gCButtonsPressed
 
struct CameraState gCameraStatus
 
s16 gCameraMovementFlags
 
s32 gCutsceneActive
 
struct LevelCameragCurrLevelCamera
 
struct ObjectgCutsceneFocus
 
struct ObjectgSecondCameraFocus
 
Vec3f sFixedPresetBasePosition
 
u8 D_8032D0B8 []
 

Macro Definition Documentation

◆ ABS

#define ABS (   x)    ((x) > 0.f ? (x) : -(x))

◆ ABS2

#define ABS2 (   x)    ((x) >= 0.f ? (x) : -(x))

◆ AREA_BBH

#define AREA_BBH   0x0041

◆ AREA_BITDW

#define AREA_BITDW   0x0111

◆ AREA_BITFS

#define AREA_BITFS   0x0131

◆ AREA_BITS

#define AREA_BITS   0x0151

◆ AREA_BOB

#define AREA_BOB   0x0091

◆ AREA_BOWSER_1

#define AREA_BOWSER_1   0x01E1

◆ AREA_BOWSER_2

#define AREA_BOWSER_2   0x0211

◆ AREA_BOWSER_3

#define AREA_BOWSER_3   0x0221

◆ AREA_CASTLE_BASTEMENT

#define AREA_CASTLE_BASTEMENT   0x0063

◆ AREA_CASTLE_LOBBY

#define AREA_CASTLE_LOBBY   0x0061

◆ AREA_CASTLE_TIPPY

#define AREA_CASTLE_TIPPY   0x0062

◆ AREA_CCM_OUTSIDE

#define AREA_CCM_OUTSIDE   0x0051

◆ AREA_CCM_SLIDE

#define AREA_CCM_SLIDE   0x0052

◆ AREA_COTMC

#define AREA_COTMC   0x01C1

◆ AREA_COURTYARD

#define AREA_COURTYARD   0x01A1

◆ AREA_DDD_SUB

#define AREA_DDD_SUB   0x0172

◆ AREA_DDD_WHIRLPOOL

#define AREA_DDD_WHIRLPOOL   0x0171

◆ AREA_ENDING

#define AREA_ENDING   0x0191

◆ AREA_HMC

#define AREA_HMC   0x0071

◆ AREA_JRB_MAIN

#define AREA_JRB_MAIN   0x00C1

◆ AREA_JRB_SHIP

#define AREA_JRB_SHIP   0x00C2

◆ AREA_LLL_OUTSIDE

#define AREA_LLL_OUTSIDE   0x0161

◆ AREA_LLL_VOLCANO

#define AREA_LLL_VOLCANO   0x0162

◆ AREA_OUTSIDE_CASTLE

#define AREA_OUTSIDE_CASTLE   0x0101

◆ AREA_PSS

#define AREA_PSS   0x01B1

◆ AREA_RR

#define AREA_RR   0x00F1

◆ AREA_SA

#define AREA_SA   0x0141

◆ AREA_SL_IGLOO

#define AREA_SL_IGLOO   0x00A2

◆ AREA_SL_OUTSIDE

#define AREA_SL_OUTSIDE   0x00A1

◆ AREA_SSL_EYEROK

#define AREA_SSL_EYEROK   0x0083

◆ AREA_SSL_OUTSIDE

#define AREA_SSL_OUTSIDE   0x0081

◆ AREA_SSL_PYRAMID

#define AREA_SSL_PYRAMID   0x0082

◆ AREA_THI_HUGE

#define AREA_THI_HUGE   0x00D1

◆ AREA_THI_TINY

#define AREA_THI_TINY   0x00D2

◆ AREA_THI_WIGGLER

#define AREA_THI_WIGGLER   0x00D3

◆ AREA_TOTWC

#define AREA_TOTWC   0x01D1

◆ AREA_TTC

#define AREA_TTC   0x00E1

◆ AREA_TTM_OUTSIDE

#define AREA_TTM_OUTSIDE   0x0241

◆ AREA_VCUTM

#define AREA_VCUTM   0x0121

◆ AREA_WDW_MAIN

#define AREA_WDW_MAIN   0x00B1

◆ AREA_WDW_TOWN

#define AREA_WDW_TOWN   0x00B2

◆ AREA_WF

#define AREA_WF   0x0181

◆ AREA_WMOTR

#define AREA_WMOTR   0x01F1

◆ CAM_FLAG_1_UNKNOWN_0

#define CAM_FLAG_1_UNKNOWN_0   0x01

◆ CAM_FLAG_1_UNKNOWN_1

#define CAM_FLAG_1_UNKNOWN_1   0x02

◆ CAM_FLAG_1_UNKNOWN_2

#define CAM_FLAG_1_UNKNOWN_2   0x04

◆ CAM_FLAG_1_UNKNOWN_5

#define CAM_FLAG_1_UNKNOWN_5   0x20

◆ CAM_FLAG_1_UNUSED_3

#define CAM_FLAG_1_UNUSED_3   0x08

◆ CAM_FLAG_1_UNUSED_4

#define CAM_FLAG_1_UNUSED_4   0x10

◆ CAM_FLAG_2_BEHIND_MARIO_POST_DOOR

#define CAM_FLAG_2_BEHIND_MARIO_POST_DOOR   0x8000

◆ CAM_FLAG_2_BLOCK_LEVEL_SPECIFIC_UPDATES

#define CAM_FLAG_2_BLOCK_LEVEL_SPECIFIC_UPDATES   0x1000

◆ CAM_FLAG_2_CCM_SLIDE_SHORTCUT

#define CAM_FLAG_2_CCM_SLIDE_SHORTCUT   0x0010

◆ CAM_FLAG_2_COLLIDING_WITH_WALL

#define CAM_FLAG_2_COLLIDING_WITH_WALL   0x0020

◆ CAM_FLAG_2_FRAME_AFTER_CAM_INIT

#define CAM_FLAG_2_FRAME_AFTER_CAM_INIT   0x0004

◆ CAM_FLAG_2_SLEEPING

#define CAM_FLAG_2_SLEEPING   0x0040

◆ CAM_FLAG_2_SMOOTH_MOVEMENT

#define CAM_FLAG_2_SMOOTH_MOVEMENT   0x0001

◆ CAM_FLAG_2_UNKNOWN_1

#define CAM_FLAG_2_UNKNOWN_1   0x0002

◆ CAM_FLAG_2_UNKNOWN_10

#define CAM_FLAG_2_UNKNOWN_10   0x0400

◆ CAM_FLAG_2_UNKNOWN_11

#define CAM_FLAG_2_UNKNOWN_11   0x0800

◆ CAM_FLAG_2_UNKNOWN_3

#define CAM_FLAG_2_UNKNOWN_3   0x0008

◆ CAM_FLAG_2_UNKNOWN_9

#define CAM_FLAG_2_UNKNOWN_9   0x0200

◆ CAM_FLAG_2_UNUSED_13

#define CAM_FLAG_2_UNUSED_13   0x2000

◆ CAM_FLAG_2_UNUSED_7

#define CAM_FLAG_2_UNUSED_7   0x0080

◆ CAM_FLAG_2_UNUSED_8

#define CAM_FLAG_2_UNUSED_8   0x0100

◆ CAM_FLAG_2_UNUSED_CUTSCENE_ACTIVE

#define CAM_FLAG_2_UNUSED_CUTSCENE_ACTIVE   0x4000

◆ CAM_MODE_LAKITU_WAS_ZOOMED_OUT

#define CAM_MODE_LAKITU_WAS_ZOOMED_OUT   0x02

◆ CAM_MODE_MARIO_ACTIVE

#define CAM_MODE_MARIO_ACTIVE   0x01

◆ CAM_MODE_MARIO_SELECTED

#define CAM_MODE_MARIO_SELECTED   0x04

◆ CAM_MOVE_C_UP_MODE

#define CAM_MOVE_C_UP_MODE   0x2000

◆ CAM_MOVE_INIT_CAMERA

#define CAM_MOVE_INIT_CAMERA   0x0800

◆ CAM_MOVE_INTO_C_UP

#define CAM_MOVE_INTO_C_UP   0x0100

◆ CAM_MOVE_PAUSE_SCREEN

#define CAM_MOVE_PAUSE_SCREEN   0x8000

◆ CAM_MOVE_RETURN_TO_MIDDLE

#define CAM_MOVE_RETURN_TO_MIDDLE   0x0001

◆ CAM_MOVE_ROTATE_LEFT

#define CAM_MOVE_ROTATE_LEFT   0x0008

◆ CAM_MOVE_ROTATE_RIGHT

#define CAM_MOVE_ROTATE_RIGHT   0x0004

◆ CAM_MOVE_SUBMERGED

#define CAM_MOVE_SUBMERGED   0x4000

◆ CAM_MOVE_UNK1000

#define CAM_MOVE_UNK1000   0x1000

◆ CAM_MOVE_UNKNOWN_10

#define CAM_MOVE_UNKNOWN_10   0x0200

◆ CAM_MOVE_UNKNOWN_11

#define CAM_MOVE_UNKNOWN_11   0x0400

◆ CAM_MOVE_UNKNOWN_5

#define CAM_MOVE_UNKNOWN_5   0x0010

◆ CAM_MOVE_UNKNOWN_6

#define CAM_MOVE_UNKNOWN_6   0x0020

◆ CAM_MOVE_UNKNOWN_7

#define CAM_MOVE_UNKNOWN_7   0x0040

◆ CAM_MOVE_UNKNOWN_8

#define CAM_MOVE_UNKNOWN_8   0x0080

◆ CAM_MOVE_ZOOMED_OUT

#define CAM_MOVE_ZOOMED_OUT   0x0002

◆ CUTSCENE_0F_TODO

#define CUTSCENE_0F_TODO   145

◆ CUTSCENE_11_TODO

#define CUTSCENE_11_TODO   147

◆ CUTSCENE_1C_TODO

#define CUTSCENE_1C_TODO   158

◆ CUTSCENE_26_TODO

#define CUTSCENE_26_TODO   168

◆ CUTSCENE_CAP_SWITCH_PRESS

#define CUTSCENE_CAP_SWITCH_PRESS   161

◆ CUTSCENE_CREDITS

#define CUTSCENE_CREDITS   178

◆ CUTSCENE_DEATH_2

#define CUTSCENE_DEATH_2   153

◆ CUTSCENE_DEATH_EXIT

#define CUTSCENE_DEATH_EXIT   135

◆ CUTSCENE_DEATH_ON_BACK

#define CUTSCENE_DEATH_ON_BACK   154

◆ CUTSCENE_DIALOG_1

#define CUTSCENE_DIALOG_1   162

◆ CUTSCENE_DIALOG_2

#define CUTSCENE_DIALOG_2   163

◆ CUTSCENE_DOOR_0

#define CUTSCENE_DOOR_0   130

◆ CUTSCENE_DOOR_1

#define CUTSCENE_DOOR_1   131

◆ CUTSCENE_DOOR_A

#define CUTSCENE_DOOR_A   140

◆ CUTSCENE_DOOR_B

#define CUTSCENE_DOOR_B   141

◆ CUTSCENE_DOOR_WARP

#define CUTSCENE_DOOR_WARP   139

◆ CUTSCENE_END_WAVING

#define CUTSCENE_END_WAVING   177

◆ CUTSCENE_ENTER_BOWSER_ARENA

#define CUTSCENE_ENTER_BOWSER_ARENA   144

◆ CUTSCENE_ENTER_CANNON

#define CUTSCENE_ENTER_CANNON   133

◆ CUTSCENE_ENTER_PAINTING

#define CUTSCENE_ENTER_PAINTING   134

◆ CUTSCENE_ENTER_POOL

#define CUTSCENE_ENTER_POOL   181

◆ CUTSCENE_ENTER_PYRAMID_TOP

#define CUTSCENE_ENTER_PYRAMID_TOP   164

◆ CUTSCENE_EXIT_BBH_SUCC

#define CUTSCENE_EXIT_BBH_SUCC   169

◆ CUTSCENE_EXIT_BOWSER_SUCC

#define CUTSCENE_EXIT_BOWSER_SUCC   157

◆ CUTSCENE_EXIT_FALL_WMOTR

#define CUTSCENE_EXIT_FALL_WMOTR   180

◆ CUTSCENE_EXIT_PAINTING_SUCC

#define CUTSCENE_EXIT_PAINTING_SUCC   160

◆ CUTSCENE_EXIT_WATERFALL

#define CUTSCENE_EXIT_WATERFALL   179

◆ CUTSCENE_GRAND_STAR

#define CUTSCENE_GRAND_STAR   174

◆ CUTSCENE_INTRO_PEACH

#define CUTSCENE_INTRO_PEACH   142

◆ CUTSCENE_KEY_DANCE

#define CUTSCENE_KEY_DANCE   167

◆ CUTSCENE_NONPAINTING_DEATH

#define CUTSCENE_NONPAINTING_DEATH   170

◆ CUTSCENE_PEACH_END

#define CUTSCENE_PEACH_END   172

◆ CUTSCENE_PREPARE_CANNON

#define CUTSCENE_PREPARE_CANNON   150

◆ CUTSCENE_QUICKSAND_DEATH

#define CUTSCENE_QUICKSAND_DEATH   155

◆ CUTSCENE_READ_MESSAGE

#define CUTSCENE_READ_MESSAGE   171

◆ CUTSCENE_SLIDING_DOORS_OPEN

#define CUTSCENE_SLIDING_DOORS_OPEN   149

◆ CUTSCENE_SPECIAL_STAR_SPAWN

#define CUTSCENE_SPECIAL_STAR_SPAWN   176

◆ CUTSCENE_STANDING_DEATH

#define CUTSCENE_STANDING_DEATH   152

◆ CUTSCENE_STAR_DANCE_1_1

#define CUTSCENE_STAR_DANCE_1_1   143

◆ CUTSCENE_STAR_DANCE_1_2

#define CUTSCENE_STAR_DANCE_1_2   175

◆ CUTSCENE_STAR_DANCE_2

#define CUTSCENE_STAR_DANCE_2   165

◆ CUTSCENE_STAR_DANCE_3

#define CUTSCENE_STAR_DANCE_3   166

◆ CUTSCENE_STAR_SPAWN

#define CUTSCENE_STAR_SPAWN   173

◆ CUTSCENE_SUFFOCATION_DEATH

#define CUTSCENE_SUFFOCATION_DEATH   156

◆ CUTSCENE_UNLOCK_KEY_DOOR

#define CUTSCENE_UNLOCK_KEY_DOOR   151

◆ CUTSCENE_WATER_DEATH

#define CUTSCENE_WATER_DEATH   159

◆ SHAKE_2_FALLING_BITS_PLAT

#define SHAKE_2_FALLING_BITS_PLAT   10

◆ SHAKE_2_JRB_SHIP_DRAIN

#define SHAKE_2_JRB_SHIP_DRAIN   9

◆ SHAKE_2_UNKNOWN_1

#define SHAKE_2_UNKNOWN_1   1

◆ SHAKE_2_UNKNOWN_2

#define SHAKE_2_UNKNOWN_2   2

◆ SHAKE_2_UNKNOWN_3

#define SHAKE_2_UNKNOWN_3   3

◆ SHAKE_2_UNKNOWN_5

#define SHAKE_2_UNKNOWN_5   5

◆ SHAKE_2_UNKNOWN_6

#define SHAKE_2_UNKNOWN_6   6

◆ SHAKE_2_UNKNOWN_7

#define SHAKE_2_UNKNOWN_7   7

◆ SHAKE_2_UNKNOWN_8

#define SHAKE_2_UNKNOWN_8   8

◆ SHAKE_ATTACK

#define SHAKE_ATTACK   1

◆ SHAKE_FALL_DAMAGE

#define SHAKE_FALL_DAMAGE   9

◆ SHAKE_GROUND_POUND

#define SHAKE_GROUND_POUND   2

◆ SHAKE_HIT_FROM_BELOW

#define SHAKE_HIT_FROM_BELOW   8

◆ SHAKE_LARGE_DAMAGE

#define SHAKE_LARGE_DAMAGE   5

◆ SHAKE_MED_DAMAGE

#define SHAKE_MED_DAMAGE   4

◆ SHAKE_SHOCK

#define SHAKE_SHOCK   10

◆ SHAKE_SMALL_DAMAGE

#define SHAKE_SMALL_DAMAGE   3

Typedef Documentation

◆ CameraCommandProc

typedef CmdRet(* CameraCommandProc) (struct LevelCamera *a)

◆ CmdRet

Function Documentation

◆ approach_camera_height()

void approach_camera_height ( struct LevelCamera ,
f32  ,
f32   
)

◆ approach_f32_exponential()

f32 approach_f32_exponential ( f32  ,
f32  ,
f32   
)

Nearly the same as the above function, returns new value instead.

◆ approach_f32_exponential_bool()

s32 approach_f32_exponential_bool ( f32 current,
f32  target,
f32  multiplier 
)

Approaches an f32 value by taking the difference between the target and current value and adding a fraction of that to the current value.

Edits the current value directly, returns TRUE if the target has been reached, FALSE otherwise.

◆ approach_s16_exponential()

s32 approach_s16_exponential ( s16  current,
s16  target,
s16  divisor 
)

Approaches an s16 value in the same fashion as approach_f32_exponential, returns the new value.

Note: last parameter is the reciprocal of what it would be in the f32 functions

◆ approach_s16_exponential_bool()

s32 approach_s16_exponential_bool ( s16 current,
s16  target,
s16  divisor 
)

Approaches an s16 value in the same fashion as approach_f32_exponential_bool, returns TRUE if target is reached.

Note: Since this function takes integers as parameters, the last argument is the reciprocal of what it would be in the previous two functions.

◆ approach_vec3f_exponential()

void approach_vec3f_exponential ( Vec3f  ,
Vec3f  ,
f32  ,
f32  ,
f32   
)

Applies the approach_f32_exponential_bool function to each of the X, Y, & Z components of the given vector.

◆ calc_abs_dist()

f32 calc_abs_dist ( Vec3f  ,
Vec3f   
)

Finds the distance between two vectors.

◆ calc_hor_dist()

f32 calc_hor_dist ( Vec3f  ,
Vec3f   
)

Finds the horizontal distance between two vectors.

◆ calculate_angles()

void calculate_angles ( Vec3f  ,
Vec3f  ,
s16 ,
s16  
)

◆ calculate_verticle_angle()

s16 calculate_verticle_angle ( Vec3f  ,
Vec3f   
)

◆ calculate_yaw()

s16 calculate_yaw ( Vec3f  ,
Vec3f   
)

◆ call_cutscene_func_in_time_range()

s32 call_cutscene_func_in_time_range ( CameraCommandProc  ,
struct LevelCamera ,
s16  ,
s16   
)

◆ camera_approach_f32_symmetric()

f32 camera_approach_f32_symmetric ( f32  ,
f32  ,
f32   
)

Nearly the same as the above function, this one returns the new value in place of a bool.

◆ camera_approach_f32_symmetric_bool()

s32 camera_approach_f32_symmetric_bool ( f32 current,
f32  target,
f32  increment 
)

Approaches a value by a given increment, returns FALSE if the target is reached.

Appears to be a strange way of implementing approach_f32_symmetric from object_helpers.c. It could possibly be an older version of the function

◆ camera_approach_s16_symmetric_bool()

s32 camera_approach_s16_symmetric_bool ( s16 a,
s16  b,
s16  c 
)

◆ clamp_pitch()

s32 clamp_pitch ( Vec3f  a,
Vec3f  b,
s16  c,
s16  d 
)

◆ clamp_positions_and_find_yaw_angle()

s32 clamp_positions_and_find_yaw_angle ( Vec3f  ,
Vec3f  ,
f32  ,
f32  ,
f32  ,
f32   
)

◆ dummy_802877D8()

void dummy_802877D8 ( struct LevelCamera )

◆ dummy_802877EC()

void dummy_802877EC ( struct LevelCamera )

◆ find_and_return_count_wall_collisions()

s32 find_and_return_count_wall_collisions ( Vec3f  ,
f32  ,
f32   
)

◆ find_c_buttons_pressed()

s32 find_c_buttons_pressed ( u16  ,
u16  ,
u16   
)

◆ find_mario_relative_geometry()

void find_mario_relative_geometry ( struct PlayerGeometry )

◆ func_8027F440()

void func_8027F440 ( s16  ,
f32  ,
f32  ,
f32   
)

◆ func_80285BD8()

void func_80285BD8 ( struct LevelCamera ,
s16  ,
s16   
)

◆ func_80287CFC()

s32 func_80287CFC ( Vec3f  ,
struct CinematicCameraTable  [],
s16 ,
f32  
)

◆ func_8028A0D4()

s32 func_8028A0D4 ( Vec3f  a,
Vec3f  b,
struct Surface c,
s16  d,
s16  e 
)

◆ func_8028AA80()

void func_8028AA80 ( s16  ,
s16  ,
s16  ,
f32  ,
f32  ,
f32  ,
f32   
)

◆ func_8028AF24()

s32 func_8028AF24 ( struct LevelCamera a,
s16  b 
)

◆ func_8028B36C()

void func_8028B36C ( void  )

◆ func_8028B3DC()

s32 func_8028B3DC ( struct LevelCamera a,
f32  b 
)

◆ func_8028C824()

s16 func_8028C824 ( Vec3f  a,
Vec3f  b,
Vec3f  c,
Vec3f  d,
Vec3f  e,
Vec3f  f,
s16  g 
)

◆ func_8028F2F0()

s32 func_8028F2F0 ( struct LevelCamera ,
Vec3f  ,
s16 ,
s16   
)

◆ func_8028F834()

u8 func_8028F834 ( u8  )

◆ func_8028F8E0()

s16 func_8028F8E0 ( u8  ,
struct Object ,
s16   
)

◆ func_8028F9A4()

s16 func_8028F9A4 ( u8  ,
struct Object  
)

◆ func_8028F9E8()

s16 func_8028F9E8 ( u8  ,
struct Object  
)

◆ func_80299C60()

s32 func_80299C60 ( s32  ,
s16   
)

◆ func_80299C98()

void func_80299C98 ( s16  ,
s16  ,
s16   
)

◆ func_8029A494()

void func_8029A494 ( u8  )

◆ func_8029A514()

void func_8029A514 ( u8  ,
f32  ,
f32  ,
f32   
)

◆ func_8029A7DC()

void func_8029A7DC ( struct Object ,
Vec3f  ,
s16  ,
s16  ,
s16  ,
s16   
)

◆ handle_c_button_movement()

void handle_c_button_movement ( struct LevelCamera )

◆ handle_cutscenes()

void handle_cutscenes ( struct LevelCamera )

◆ init_camera()

void init_camera ( struct LevelCamera )

◆ init_transitional_movement()

void init_transitional_movement ( UNUSED struct LevelCamera ,
s16   
)

◆ instant_warp_camera_update()

void instant_warp_camera_update ( f32  ,
f32  ,
f32   
)

◆ is_within_100_units_of_mario()

s32 is_within_100_units_of_mario ( f32  ,
f32  ,
f32   
)

◆ level_specific_camera_update()

s16 level_specific_camera_update ( struct LevelCamera )

◆ object_pos_to_vec3f()

void object_pos_to_vec3f ( Vec3f  ,
struct Object  
)

◆ operate_c_up_looking()

void operate_c_up_looking ( struct LevelCamera )

◆ play_camera_buzz_if_c_sideways()

void play_camera_buzz_if_c_sideways ( void  )

◆ play_camera_buzz_if_cbutton()

void play_camera_buzz_if_cbutton ( void  )

◆ play_camera_buzz_if_cdown()

void play_camera_buzz_if_cdown ( void  )

◆ play_sound_button_change_blocked()

void play_sound_button_change_blocked ( void  )

◆ play_sound_cbutton_down()

void play_sound_cbutton_down ( void  )

◆ play_sound_cbutton_side()

void play_sound_cbutton_side ( void  )

◆ play_sound_cbutton_up()

void play_sound_cbutton_up ( void  )

◆ play_sound_rbutton_changed()

void play_sound_rbutton_changed ( void  )

◆ random_vec3s()

void random_vec3s ( Vec3s  dst,
s16  xRange,
s16  yRange,
s16  zRange 
)

Generate a vector with all three values about zero.

The three ranges determine how wide the range about zero.

◆ reset_camera()

void reset_camera ( struct LevelCamera )

◆ resolve_geometry_collisions()

void resolve_geometry_collisions ( Vec3f  ,
Vec3f   
)

◆ return_cutscene_table()

u8 return_cutscene_table ( )

◆ rotate_in_xz()

void rotate_in_xz ( Vec3f  ,
Vec3f  ,
s16   
)

Rotates a vector in the horizontal plane and copies it to a new vector.

◆ rotate_in_yz()

void rotate_in_yz ( Vec3f  ,
Vec3f  ,
s16   
)

Rotates a vector in the YZ plane and copies it to a new vector.

◆ scale_along_line()

void scale_along_line ( Vec3f  dest,
Vec3f  b,
Vec3f  c,
f32  scale 
)

Calculates the distance between two points and sets a vector to a point scaled along a line between them.

Typically, somewhere in the middle.

◆ select_mario_cam_mode()

void select_mario_cam_mode ( void  )

◆ select_or_activate_mario_cam()

s32 select_or_activate_mario_cam ( s32  )

◆ set_camera_cutscene_table()

void set_camera_cutscene_table ( struct LevelCamera a,
u8  b 
)

If camera's cutscene table is not already set to a value, set it to that value.

◆ set_camera_pitch_shake()

void set_camera_pitch_shake ( s16  ,
s16  ,
s16   
)

◆ set_camera_roll_shake()

void set_camera_roll_shake ( s16  ,
s16  ,
s16   
)

◆ set_camera_shake()

void set_camera_shake ( s16  )

◆ set_camera_shake_2()

void set_camera_shake_2 ( s16  )

◆ set_camera_yaw_shake()

void set_camera_yaw_shake ( s16  ,
s16  ,
s16   
)

◆ set_face_angle_from_spline()

void set_face_angle_from_spline ( Vec3f  ,
Vec3f   
)

◆ set_fixed_cam_axis_sa_lobby()

void set_fixed_cam_axis_sa_lobby ( s16  preset)

◆ set_fov_function()

void set_fov_function ( u8  )

◆ set_or_approach_f32_exponential()

s32 set_or_approach_f32_exponential ( f32 ,
f32  ,
f32   
)

◆ set_or_approach_s16_symmetric()

s32 set_or_approach_s16_symmetric ( s16 a,
s16  b,
s16  c 
)

◆ set_or_approach_vec3f_exponential()

void set_or_approach_vec3f_exponential ( Vec3f  ,
Vec3f  ,
f32  ,
f32  ,
f32   
)

◆ set_pos_from_face_angle_and_vec3f()

void set_pos_from_face_angle_and_vec3f ( Vec3f  ,
Vec3f  ,
Vec3f  ,
Vec3s   
)

◆ set_spline_values()

void set_spline_values ( u8  )

◆ shake_camera_pitch()

void shake_camera_pitch ( )

◆ shake_camera_roll()

void shake_camera_roll ( s16 )

◆ shake_camera_yaw()

void shake_camera_yaw ( )

◆ stop_mario()

s32 stop_mario ( s32  )

◆ test_or_set_mario_cam_active()

s32 test_or_set_mario_cam_active ( s32  )

◆ update_camera()

void update_camera ( struct LevelCamera )

◆ update_camera_status()

s32 update_camera_status ( struct LevelCamera )

◆ vec3f_sub()

void vec3f_sub ( Vec3f  ,
Vec3f   
)

◆ vec3f_to_object_pos()

void vec3f_to_object_pos ( struct Object ,
Vec3f   
)

Variable Documentation

◆ D_8032D0B8

u8 D_8032D0B8[]

◆ gCameraFlags1

s16 gCameraFlags1

◆ gCameraModeFlags

s16 gCameraModeFlags

◆ gCameraMovementFlags

s16 gCameraMovementFlags

◆ gCameraStatus

struct CameraState gCameraStatus

◆ gCButtonsPressed

u16 gCButtonsPressed

◆ gCurrLevelCamera

struct LevelCamera* gCurrLevelCamera

◆ gCutsceneActive

s32 gCutsceneActive

◆ gCutsceneFocus

struct Object* gCutsceneFocus

◆ gPlayerStatusForCamera

struct CameraPlayerStatus gPlayerStatusForCamera[2]

◆ gSecondCameraFocus

struct Object* gSecondCameraFocus

◆ sCameraSideCFlags

s16 sCameraSideCFlags

◆ sFixedPresetBasePosition

Vec3f sFixedPresetBasePosition