diff options
author | Callum Prentice <callum@gmail.com> | 2020-05-20 14:21:31 -0700 |
---|---|---|
committer | Callum Prentice <callum@gmail.com> | 2020-05-20 14:21:31 -0700 |
commit | b1e063fe8c339c339a5d154e2f48fb8accf6f71c (patch) | |
tree | 02322319b2106e1cb9d6d998e23d3fcd753dadd1 /indra/newview/llagentcamera.h | |
parent | 09802fa8ea9c8459e13a32720088f6d6fb1ad42d (diff) | |
parent | ed3d9abdd01304b5a9708880d9b150fb6568256b (diff) |
Merge branch 'master' into DRTVWR-512
Diffstat (limited to 'indra/newview/llagentcamera.h')
-rw-r--r-- | indra/newview/llagentcamera.h | 55 |
1 files changed, 41 insertions, 14 deletions
diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index a4bc8434b0..ec1ed433d7 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -56,7 +56,10 @@ enum ECameraPreset CAMERA_PRESET_FRONT_VIEW, /** "Above and to the left, over the shoulder, pulled back a little on the zoom" */ - CAMERA_PRESET_GROUP_VIEW + CAMERA_PRESET_GROUP_VIEW, + + /** Current view when a preset is saved */ + CAMERA_PRESET_CUSTOM }; //------------------------------------------------------------------------ @@ -109,20 +112,32 @@ private: //-------------------------------------------------------------------- public: void switchCameraPreset(ECameraPreset preset); -private: /** Determines default camera offset depending on the current camera preset */ LLVector3 getCameraOffsetInitial(); + /** Determines default focus offset depending on the current camera preset */ + LLVector3d getFocusOffsetInitial(); + + LLVector3 getCurrentCameraOffset(); + LLVector3d getCurrentFocusOffset(); + LLQuaternion getCurrentAvatarRotation(); + bool isJoystickCameraUsed(); + void setInitSitRot(LLQuaternion sit_rot) { mInitSitRot = sit_rot; }; + void rotateToInitSitRot(); + +private: /** Determines maximum camera distance from target for mouselook, opposite to LAND_MIN_ZOOM */ F32 getCameraMaxZoomDistance(); /** Camera preset in Third Person Mode */ ECameraPreset mCameraPreset; - /** Initial camera offsets */ - std::map<ECameraPreset, LLPointer<LLControlVariable> > mCameraOffsetInitial; + /** Initial camera offset */ + LLPointer<LLControlVariable> mCameraOffsetInitial; + + /** Initial focus offset */ + LLPointer<LLControlVariable> mFocusOffsetInitial; - /** Initial focus offsets */ - std::map<ECameraPreset, LLPointer<LLControlVariable> > mFocusOffsetInitial; + LLQuaternion mInitSitRot; //-------------------------------------------------------------------- // Position @@ -137,6 +152,8 @@ public: F32 getCurrentCameraBuildOffset() { return (F32)mCameraFocusOffset.length(); } void clearCameraLag() { mCameraLag.clearVec(); } private: + LLVector3 getAvatarRootPosition(); + F32 mCurrentCameraDistance; // Current camera offset from avatar F32 mTargetCameraDistance; // Target camera offset from avatar F32 mCameraFOVZoomFactor; // Amount of fov zoom applied to camera when zeroing in on an object @@ -204,7 +221,7 @@ public: void validateFocusObject(); void setFocusGlobal(const LLPickInfo& pick); void setFocusGlobal(const LLVector3d &focus, const LLUUID &object_id = LLUUID::null); - void setFocusOnAvatar(BOOL focus, BOOL animate); + void setFocusOnAvatar(BOOL focus, BOOL animate, BOOL reset_axes = TRUE); void setCameraPosAndFocusGlobal(const LLVector3d& pos, const LLVector3d& focus, const LLUUID &object_id); void clearFocusObject(); void setFocusObject(LLViewerObject* object); @@ -256,26 +273,31 @@ public: void cameraOrbitAround(const F32 radians); // Rotate camera CCW radians about build focus point void cameraOrbitOver(const F32 radians); // Rotate camera forward radians over build focus point void cameraOrbitIn(const F32 meters); // Move camera in toward build focus point - + void resetCameraOrbit(); + void resetOrbitDiff(); //-------------------------------------------------------------------- // Zoom //-------------------------------------------------------------------- public: - void handleScrollWheel(S32 clicks); // Mousewheel driven zoom - void cameraZoomIn(const F32 factor); // Zoom in by fraction of current distance - F32 getCameraZoomFraction(); // Get camera zoom as fraction of minimum and maximum zoom - void setCameraZoomFraction(F32 fraction); // Set camera zoom as fraction of minimum and maximum zoom + void handleScrollWheel(S32 clicks); // Mousewheel driven zoom + void cameraZoomIn(const F32 factor); // Zoom in by fraction of current distance + F32 getCameraZoomFraction(bool get_third_person = false); // Get camera zoom as fraction of minimum and maximum zoom + void setCameraZoomFraction(F32 fraction); // Set camera zoom as fraction of minimum and maximum zoom F32 calcCameraFOVZoomFactor(); F32 getAgentHUDTargetZoom(); + void resetCameraZoomFraction(); + F32 getCurrentCameraZoomFraction() { return mCameraZoomFraction; } + //-------------------------------------------------------------------- // Pan //-------------------------------------------------------------------- public: void cameraPanIn(const F32 meters); void cameraPanLeft(const F32 meters); - void cameraPanUp(const F32 meters); - + void cameraPanUp(const F32 meters); + void resetCameraPan(); + void resetPanDiff(); //-------------------------------------------------------------------- // View //-------------------------------------------------------------------- @@ -362,6 +384,9 @@ private: F32 mOrbitInKey; F32 mOrbitOutKey; + F32 mOrbitAroundRadians; + F32 mOrbitOverAngle; + //-------------------------------------------------------------------- // Pan //-------------------------------------------------------------------- @@ -389,6 +414,8 @@ private: F32 mPanInKey; F32 mPanOutKey; + LLVector3d mPanFocusDiff; + /** Keys ** ** *******************************************************************************/ |