I'm making a mod that adds some abilities from the Super Mario games, one of which is the "Sideflip", which has the player flip over and turn around in midair. To handle the camera movement for this, I've set up a mixin to the Camera.setRotation method that lets me apply an offset to the player's pitch and yaw, and, very importantly, set camera roll.
However, I've noticed that when I swivel the camera around in this way, any terrain that's revealed by this motion will have large sections missing. Adjusting the camera manually by moving the mouse immediately fills in the missing terrain. I suspect that this is probably related to the game's frustum culling, right? It seems to me like when I do this, the game isn't entirely aware that I'm changing the camera angle, and so it doesn't recalculate what part of the world needs to be on screen.
Something that seems notable to me, though: When a Sideflip is executed, the player entity's yaw is immediately flipped 180 degrees, and a variable is set to trigger the mixin code to start adjusting the camera, to smoothly adjust it to this new rotation. As such, from the moment the Sideflip begins, the mixin is actually starting off with a massive camera offset, and then interpolates it all the way down to zero, to bring the camera angle in line with the player's true orientation (at which point the variable is changed back, so the mixin stops interfering with the camera at all).
So if the issue was that the game doesn't take the angles set by my mixin into account at all for frustum culling, I would expect that the effect would be that the instant the Sideflip starts, everything on-screen would be culled, and my mixin would swing the camera around to reveal fully visible terrain. But that's not what happens, so I'm not sure what to make of it.
Is there something I can do to fix this, or should I be taking some entirely different approach to do first-person camera animations? Any help would be appreciated!