mirror of
https://github.com/BanjoRecomp/BanjoRecomp
synced 2026-08-23 14:32:09 -04:00
Fix flying camera inversion not applying to the bee (#307)
This commit is contained in:
@@ -674,6 +674,21 @@ RECOMP_PATCH void func_802A3648(void){
|
||||
pitch_setIdeal(ml_map_f(tmp_f0, 0.0f, 1.0f, 0.0f, 80.0f));
|
||||
}
|
||||
|
||||
// @recomp Patched to allow configuring Y axis inversion when flying as the bee
|
||||
RECOMP_PATCH void _bsBeeFly_updatePitch(void){
|
||||
// @recomp Get the axis inversion setting
|
||||
s32 inverted_y = recomp_get_flying_and_swimming_inverted_y();
|
||||
|
||||
f32 stickY = inverted_y ? bastick_getY() : -bastick_getY();
|
||||
|
||||
if(stickY < 0.0f){
|
||||
pitch_setIdeal(ml_map_f(stickY, -1.0f, 0.0f, 300.0f, 360.0f));
|
||||
} else {
|
||||
pitch_setIdeal(ml_map_f(stickY, 0.0f, 1.0f, 0.0f, 80.0f));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// @recomp Patched to allow configuring X axis inversion when flying
|
||||
RECOMP_PATCH void func_802A354C(void){
|
||||
f32 yaw_range;
|
||||
@@ -699,6 +714,33 @@ RECOMP_PATCH void func_802A354C(void){
|
||||
yaw_setIdeal(mlNormalizeAngle(yaw_getIdeal() + ml_map_f(sp2C, -1.0f, 1.0f, yaw_range, -yaw_range)));
|
||||
}
|
||||
|
||||
void ncDynamicCam4_func_802BFE50(f32, f32, f32);
|
||||
|
||||
// @recomp Patched to allow configuring X axis inversion when flying as the bee
|
||||
RECOMP_PATCH void _bsBeeFly_updateYaw(void){
|
||||
f32 sp34;
|
||||
f32 sp30;
|
||||
f32 stickX;
|
||||
|
||||
// @recomp Get the axis inversion setting
|
||||
s32 inverted_x = recomp_get_flying_and_swimming_inverted_x();
|
||||
|
||||
stickX = inverted_x ? -bastick_getX() : bastick_getX();
|
||||
ncDynamicCam4_func_802BFE50(2.0f, 2000.0f, 350.0f);
|
||||
if(bakey_held(BUTTON_R)){
|
||||
yaw_setVelocityBounded(500.0f, 30.0f);
|
||||
sp34 = 6.0f;
|
||||
sp30 = 85.0f;
|
||||
}
|
||||
else{
|
||||
yaw_setVelocityBounded(500.0f, 2.0f);
|
||||
sp34 = 3.0f;
|
||||
sp30 = 65.0f;
|
||||
}
|
||||
roll_setIdeal(ml_map_f(stickX, -1.0f, 1.0f, -sp30, sp30));
|
||||
yaw_setIdeal(mlNormalizeAngle(yaw_getIdeal() + ml_map_f(stickX, -1.0f, 1.0f, sp34, -sp34)));
|
||||
}
|
||||
|
||||
// @recomp Patched to allow configuring Y axis inversion when swimming
|
||||
f32 func_802A716C();
|
||||
RECOMP_PATCH void func_802A7304() {
|
||||
|
||||
Reference in New Issue
Block a user