mirror of
https://github.com/Retropex/dolphin.git
synced 2025-06-03 16:02:33 +02:00
mp2 rotation switch to transform-based
This commit is contained in:
parent
87798778e9
commit
0573a3c494
@ -158,6 +158,7 @@ void init_db(AddressDB& addr_db) {
|
||||
addr_db.register_dynamic_address(Game::PRIME_2_GCN, "object_list", "state_manager", {mrt1(0x810), rt0});
|
||||
addr_db.register_dynamic_address(Game::PRIME_2_GCN, "world", "state_manager", {mrt1(0x1604), rt0});
|
||||
addr_db.register_dynamic_address(Game::PRIME_2_GCN, "player", "state_manager", {mrt1(0x14fc), rt0});
|
||||
addr_db.register_dynamic_address(Game::PRIME_2_GCN, "player_xf", "player", {mrt1(0x24)});
|
||||
addr_db.register_dynamic_address(Game::PRIME_2_GCN, "orbit_state", "player", {mrt1(0x3a4)});
|
||||
addr_db.register_dynamic_address(Game::PRIME_2_GCN, "firstperson_pitch", "player", {mrt1(0x604)});
|
||||
addr_db.register_dynamic_address(Game::PRIME_2_GCN, "ball_state", "player", {mrt1(0x38c)});
|
||||
|
@ -534,13 +534,19 @@ void FpsControls::run_mod_mp2_gc(Region region) {
|
||||
if (show_crosshair) {
|
||||
write32(crosshair_color_rgba, crosshair_color_addr);
|
||||
}
|
||||
|
||||
|
||||
LOOKUP_DYN(player_xf);
|
||||
Transform cplayer_xf(player_xf);
|
||||
LOOKUP_DYN(orbit_state);
|
||||
LOOKUP_DYN(firstperson_pitch);
|
||||
if (read32(orbit_state) != ORBIT_STATE_GRAPPLE &&
|
||||
read32(orbit_state) != 0) {
|
||||
calculate_pitch_locked(Game::PRIME_2_GCN, region);
|
||||
writef32(FpsControls::pitch, firstperson_pitch);
|
||||
|
||||
vec3 fwd = cplayer_xf.fwd();
|
||||
yaw = atan2f(fwd.y, fwd.x);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -559,8 +565,10 @@ void FpsControls::run_mod_mp2_gc(Region region) {
|
||||
}
|
||||
}
|
||||
|
||||
calculate_pitch_delta();
|
||||
calculate_pitchyaw_delta();
|
||||
writef32(FpsControls::pitch, firstperson_pitch);
|
||||
cplayer_xf.build_rotation(yaw);
|
||||
cplayer_xf.write_to(player_xf);
|
||||
|
||||
LOOKUP_DYN(ball_state);
|
||||
if (read32(ball_state) == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user