Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Black Dragon Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Logue
Black Dragon Viewer
Commits
fcbccd59
Commit
fcbccd59
authored
5 years ago
by
maxim_productengine
Browse files
Options
Downloads
Patches
Plain Diff
SL-12424 Allow saving offsets based on current camera position
parent
65ea5990
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/newview/llagentcamera.cpp
+16
-0
16 additions, 0 deletions
indra/newview/llagentcamera.cpp
indra/newview/llagentcamera.h
+4
-0
4 additions, 0 deletions
indra/newview/llagentcamera.h
indra/newview/llfloatersavecamerapreset.cpp
+6
-0
6 additions, 0 deletions
indra/newview/llfloatersavecamerapreset.cpp
with
26 additions
and
0 deletions
indra/newview/llagentcamera.cpp
+
16
−
0
View file @
fcbccd59
...
...
@@ -1985,6 +1985,22 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
}
LLVector3
LLAgentCamera
::
getCurrentCameraOffset
()
{
LLVector3
camera_offset
=
(
LLViewerCamera
::
getInstance
()
->
getOrigin
()
-
gAgentAvatarp
->
getRenderPosition
()
-
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
,
""
);
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llagentcamera.h
+
4
−
0
View file @
fcbccd59
...
...
@@ -117,6 +117,10 @@ class LLAgentCamera
/** 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 */
F32
getCameraMaxZoomDistance
();
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llfloatersavecamerapreset.cpp
+
6
−
0
View file @
fcbccd59
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment