nvm playCamera actually equivalent

This commit is contained in:
HeartPiece 2024-07-04 18:33:29 +10:00
parent 2ddbbfb9e0
commit 49cb9d1bc1
3 changed files with 11 additions and 11 deletions

View File

@ -127,7 +127,7 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/SaraiState.cpp">SaraiState.cpp</a> | 27370 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/MarState.cpp">MarState.cpp</a> | 28356 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/FrogState.cpp">FrogState.cpp</a> | 30811 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/SnakeCrowState.cpp">SnakeCrowState.cpp</a> | 32065 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/HanachirashiState.cpp">HanachirashiState.cpp</a> | 32837 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/KabutoState.cpp">KabutoState.cpp</a> | 32923 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/TankState.cpp">TankState.cpp</a> | 33069 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/playCamera.cpp">playCamera.cpp</a> | 33864 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/TankState.cpp">TankState.cpp</a> | 33069 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/playCamera.cpp">playCamera.cpp</a> | 33865 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/BombSaraiState.cpp">BombSaraiState.cpp</a> | 36432 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/DangoMushi.cpp">DangoMushi.cpp</a> | 37034 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/RandMapScore.cpp">RandMapScore.cpp</a> | 37057 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Hanachirashi.cpp">Hanachirashi.cpp</a> | 39560 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/SnakeCrow.cpp">SnakeCrow.cpp</a> | 39754 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Mar.cpp">Mar.cpp</a> | 41695 |

View File

@ -127,22 +127,22 @@ inline f32 _normaliseAngle(f32 angle)
return normalisedAngle;
}
inline f32 _normaliseAngle(f32 start, f32 angle)
inline f32 _normaliseAngle(f32 angle, f32 start)
{
// f32 normalisedAngle = start;
if (start >= angle) {
f32 delta = start - angle;
f32 normalisedAngle = start;
if (normalisedAngle >= angle) {
f32 delta = normalisedAngle - angle;
if (TAU - delta < delta) {
start -= TAU;
normalisedAngle -= TAU;
}
} else {
f32 delta = angle - start;
f32 delta = angle - normalisedAngle;
if (TAU - delta < delta) {
start += TAU;
normalisedAngle += TAU;
}
}
return start;
return normalisedAngle;
}
inline f32 _clampAngle(f32 angle, f32 difference, f32 limit)

View File

@ -625,9 +625,9 @@ void PlayCamera::updateParms(int flag)
CameraParms* parms = mCameraParms;
f32 targetAngle = _normaliseAngle(mCameraAngleTarget, mCameraAngleCurrent); // this needs fixing
f32 targetAngle = _normaliseAngle(mCameraAngleCurrent, mCameraAngleTarget); // this needs fixing
mCameraAngleCurrent += parms->mRotSpeed.mValue * (targetAngle - mCameraAngleTarget);
mCameraAngleCurrent += parms->mRotSpeed.mValue * (targetAngle - mCameraAngleCurrent);
f32 angle = mCameraAngleCurrent;
clampAngle(angle);