[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user