Added storing the full Cos FOV for the camera

Added storing the full Cos FOV for the camera
meow-7.2.2
minerjr 2025-03-05 09:49:12 -04:00 committed by Beq
parent 27ec21aa7e
commit 8a0cf5ca0f
2 changed files with 13 additions and 0 deletions

View File

@ -69,6 +69,7 @@ LLViewerCamera::LLViewerCamera() : LLCamera()
mCameraFOVDefault = DEFAULT_FIELD_OF_VIEW;
mPrevCameraFOVDefault = DEFAULT_FIELD_OF_VIEW;
mCosHalfCameraFOV = cosf(mCameraFOVDefault * 0.5f);
mCosCameraFOV = cosf(mCameraFOVDefault);
mPixelMeterRatio = 0.f;
mScreenPixelArea = 0;
mZoomFactor = 1.f;
@ -143,6 +144,10 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 &center, const LLVecto
mAverageSpeed = (F32)LLTrace::get_frame_recording().getPeriodMeanPerSec(sVelocityStat, 50);
mAverageAngularSpeed = (F32)LLTrace::get_frame_recording().getPeriodMeanPerSec(sAngularVelocityStat);
mCosHalfCameraFOV = cosf(0.5f * getView() * llmax(1.0f, getAspect()));
// <FS:minerjr> [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer
// Store the full Cos FOV value
mCosCameraFOV = cosf(getView() * llmax(1.0f, getAspect()));
// </FS:minerjr> [FIRE-35081]
// update pixel meter ratio using default fov, not modified one
mPixelMeterRatio = (F32)(getViewHeightInPixels()/ (2.f*tanf(mCameraFOVDefault*0.5f)));
@ -822,6 +827,9 @@ void LLViewerCamera::setDefaultFOV(F32 vertical_fov_rads)
setView(vertical_fov_rads);
mCameraFOVDefault = vertical_fov_rads;
mCosHalfCameraFOV = cosf(mCameraFOVDefault * 0.5f);
// <FS:minerjr> [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer
mCosCameraFOV = cosf(mCameraFOVDefault);
// </FS:minerjr> [FIRE-35081]
}
bool LLViewerCamera::isDefaultFOVChanged()

View File

@ -81,6 +81,7 @@ public:
static LLTrace::CountStatHandle<>* getVelocityStat() {return &sVelocityStat; }
static LLTrace::CountStatHandle<>* getAngularVelocityStat() {return &sAngularVelocityStat; }
F32 getCosHalfFov() {return mCosHalfCameraFOV;}
F32 getCosFov() {return mCosCameraFOV;}
F32 getAverageSpeed() {return mAverageSpeed ;}
F32 getAverageAngularSpeed() {return mAverageAngularSpeed;}
@ -120,6 +121,10 @@ protected:
F32 mCameraFOVDefault;
F32 mPrevCameraFOVDefault;
F32 mCosHalfCameraFOV;
// <FS:minerjr> [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer
// Store the Cos of the full FOV
F32 mCosCameraFOV;
// </FS:minerjr> [FIRE-35081]
LLVector3 mLastPointOfInterest;
F32 mPixelMeterRatio; // Divide by distance from camera to get pixels per meter at that distance.
S32 mScreenPixelArea; // Pixel area of entire window