mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 03:55:11 +00:00
Move camera down if ceiling hanging with romhack camera (#407)
This commit is contained in:
parent
42cf0e3eea
commit
945d1efe91
1 changed files with 16 additions and 0 deletions
|
@ -12337,6 +12337,22 @@ void mode_rom_hack_camera(struct Camera *c) {
|
||||||
pos[1] = mPos[1] + desiredHeight;
|
pos[1] = mPos[1] + desiredHeight;
|
||||||
pos[2] = mPos[2] + sins(sRomHackYaw) * desiredDist;
|
pos[2] = mPos[2] + sins(sRomHackYaw) * desiredDist;
|
||||||
|
|
||||||
|
// Move camera down for hangable ceilings
|
||||||
|
if (sMarioCamState->action & ACT_FLAG_HANGING) {
|
||||||
|
f32 marioCeilHeight = sMarioGeometry.currCeilHeight;
|
||||||
|
f32 marioFloorHeight = sMarioGeometry.currFloorHeight;
|
||||||
|
|
||||||
|
if (marioFloorHeight < marioCeilHeight - 400.f) {
|
||||||
|
marioFloorHeight = marioCeilHeight - 400.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
f32 goalHeight = marioFloorHeight + (marioCeilHeight - marioFloorHeight) * 0.4f;
|
||||||
|
|
||||||
|
if (pos[1] - 400 > goalHeight) {
|
||||||
|
pos[1] -= 400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (rom_hack_cam_can_see_mario(pos)) {
|
if (rom_hack_cam_can_see_mario(pos)) {
|
||||||
// we can see mario, no need to adjust
|
// we can see mario, no need to adjust
|
||||||
c->pos[0] = pos[0];
|
c->pos[0] = pos[0];
|
||||||
|
|
Loading…
Reference in a new issue