3#include "sprite/player.h"
78 x = playerStatus->
pos.
x;
79 y = playerStatus->
pos.
y + halfHeight;
80 z = playerStatus->
pos.
z;
84 if (moveMagnitude != 0.0f) {
126 playerStatus->
flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
151 playerStatus->
pos.
y = groundPosY;
154 anim = ANIM_Mario1_Land;
156 anim = ANIM_MarioW1_LandWatt;
172 if (phi_f6 < -0.47) {
175 if (phi_f6 > 0.001) {
331 switch (surfaceType) {
376 playerStatus->
flags &= ~PS_FLAG_SCRIPTED_FALL;
379 playerStatus->
flags &= ~PS_FLAG_AIRBORNE;
420 if (moveMagnitude == 0.0f) {
429 if (moveMagnitude != 0.0f) {
444 if (dx_debug_is_cheat_enabled(DEBUG_CHEAT_HIGH_JUMP)) {
473 f32 outLength =
fabsf(offset) + temp_f4;
474 f32 x = playerStatus->
pos.
x;
475 f32 y = playerStatus->
pos.
y + temp_f4;
476 f32 z = playerStatus->
pos.
z;
477 f32 sp38, sp3C, sp40, sp44;
479 &sp38, &sp3C, &sp40, &sp44);
483 return playerStatus->
pos.
y;
485 y = playerStatus->
pos.
y + offset;
496 f32 playerX, playerY, playerZ;
497 f32 test1X, test1Y, test1Z;
498 f32 test2X, test2Y, test2Z;
531 if (playerStatus->
pushVel.
x != 0.0f ||
538 if (playerStatus->
curAlpha != 128) {
550 if (playerStatus->
pushVel.
x != 0.0f ||
558 if (playerStatus->
pushVel.
x != 0.0f ||
570 if (playerStatus->
pushVel.
x != 0.0f ||
579 playerX = playerStatus->
pos.
x;
580 playerY = playerStatus->
pos.
y;
581 playerZ = playerStatus->
pos.
z;
582 if (playerStatus->
curSpeed != 0.0f) {
591 if (playerStatus->
pushVel.
x != 0.0f ||
620 xBump = speed * sinTheta;
624 zBump = -speed * cosTheta;
627 xBump = speed * sinTheta;
628 zBump = -speed * cosTheta;
639 playerX = xBump + (speed * sinTheta);
640 playerZ = zBump - (speed * cosTheta);
641 yaw =
atan2(0.0f, 0.0f, playerX, playerZ);
642 speed =
sqrtf(
SQ(playerX) +
SQ(playerZ));
644 if (speed > playerStatus->
runSpeed) {
666 playerX = playerStatus->
pos.
x;
667 playerY = playerStatus->
pos.
y;
668 playerZ = playerStatus->
pos.
z;
675 playerY = playerStatus->
pos.
y;
680 collisionStatus->
curWall = result;
688 playerX = playerStatus->
pos.
x;
689 playerZ = playerStatus->
pos.
z;
690 playerY = playerStatus->
pos.
y;
717 playerStatus->
pos.
x = playerX;
718 playerStatus->
pos.
z = playerZ;
720 playerStatus->
pos.
x = test1X;
721 playerStatus->
pos.
z = test1Z;
724 playerStatus->
pos.
x = test2X;
725 playerStatus->
pos.
z = test2Y;
759 for (i = 0; i < 4; i++) {
768 if (hitID > 0 || hitID == 0) {
770 }
else if (hitID == -1) {
794 for (i = 0; i < 4; i++) {
796 f32 y = *outY + offsetY;
816 if (overlapPush != 0.0f) {
817 f32 x = playerStatus->
pos.
x;
818 f32 y = playerStatus->
pos.
y;
819 f32 z = playerStatus->
pos.
z;
823 overlapPush -= playerStatus->
runSpeed / 10.0f;
824 playerStatus->
pos.
x = x;
825 playerStatus->
pos.
y = y;
826 playerStatus->
pos.
z = z;
828 if (overlapPush < 0.0f) {
851 f32 rotZ = playerShadow->
rot.
z + 180.0;
852 f32 rotX = playerShadow->
rot.
x + 180.0;
855 if (
fabsf(rotZ) < 20.0f &&
fabsf(rotX) < 20.0f) {
867 f32 playerX = playerStatus->
pos.
x;
868 f32 playerY = playerStatus->
pos.
y + collHeightHalf;
869 f32 playerZ = playerStatus->
pos.
z;
873 f32 hitDirX, hitDirZ;
881 if (collHeightHalf + (temp_f24 * 0.5f) < outLength) {
885 collisionStatus->
curFloor = colliderID;
918 switch (surfaceType) {
951 if (playerY - playerStatus->
pos.
y < 6.0f) {
952 playerStatus->
pos.
y = playerY;
959 playerStatus->
pos.
y = playerY;
968 if (outLength <= collHeightHalf + temp_f24 && hitDirX == 0.0f && hitDirZ == 0.0f) {
1001 x = playerStatus->
pos.
x;
1002 z = playerStatus->
pos.
z;
1004 playerStatus->
pos.
x = x;
1005 playerStatus->
pos.
z = z;
1009 x = playerStatus->
pos.
x;
1010 z = playerStatus->
pos.
z;
1012 playerStatus->
pos.
x = x;
1013 playerStatus->
pos.
z = z;
1016 x = playerStatus->
pos.
x;
1017 y = playerStatus->
pos.
y;
1018 z = playerStatus->
pos.
z;
1020 playerStatus->
pos.
x = x;
1021 playerStatus->
pos.
z = z;
1024 x = playerStatus->
pos.
x;
1025 y = playerStatus->
pos.
y;
1026 z = playerStatus->
pos.
z;
1028 playerStatus->
pos.
x = x;
1029 playerStatus->
pos.
z = z;
1032 x = playerStatus->
pos.
x;
1033 y = playerStatus->
pos.
y;
1034 z = playerStatus->
pos.
z;
1036 playerStatus->
pos.
x = x;
1037 playerStatus->
pos.
z = z;
1040 x = playerStatus->
pos.
x;
1041 y = playerStatus->
pos.
y;
1042 z = playerStatus->
pos.
z;
1044 playerStatus->
pos.
x = x;
1045 playerStatus->
pos.
z = z;
1048 x = playerStatus->
pos.
x;
1049 y = playerStatus->
pos.
y;
1050 z = playerStatus->
pos.
z;
1052 playerStatus->
pos.
x = x;
1053 playerStatus->
pos.
z = z;
1058 s32 climbableStep = FALSE;
1060 f32 x = playerStatus->
pos.
x;
1061 f32 y = playerStatus->
pos.
y;
1062 f32 z = playerStatus->
pos.
z;
1065 playerStatus->
pos.
x = x;
1066 playerStatus->
pos.
z = z;
1107 s32 soundID, altSoundID;
1118 soundID = altSoundID;
1141 x = playerStatus->
pos.
x;
1142 y = playerStatus->
pos.
y;
1143 z = playerStatus->
pos.
z;
1146 if (ret <= NO_COLLIDER && playerStatus->curSpeed == 0.0f) {
1148 x = playerStatus->
pos.
x;
1149 y = playerStatus->
pos.
y;
1150 z = playerStatus->
pos.
z;
1180 if (deltaYaw < -5.0f && deltaYaw > -175.0f) {
1182 }
else if (deltaYaw > 5.0f && deltaYaw < 175.0f) {
f32 player_get_camera_facing_angle(void)
HitID phys_check_interactable_collision(void)
s32 phys_can_player_interact(void)
HitID collision_check_player_intersecting_world(s32 mode, s32 arg1, f32 yaw)
f32 integrate_gravity(void)
void func_800E4B40(s32 mode, f32 *outX, f32 *outY, f32 *outZ)
void handle_jumping_launch(void)
CollisionStatus gCollisionStatus
void phys_player_land(void)
void phys_update_falling(void)
f32 GravityParamsStartFall[]
void phys_set_player_sliding_check(b32(*funcPtr)(void))
void move_player(s32 duration, f32 heading, f32 speed)
s32 phys_should_player_be_sliding(void)
f32 player_get_side_angle(void)
void phys_main_collision_below(void)
void collision_check_player_overlaps(void)
void gravity_use_fall_parms(void)
void collision_lateral_peach(void)
void handle_jumping_land_on_switch(void)
void player_handle_floor_collider_type(s32 colliderID)
s32 phys_is_on_sloped_ground(void)
void phys_update_interact_collider(void)
s16 FootstepSoundSelector
void try_player_footstep_sounds(s32 interval)
void record_jump_apex(void)
void func_800E4AD8(s32 mode)
void collision_main_lateral(void)
HitID func_800E4404(s32 mode, s32 offsetY, f32 arg2, f32 *outX, f32 *outY, f32 *outZ)
void collision_lava_reset_check_additional_overlaps(void)
b32(* PlayerSlidingCallback)(void)
void phys_update_jump(void)
void phys_init_integrator_for_current_state(void)
f32 GravityParamsStartJump[]
f32 player_fall_distance(void)
s8 get_current_partner_id(void)
void phys_save_ground_pos(void)
void check_input_midair_jump(void)
b32 can_trigger_loading_zone(void)
f32 player_check_collision_below(f32 offset, s32 *colliderID)
HitID collision_main_above(void)
s8 enableCollisionOverlapsCheck
@ SURFACE_TYPE_HEDGES
used within hedge maze in flo_11
@ PS_FLAG_ENTERING_BATTLE
@ PS_FLAG_ACTION_STATE_CHANGED
@ PS_FLAG_CUTSCENE_MOVEMENT
@ PS_FLAG_MOVEMENT_LOCKED
@ PARTNER_ACTION_BOMBETTE_2
@ LANDING_ON_SWITCH_SUBSTATE_1
@ LANDING_ON_SWITCH_SUBSTATE_0
@ LANDING_ON_SWITCH_SUBSTATE_2
@ COLLIDER_FLAGS_SURFACE_TYPE_MASK
@ ENTITY_TYPE_HIDDEN_PANEL
@ ENTITY_TYPE_BRICK_BLOCK
@ PA_FLAG_INTERRUPT_USE_PARTNER
forces actions with bow, parakarry, watt, and lakilester to end (sushie not tested)
@ PA_FLAG_USING_PEACH_PHYSICS
@ ENTITY_COLLISION_PLAYER_TOUCH_FLOOR
@ ACTION_STATE_PUSHING_BLOCK
@ ACTION_STATE_STEP_DOWN_LAND
@ ACTION_STATE_SPIN_POUND
@ ACTION_STATE_LANDING_ON_SWITCH
Small red/blue ! switches.
@ ACTION_STATE_LAUNCH
Shy Guy Toybox jack-in-the-boxes.
@ ACTION_STATE_USE_TWEESTER
@ ACTION_STATE_USE_SPRING
@ ACTION_STATE_USE_SNEAKY_PARASOL
@ ACTION_STATE_BOUNCE_OFF_SWITCH
Small red/blue ! switches.
@ ACTION_STATE_STEP_UP_PEACH
@ ACTION_STATE_TORNADO_POUND
@ ACTION_STATE_USE_SPINNING_FLOWER
@ ACTION_STATE_HOP
Released A before apex of jump.
@ ACTION_STATE_BOUNCE
Used with Kooper.
@ ACTION_STATE_HIT_FIRE
Causes Mario to fly up and take damage. Used for fire bars.
@ ACTION_STATE_TORNADO_JUMP
Entity * get_entity_by_index(s32 index)
void player_input_to_move_vector(f32 *angle, f32 *magnitude)
void update_locomotion_state(void)
HitID player_raycast_below_cam_relative(PlayerStatus *playerStatus, f32 *outX, f32 *outY, f32 *outZ, f32 *outLength, f32 *hitRx, f32 *hitRz, f32 *hitDirX, f32 *hitDirZ)
b32 check_player_action_debug(void)
s32 disable_player_input(void)
Shadow * get_shadow_by_index(s32 index)
s32 get_collider_flags(s32 colliderID)
s32 enable_player_input(void)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
s32 player_test_lateral_overlap(s32, PlayerStatus *, f32 *, f32 *, f32 *, f32, f32)
s32 phys_adjust_cam_on_landing(void)
u32 get_entity_type(s32 arg0)
s32 is_starting_conversation(void)
void set_action_state(s32 actionState)
HitID player_raycast_up_corners(PlayerStatus *, f32 *, f32 *, f32 *, f32 *, f32)
HitID player_test_move_with_slipping(PlayerStatus *playerStatus, f32 *posX, f32 *posY, f32 *posZ, f32 speed, f32 heading)
void suggest_player_anim_allow_backward(AnimID anim)
HitID player_test_move_without_slipping(PlayerStatus *, f32 *, f32 *, f32 *, f32, f32, s32 *)
Only used for Peach physics.
f32 get_player_normal_pitch(void)
void sin_cos_rad(f32 rad, f32 *outSinTheta, f32 *outCosTheta)
void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta)
f32 get_clamped_angle_diff(f32, f32)
void sfx_play_sound_at_player(s32 soundID, s32 arg1)
#define COLLISION_WITH_ENTITY_BIT
#define LOAD_INTEGRATOR_FALL(ptr)
PlayerStatus * gPlayerStatusPtr
PartnerStatus gPartnerStatus
GameStatus * gGameStatusPtr
s32 PrevPlayerCamRelativeYaw
PlayerStatus gPlayerStatus