Merge DRTVWR-460
commit
a9c2d26fa9
|
|
@ -2148,6 +2148,22 @@ bool LLAgentCamera::clampCameraPosition(LLVector3d& posCamGlobal, const LLVector
|
|||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
LLVector3 LLAgentCamera::getCurrentCameraOffset()
|
||||
{
|
||||
LLVector3 camera_offset = (LLViewerCamera::getInstance()->getOrigin() - gAgentAvatarp->mRoot->getWorldPosition() - mThirdPersonHeadOffset) * ~gAgent.getFrameAgent().getQuaternion();
|
||||
return camera_offset / mCameraZoomFraction / gSavedSettings.getF32("CameraOffsetScale");
|
||||
}
|
||||
|
||||
LLVector3d LLAgentCamera::getCurrentFocusOffset()
|
||||
{
|
||||
return (mFocusTargetGlobal - gAgent.getPositionGlobal()) * ~gAgent.getFrameAgent().getQuaternion();
|
||||
}
|
||||
|
||||
bool LLAgentCamera::isJoystickCameraUsed()
|
||||
{
|
||||
return ((mOrbitAroundRadians != 0) || (mOrbitOverAngle != 0) || !mPanFocusDiff.isNull());
|
||||
}
|
||||
|
||||
LLVector3 LLAgentCamera::getCameraOffsetInitial()
|
||||
{
|
||||
return convert_from_llsd<LLVector3>(mCameraOffsetInitial->get(), TYPE_VEC3, "");
|
||||
|
|
|
|||
|
|
@ -122,6 +122,10 @@ public:
|
|||
/** Determines default focus offset depending on the current camera preset */
|
||||
LLVector3d getFocusOffsetInitial();
|
||||
|
||||
LLVector3 getCurrentCameraOffset();
|
||||
LLVector3d getCurrentFocusOffset();
|
||||
bool isJoystickCameraUsed();
|
||||
|
||||
private:
|
||||
/** Determines maximum camera distance from target for mouselook, opposite to LAND_MIN_ZOOM */
|
||||
// <FS:Ansariel> FIRE-23470: Fix camera controls zoom glitch
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "llfloatersavecamerapreset.h"
|
||||
|
||||
#include "llagentcamera.h"
|
||||
#include "llbutton.h"
|
||||
#include "llcombobox.h"
|
||||
#include "llfloaterpreference.h"
|
||||
|
|
@ -101,6 +102,11 @@ void LLFloaterSaveCameraPreset::onBtnSave()
|
|||
}
|
||||
else
|
||||
{
|
||||
if (gAgentCamera.isJoystickCameraUsed())
|
||||
{
|
||||
gSavedSettings.setVector3("CameraOffsetRearView", gAgentCamera.getCurrentCameraOffset());
|
||||
gSavedSettings.setVector3d("FocusOffsetRearView", gAgentCamera.getCurrentFocusOffset());
|
||||
}
|
||||
if (is_saving_new)
|
||||
{
|
||||
std::list<std::string> preset_names;
|
||||
|
|
|
|||
Loading…
Reference in New Issue