Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
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
Alchemy Viewer
Alchemy Viewer
Commits
09add95e
Commit
09add95e
authored
15 years ago
by
Richard Linden
Browse files
Options
Downloads
Patches
Plain Diff
EXT-6307 World Map: field of view triangle rotates
reviewed by Leyla
parent
406b595e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/llworldmapview.cpp
+14
-6
14 additions, 6 deletions
indra/newview/llworldmapview.cpp
with
14 additions
and
6 deletions
indra/newview/llworldmapview.cpp
+
14
−
6
View file @
09add95e
...
@@ -886,28 +886,36 @@ void LLWorldMapView::drawFrustum()
...
@@ -886,28 +886,36 @@ void LLWorldMapView::drawFrustum()
F32
half_width_meters
=
far_clip_meters
*
tan
(
horiz_fov
/
2
);
F32
half_width_meters
=
far_clip_meters
*
tan
(
horiz_fov
/
2
);
F32
half_width_pixels
=
half_width_meters
*
meters_to_pixels
;
F32
half_width_pixels
=
half_width_meters
*
meters_to_pixels
;
F32
ctr_x
=
getRect
().
getWidth
()
*
0.5
f
+
sPanX
;
F32
ctr_x
=
get
Local
Rect
().
getWidth
()
*
0.5
f
+
sPanX
;
F32
ctr_y
=
getRect
().
getHeight
()
*
0.5
f
+
sPanY
;
F32
ctr_y
=
get
Local
Rect
().
getHeight
()
*
0.5
f
+
sPanY
;
gGL
.
getTexUnit
(
0
)
->
unbind
(
LLTexUnit
::
TT_TEXTURE
);
gGL
.
getTexUnit
(
0
)
->
unbind
(
LLTexUnit
::
TT_TEXTURE
);
// Since we don't rotate the map, we have to rotate the frustum.
// Since we don't rotate the map, we have to rotate the frustum.
gGL
.
pushMatrix
();
gGL
.
pushMatrix
();
{
gGL
.
translatef
(
ctr_x
,
ctr_y
,
0
);
gGL
.
translatef
(
ctr_x
,
ctr_y
,
0
);
glRotatef
(
atan2
(
LLViewerCamera
::
getInstance
()
->
getAtAxis
().
mV
[
VX
],
LLViewerCamera
::
getInstance
()
->
getAtAxis
().
mV
[
VY
]
)
*
RAD_TO_DEG
,
0.
f
,
0.
f
,
-
1.
f
);
// Draw triangle with more alpha in far pixels to make it
// Draw triangle with more alpha in far pixels to make it
// fade out in distance.
// fade out in distance.
gGL
.
begin
(
LLRender
::
TRIANGLES
);
gGL
.
begin
(
LLRender
::
TRIANGLES
);
{
LLVector2
cam_lookat
(
LLViewerCamera
::
instance
().
getAtAxis
().
mV
[
VX
],
LLViewerCamera
::
instance
().
getAtAxis
().
mV
[
VY
]);
LLVector2
cam_left
(
LLViewerCamera
::
instance
().
getLeftAxis
().
mV
[
VX
],
LLViewerCamera
::
instance
().
getLeftAxis
().
mV
[
VY
]);
gGL
.
color4f
(
1.
f
,
1.
f
,
1.
f
,
0.25
f
);
gGL
.
color4f
(
1.
f
,
1.
f
,
1.
f
,
0.25
f
);
gGL
.
vertex2f
(
0
,
0
);
gGL
.
vertex2f
(
0
,
0
);
gGL
.
color4f
(
1.
f
,
1.
f
,
1.
f
,
0.02
f
);
gGL
.
color4f
(
1.
f
,
1.
f
,
1.
f
,
0.02
f
);
gGL
.
vertex2f
(
-
half_width_pixels
,
far_clip_pixels
);
gGL
.
color4f
(
1.
f
,
1.
f
,
1.
f
,
0.02
f
);
LLVector2
vert
=
cam_lookat
*
far_clip_pixels
+
cam_left
*
half_width_pixels
;
gGL
.
vertex2f
(
half_width_pixels
,
far_clip_pixels
);
gGL
.
vertex2f
(
vert
.
mV
[
VX
],
vert
.
mV
[
VY
]);
vert
=
cam_lookat
*
far_clip_pixels
-
cam_left
*
half_width_pixels
;
gGL
.
vertex2f
(
vert
.
mV
[
VX
],
vert
.
mV
[
VY
]);
}
gGL
.
end
();
gGL
.
end
();
}
gGL
.
popMatrix
();
gGL
.
popMatrix
();
}
}
...
...
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