[RLVa] @camzoommax, @camzoommin

Reload current saved zoom for clamping when imposing this restriction, whether that be mouselook zoom or regular.
Also some code cleanup.
This commit is contained in:
Inusaito Sayori
2015-05-26 05:34:05 -04:00
parent 9616a43cb0
commit 1720f2ebe4
4 changed files with 54 additions and 10 deletions

View File

@@ -715,11 +715,17 @@ BOOL LLViewerCamera::areVertsVisible(LLViewerObject* volumep, BOOL all_verts)
// changes local camera and broadcasts change
/* virtual */ void LLViewerCamera::setView(F32 vertical_fov_rads)
{
F32 old_fov = LLViewerCamera::getInstance()->getView();
F32 old_fov = getView();
// cap the FoV
vertical_fov_rads = llclamp(vertical_fov_rads, getMinView(), getMaxView());
// RLVa:LF - @camzoommax
if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMZOOMMAX))
vertical_fov_rads = llmin(vertical_fov_rads, gRlvHandler.camMax(RLV_BHVR_CAMZOOMMAX));
if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMZOOMMIN))
vertical_fov_rads = llmax(vertical_fov_rads, gRlvHandler.camMin(RLV_BHVR_CAMZOOMMIN));
if (vertical_fov_rads == old_fov) return;
// send the new value to the simulator