3#include "sprite/player.h"
79 x = playerStatus->
pos.
x;
80 y = playerStatus->
pos.
y + halfHeight;
81 z = playerStatus->
pos.
z;
85 if (moveMagnitude != 0.0f) {
127 playerStatus->
flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
152 playerStatus->
pos.
y = groundPosY;
155 anim = ANIM_Mario1_Land;
157 anim = ANIM_MarioW1_LandWatt;
173 if (phi_f6 < -0.47) {
176 if (phi_f6 > 0.001) {
332 switch (surfaceType) {
377 playerStatus->
flags &= ~PS_FLAG_SCRIPTED_FALL;
380 playerStatus->
flags &= ~PS_FLAG_AIRBORNE;
421 if (moveMagnitude == 0.0f) {
430 if (moveMagnitude != 0.0f) {
445 if (dx_debug_is_cheat_enabled(DEBUG_CHEAT_HIGH_JUMP)) {
474 f32 outLength =
fabsf(offset) + temp_f4;
475 f32 x = playerStatus->
pos.
x;
476 f32 y = playerStatus->
pos.
y + temp_f4;
477 f32 z = playerStatus->
pos.
z;
478 f32 sp38, sp3C, sp40, sp44;
480 &sp38, &sp3C, &sp40, &sp44);
484 return playerStatus->
pos.
y;
486 y = playerStatus->
pos.
y + offset;
497 f32 playerX, playerY, playerZ;
498 f32 test1X, test1Y, test1Z;
499 f32 test2X, test2Y, test2Z;
532 if (playerStatus->
pushVel.
x != 0.0f ||
539 if (playerStatus->
curAlpha != 128) {
551 if (playerStatus->
pushVel.
x != 0.0f ||
559 if (playerStatus->
pushVel.
x != 0.0f ||
571 if (playerStatus->
pushVel.
x != 0.0f ||
580 playerX = playerStatus->
pos.
x;
581 playerY = playerStatus->
pos.
y;
582 playerZ = playerStatus->
pos.
z;
583 if (playerStatus->
curSpeed != 0.0f) {
592 if (playerStatus->
pushVel.
x != 0.0f ||
621 xBump = speed * sinTheta;
625 zBump = -speed * cosTheta;
628 xBump = speed * sinTheta;
629 zBump = -speed * cosTheta;
640 playerX = xBump + (speed * sinTheta);
641 playerZ = zBump - (speed * cosTheta);
642 yaw =
atan2(0.0f, 0.0f, playerX, playerZ);
643 speed =
sqrtf(
SQ(playerX) +
SQ(playerZ));
645 if (speed > playerStatus->
runSpeed) {
667 playerX = playerStatus->
pos.
x;
668 playerY = playerStatus->
pos.
y;
669 playerZ = playerStatus->
pos.
z;
676 playerY = playerStatus->
pos.
y;
681 collisionStatus->
curWall = result;
689 playerX = playerStatus->
pos.
x;
690 playerZ = playerStatus->
pos.
z;
691 playerY = playerStatus->
pos.
y;
718 playerStatus->
pos.
x = playerX;
719 playerStatus->
pos.
z = playerZ;
721 playerStatus->
pos.
x = test1X;
722 playerStatus->
pos.
z = test1Z;
725 playerStatus->
pos.
x = test2X;
726 playerStatus->
pos.
z = test2Y;
760 for (i = 0; i < 4; i++) {
769 if (hitID > 0 || hitID == 0) {
771 }
else if (hitID == -1) {
795 for (i = 0; i < 4; i++) {
797 f32 y = *outY + offsetY;
817 if (overlapPush != 0.0f) {
818 f32 x = playerStatus->
pos.
x;
819 f32 y = playerStatus->
pos.
y;
820 f32 z = playerStatus->
pos.
z;
824 overlapPush -= playerStatus->
runSpeed / 10.0f;
825 playerStatus->
pos.
x = x;
826 playerStatus->
pos.
y = y;
827 playerStatus->
pos.
z = z;
829 if (overlapPush < 0.0f) {
852 f32 rotZ = playerShadow->
rot.
z + 180.0;
853 f32 rotX = playerShadow->
rot.
x + 180.0;
856 if (
fabsf(rotZ) < 20.0f &&
fabsf(rotX) < 20.0f) {
868 f32 playerX = playerStatus->
pos.
x;
869 f32 playerY = playerStatus->
pos.
y + collHeightHalf;
870 f32 playerZ = playerStatus->
pos.
z;
874 f32 hitDirX, hitDirZ;
882 if (collHeightHalf + (temp_f24 * 0.5f) < outLength) {
886 collisionStatus->
curFloor = colliderID;
919 switch (surfaceType) {
952 if (playerY - playerStatus->
pos.
y < 6.0f) {
953 playerStatus->
pos.
y = playerY;
960 playerStatus->
pos.
y = playerY;
969 if (outLength <= collHeightHalf + temp_f24 && hitDirX == 0.0f && hitDirZ == 0.0f) {
1002 x = playerStatus->
pos.
x;
1003 z = playerStatus->
pos.
z;
1005 playerStatus->
pos.
x = x;
1006 playerStatus->
pos.
z = z;
1010 x = playerStatus->
pos.
x;
1011 z = playerStatus->
pos.
z;
1013 playerStatus->
pos.
x = x;
1014 playerStatus->
pos.
z = z;
1017 x = playerStatus->
pos.
x;
1018 y = playerStatus->
pos.
y;
1019 z = playerStatus->
pos.
z;
1021 playerStatus->
pos.
x = x;
1022 playerStatus->
pos.
z = z;
1025 x = playerStatus->
pos.
x;
1026 y = playerStatus->
pos.
y;
1027 z = playerStatus->
pos.
z;
1029 playerStatus->
pos.
x = x;
1030 playerStatus->
pos.
z = z;
1033 x = playerStatus->
pos.
x;
1034 y = playerStatus->
pos.
y;
1035 z = playerStatus->
pos.
z;
1037 playerStatus->
pos.
x = x;
1038 playerStatus->
pos.
z = z;
1041 x = playerStatus->
pos.
x;
1042 y = playerStatus->
pos.
y;
1043 z = playerStatus->
pos.
z;
1045 playerStatus->
pos.
x = x;
1046 playerStatus->
pos.
z = z;
1049 x = playerStatus->
pos.
x;
1050 y = playerStatus->
pos.
y;
1051 z = playerStatus->
pos.
z;
1053 playerStatus->
pos.
x = x;
1054 playerStatus->
pos.
z = z;
1059 s32 climbableStep = FALSE;
1061 f32 x = playerStatus->
pos.
x;
1062 f32 y = playerStatus->
pos.
y;
1063 f32 z = playerStatus->
pos.
z;
1066 playerStatus->
pos.
x = x;
1067 playerStatus->
pos.
z = z;
1108 s32 soundID, altSoundID;
1119 soundID = altSoundID;
1142 x = playerStatus->
pos.
x;
1143 y = playerStatus->
pos.
y;
1144 z = playerStatus->
pos.
z;
1147 if (ret <= NO_COLLIDER && playerStatus->curSpeed == 0.0f) {
1149 x = playerStatus->
pos.
x;
1150 y = playerStatus->
pos.
y;
1151 z = playerStatus->
pos.
z;
1181 if (deltaYaw < -5.0f && deltaYaw > -175.0f) {
1183 }
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