Skip to content

Commit

Permalink
add rotation to set/get state functions for controllers that have the…
Browse files Browse the repository at this point in the history
…ir own rotations (#1913)
  • Loading branch information
loveridge authored Jan 24, 2025
1 parent 69c2907 commit 0d20f38
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rts/Game/Camera/DollyController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ void CDollyController::GetState(StateMap& sm) const
{
RECOIL_DETAILED_TRACY_ZONE;
CCameraController::GetState(sm);
sm["rx"] = rot.x;
sm["ry"] = rot.y;
sm["rz"] = rot.z;
}

bool CDollyController::SetState(const StateMap& sm)
Expand Down
6 changes: 6 additions & 0 deletions rts/Game/Camera/FPSController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ void CFPSController::GetState(StateMap& sm) const
RECOIL_DETAILED_TRACY_ZONE;
CCameraController::GetState(sm);
sm["oldHeight"] = oldHeight;
sm["rx"] = rot.x;
sm["ry"] = rot.y;
sm["rz"] = rot.z;
}


Expand All @@ -159,6 +162,9 @@ bool CFPSController::SetState(const StateMap& sm)
RECOIL_DETAILED_TRACY_ZONE;
CCameraController::SetState(sm);
SetStateFloat(sm, "oldHeight", oldHeight);
SetStateFloat(sm, "rx", rot.x);
SetStateFloat(sm, "ry", rot.y);
SetStateFloat(sm, "rz", rot.z);

return true;
}
Expand Down
6 changes: 6 additions & 0 deletions rts/Game/Camera/RotOverheadController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ void CRotOverheadController::GetState(StateMap& sm) const
CCameraController::GetState(sm);

sm["oldHeight"] = oldHeight;
sm["rx"] = rot.x;
sm["ry"] = rot.y;
sm["rz"] = rot.z;
}


Expand All @@ -142,6 +145,9 @@ bool CRotOverheadController::SetState(const StateMap& sm)
CCameraController::SetState(sm);

SetStateFloat(sm, "oldHeight", oldHeight);
SetStateFloat(sm, "rx", rot.x);
SetStateFloat(sm, "ry", rot.y);
SetStateFloat(sm, "rz", rot.z);

return true;
}
Expand Down

0 comments on commit 0d20f38

Please sign in to comment.