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
f04c2a78
Commit
f04c2a78
authored
11 years ago
by
Jonathan Yap
Browse files
Options
Downloads
Patches
Plain Diff
STORM-1981 Make pulse operate properly in both directions.
Move duplicated common code into its own function.
parent
6b1d835f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/newview/lltracker.cpp
+80
-122
80 additions, 122 deletions
indra/newview/lltracker.cpp
indra/newview/lltracker.h
+2
-0
2 additions, 0 deletions
indra/newview/lltracker.h
indra/newview/skins/default/colors.xml
+3
-0
3 additions, 0 deletions
indra/newview/skins/default/colors.xml
with
85 additions
and
122 deletions
indra/newview/lltracker.cpp
+
80
−
122
View file @
f04c2a78
...
@@ -167,6 +167,7 @@ void LLTracker::render3D()
...
@@ -167,6 +167,7 @@ void LLTracker::render3D()
}
}
static
LLUIColor
map_track_color
=
LLUIColorTable
::
instance
().
getColor
(
"MapTrackColor"
,
LLColor4
::
white
);
static
LLUIColor
map_track_color
=
LLUIColorTable
::
instance
().
getColor
(
"MapTrackColor"
,
LLColor4
::
white
);
static
LLUIColor
map_track_color_under
=
LLUIColorTable
::
instance
().
getColor
(
"MapTrackColorUnder"
,
LLColor4
::
white
);
// Arbitary location beacon
// Arbitary location beacon
if
(
instance
()
->
mIsTrackingLocation
)
if
(
instance
()
->
mIsTrackingLocation
)
...
@@ -187,7 +188,7 @@ void LLTracker::render3D()
...
@@ -187,7 +188,7 @@ void LLTracker::render3D()
}
}
else
else
{
{
renderBeacon
(
instance
()
->
mTrackedPositionGlobal
,
map_track_color
,
renderBeacon
(
instance
()
->
mTrackedPositionGlobal
,
map_track_color
,
map_track_color_under
,
instance
()
->
mBeaconText
,
instance
()
->
mTrackedLocationName
);
instance
()
->
mBeaconText
,
instance
()
->
mTrackedLocationName
);
}
}
}
}
...
@@ -229,7 +230,7 @@ void LLTracker::render3D()
...
@@ -229,7 +230,7 @@ void LLTracker::render3D()
// and back again
// and back again
instance
()
->
mHasReachedLandmark
=
FALSE
;
instance
()
->
mHasReachedLandmark
=
FALSE
;
}
}
renderBeacon
(
instance
()
->
mTrackedPositionGlobal
,
map_track_color
,
renderBeacon
(
instance
()
->
mTrackedPositionGlobal
,
map_track_color
,
map_track_color_under
,
instance
()
->
mBeaconText
,
instance
()
->
mTrackedLandmarkName
);
instance
()
->
mBeaconText
,
instance
()
->
mTrackedLandmarkName
);
}
}
}
}
...
@@ -258,7 +259,7 @@ void LLTracker::render3D()
...
@@ -258,7 +259,7 @@ void LLTracker::render3D()
}
}
else
else
{
{
renderBeacon
(
av_tracker
.
getGlobalPos
(),
map_track_color
,
renderBeacon
(
av_tracker
.
getGlobalPos
(),
map_track_color
,
map_track_color_under
,
instance
()
->
mBeaconText
,
av_tracker
.
getName
()
);
instance
()
->
mBeaconText
,
av_tracker
.
getName
()
);
}
}
}
}
...
@@ -412,7 +413,7 @@ const std::string& LLTracker::getTrackedLocationName()
...
@@ -412,7 +413,7 @@ const std::string& LLTracker::getTrackedLocationName()
return
instance
()
->
mTrackedLocationName
;
return
instance
()
->
mTrackedLocationName
;
}
}
F32
pulse_func
(
F32
t
,
F32
z
,
bool
tracking_avatar
)
F32
pulse_func
(
F32
t
,
F32
z
,
bool
tracking_avatar
,
std
::
string
direction
)
{
{
if
(
!
LLTracker
::
sCheesyBeacon
)
if
(
!
LLTracker
::
sCheesyBeacon
)
{
{
...
@@ -420,7 +421,7 @@ F32 pulse_func(F32 t, F32 z, bool tracking_avatar)
...
@@ -420,7 +421,7 @@ F32 pulse_func(F32 t, F32 z, bool tracking_avatar)
}
}
t
*=
F_PI
;
t
*=
F_PI
;
if
(
tracking_avatar
)
if
(
"DOWN"
==
direction
)
{
{
z
+=
t
*
64.
f
-
256.
f
;
z
+=
t
*
64.
f
-
256.
f
;
}
}
...
@@ -481,10 +482,79 @@ void draw_shockwave(F32 center_z, F32 t, S32 steps, LLColor4 color)
...
@@ -481,10 +482,79 @@ void draw_shockwave(F32 center_z, F32 t, S32 steps, LLColor4 color)
gGL
.
end
();
gGL
.
end
();
}
}
void
LLTracker
::
drawBeacon
(
LLVector3
pos_agent
,
std
::
string
direction
,
LLColor4
fogged_color
,
F32
dist
)
{
const
U32
BEACON_VERTS
=
256
;
F32
step
;
gGL
.
matrixMode
(
LLRender
::
MM_MODELVIEW
);
gGL
.
pushMatrix
();
if
(
"DOWN"
==
direction
)
{
gGL
.
translatef
(
pos_agent
.
mV
[
0
],
pos_agent
.
mV
[
1
],
pos_agent
.
mV
[
2
]);
draw_shockwave
(
1024.
f
,
gRenderStartTime
.
getElapsedTimeF32
(),
32
,
fogged_color
);
step
=
(
5020.0
f
-
pos_agent
.
mV
[
2
])
/
BEACON_VERTS
;
}
else
{
gGL
.
translatef
(
pos_agent
.
mV
[
0
],
pos_agent
.
mV
[
1
],
0
);
step
=
pos_agent
.
mV
[
2
]
/
BEACON_VERTS
;
}
gGL
.
color4fv
(
fogged_color
.
mV
);
LLVector3
x_axis
=
LLViewerCamera
::
getInstance
()
->
getLeftAxis
();
F32
t
=
gRenderStartTime
.
getElapsedTimeF32
();
F32
dr
=
dist
/
LLViewerCamera
::
getInstance
()
->
getFar
();
for
(
U32
i
=
0
;
i
<
BEACON_VERTS
;
i
++
)
{
F32
x
=
x_axis
.
mV
[
0
];
F32
y
=
x_axis
.
mV
[
1
];
F32
z
=
i
*
step
;
F32
z_next
=
(
i
+
1
)
*
step
;
bool
tracking_avatar
=
getTrackingStatus
()
==
TRACKING_AVATAR
;
F32
a
=
pulse_func
(
t
,
z
,
tracking_avatar
,
direction
);
F32
an
=
pulse_func
(
t
,
z_next
,
tracking_avatar
,
direction
);
LLColor4
c_col
=
fogged_color
+
LLColor4
(
a
,
a
,
a
,
a
);
LLColor4
col_next
=
fogged_color
+
LLColor4
(
an
,
an
,
an
,
an
);
LLColor4
col_edge
=
fogged_color
*
LLColor4
(
a
,
a
,
a
,
0.0
f
);
LLColor4
col_edge_next
=
fogged_color
*
LLColor4
(
an
,
an
,
an
,
0.0
f
);
a
*=
2.
f
;
a
+=
1.0
f
+
dr
;
an
*=
2.
f
;
an
+=
1.0
f
+
dr
;
gGL
.
begin
(
LLRender
::
TRIANGLE_STRIP
);
gGL
.
color4fv
(
col_edge
.
mV
);
gGL
.
vertex3f
(
-
x
*
a
,
-
y
*
a
,
z
);
gGL
.
color4fv
(
col_edge_next
.
mV
);
gGL
.
vertex3f
(
-
x
*
an
,
-
y
*
an
,
z_next
);
gGL
.
color4fv
(
c_col
.
mV
);
gGL
.
vertex3f
(
0
,
0
,
z
);
gGL
.
color4fv
(
col_next
.
mV
);
gGL
.
vertex3f
(
0
,
0
,
z_next
);
gGL
.
color4fv
(
col_edge
.
mV
);
gGL
.
vertex3f
(
x
*
a
,
y
*
a
,
z
);
gGL
.
color4fv
(
col_edge_next
.
mV
);
gGL
.
vertex3f
(
x
*
an
,
y
*
an
,
z_next
);
gGL
.
end
();
}
gGL
.
popMatrix
();
}
// static
// static
void
LLTracker
::
renderBeacon
(
LLVector3d
pos_global
,
void
LLTracker
::
renderBeacon
(
LLVector3d
pos_global
,
const
LLColor4
&
color
,
const
LLColor4
&
color
,
const
LLColor4
&
color_under
,
LLHUDText
*
hud_textp
,
LLHUDText
*
hud_textp
,
const
std
::
string
&
label
)
const
std
::
string
&
label
)
{
{
...
@@ -504,11 +574,11 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
...
@@ -504,11 +574,11 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
}
}
LLColor4
fogged_color
=
color_frac
*
color
+
(
1
-
color_frac
)
*
gSky
.
getFogColor
();
LLColor4
fogged_color
=
color_frac
*
color
+
(
1
-
color_frac
)
*
gSky
.
getFogColor
();
LLColor4
under_colo
r
=
color_frac
*
LLC
olor
4
::
blue
+
(
1
-
color_frac
)
*
gSky
.
getFogColor
();
LLColor4
fogged_color_unde
r
=
color_frac
*
c
olor
_under
+
(
1
-
color_frac
)
*
gSky
.
getFogColor
();
F32
FADE_DIST
=
3.
f
;
F32
FADE_DIST
=
3.
f
;
fogged_color
.
mV
[
3
]
=
llmax
(
0.2
f
,
llmin
(
0.5
f
,(
dist
-
FADE_DIST
)
/
FADE_DIST
));
fogged_color
.
mV
[
3
]
=
llmax
(
0.2
f
,
llmin
(
0.5
f
,(
dist
-
FADE_DIST
)
/
FADE_DIST
));
under_colo
r
.
mV
[
3
]
=
llmax
(
0.2
f
,
llmin
(
0.5
f
,(
dist
-
FADE_DIST
)
/
FADE_DIST
));
fogged_color_unde
r
.
mV
[
3
]
=
llmax
(
0.2
f
,
llmin
(
0.5
f
,(
dist
-
FADE_DIST
)
/
FADE_DIST
));
LLVector3
pos_agent
=
gAgent
.
getPosAgentFromGlobal
(
pos_global
);
LLVector3
pos_agent
=
gAgent
.
getPosAgentFromGlobal
(
pos_global
);
...
@@ -517,120 +587,8 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
...
@@ -517,120 +587,8 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
LLGLDisable
cull_face
(
GL_CULL_FACE
);
LLGLDisable
cull_face
(
GL_CULL_FACE
);
LLGLDepthTest
gls_depth
(
GL_TRUE
,
GL_FALSE
);
LLGLDepthTest
gls_depth
(
GL_TRUE
,
GL_FALSE
);
gGL
.
matrixMode
(
LLRender
::
MM_MODELVIEW
);
LLTracker
::
drawBeacon
(
pos_agent
,
"DOWN"
,
fogged_color
,
dist
);
gGL
.
pushMatrix
();
LLTracker
::
drawBeacon
(
pos_agent
,
"UP"
,
fogged_color_under
,
dist
);
{
gGL
.
translatef
(
pos_agent
.
mV
[
0
],
pos_agent
.
mV
[
1
],
pos_agent
.
mV
[
2
]);
draw_shockwave
(
1024.
f
,
gRenderStartTime
.
getElapsedTimeF32
(),
32
,
fogged_color
);
gGL
.
color4fv
(
fogged_color
.
mV
);
const
U32
BEACON_VERTS
=
256
;
const
F32
step
=
(
5020.0
f
-
pos_agent
.
mV
[
2
])
/
BEACON_VERTS
;
LLVector3
x_axis
=
LLViewerCamera
::
getInstance
()
->
getLeftAxis
();
F32
t
=
gRenderStartTime
.
getElapsedTimeF32
();
F32
dr
=
dist
/
LLViewerCamera
::
getInstance
()
->
getFar
();
for
(
U32
i
=
0
;
i
<
BEACON_VERTS
;
i
++
)
{
F32
x
=
x_axis
.
mV
[
0
];
F32
y
=
x_axis
.
mV
[
1
];
F32
z
=
i
*
step
;
F32
z_next
=
(
i
+
1
)
*
step
;
bool
tracking_avatar
=
getTrackingStatus
()
==
TRACKING_AVATAR
;
F32
a
=
pulse_func
(
t
,
z
,
tracking_avatar
);
F32
an
=
pulse_func
(
t
,
z_next
,
tracking_avatar
);
LLColor4
c_col
=
fogged_color
+
LLColor4
(
a
,
a
,
a
,
a
);
LLColor4
col_next
=
fogged_color
+
LLColor4
(
an
,
an
,
an
,
an
);
LLColor4
col_edge
=
fogged_color
*
LLColor4
(
a
,
a
,
a
,
0.0
f
);
LLColor4
col_edge_next
=
fogged_color
*
LLColor4
(
an
,
an
,
an
,
0.0
f
);
a
*=
2.
f
;
a
+=
1.0
f
+
dr
;
an
*=
2.
f
;
an
+=
1.0
f
+
dr
;
gGL
.
begin
(
LLRender
::
TRIANGLE_STRIP
);
gGL
.
color4fv
(
col_edge
.
mV
);
gGL
.
vertex3f
(
-
x
*
a
,
-
y
*
a
,
z
);
gGL
.
color4fv
(
col_edge_next
.
mV
);
gGL
.
vertex3f
(
-
x
*
an
,
-
y
*
an
,
z_next
);
gGL
.
color4fv
(
c_col
.
mV
);
gGL
.
vertex3f
(
0
,
0
,
z
);
gGL
.
color4fv
(
col_next
.
mV
);
gGL
.
vertex3f
(
0
,
0
,
z_next
);
gGL
.
color4fv
(
col_edge
.
mV
);
gGL
.
vertex3f
(
x
*
a
,
y
*
a
,
z
);
gGL
.
color4fv
(
col_edge_next
.
mV
);
gGL
.
vertex3f
(
x
*
an
,
y
*
an
,
z_next
);
gGL
.
end
();
}
}
gGL
.
popMatrix
();
gGL
.
pushMatrix
();
{
gGL
.
translatef
(
pos_agent
.
mV
[
0
],
pos_agent
.
mV
[
1
],
0
);
// draw_shockwave(1024.f, gRenderStartTime.getElapsedTimeF32(), 32, under_color);
gGL
.
color4fv
(
under_color
.
mV
);
const
U32
BEACON_VERTS
=
256
;
const
F32
step
=
pos_agent
.
mV
[
2
]
/
BEACON_VERTS
;
LLVector3
x_axis
=
LLViewerCamera
::
getInstance
()
->
getLeftAxis
();
F32
t
=
gRenderStartTime
.
getElapsedTimeF32
();
F32
dr
=
dist
/
LLViewerCamera
::
getInstance
()
->
getFar
();
for
(
U32
i
=
0
;
i
<
BEACON_VERTS
;
i
++
)
{
F32
x
=
x_axis
.
mV
[
0
];
F32
y
=
x_axis
.
mV
[
1
];
F32
z
=
i
*
step
;
F32
z_next
=
(
i
+
1
)
*
step
;
bool
tracking_avatar
=
getTrackingStatus
()
==
TRACKING_AVATAR
;
F32
a
=
pulse_func
(
t
,
z
,
tracking_avatar
);
F32
an
=
pulse_func
(
t
,
z_next
,
tracking_avatar
);
LLColor4
c_col
=
under_color
+
LLColor4
(
a
,
a
,
a
,
a
);
LLColor4
col_next
=
under_color
+
LLColor4
(
an
,
an
,
an
,
an
);
LLColor4
col_edge
=
under_color
*
LLColor4
(
a
,
a
,
a
,
0.0
f
);
LLColor4
col_edge_next
=
under_color
*
LLColor4
(
an
,
an
,
an
,
0.0
f
);
a
*=
2.
f
;
a
+=
1.0
f
+
dr
;
an
*=
2.
f
;
an
+=
1.0
f
+
dr
;
gGL
.
begin
(
LLRender
::
TRIANGLE_STRIP
);
gGL
.
color4fv
(
col_edge
.
mV
);
gGL
.
vertex3f
(
-
x
*
a
,
-
y
*
a
,
z
);
gGL
.
color4fv
(
col_edge_next
.
mV
);
gGL
.
vertex3f
(
-
x
*
an
,
-
y
*
an
,
z_next
);
gGL
.
color4fv
(
c_col
.
mV
);
gGL
.
vertex3f
(
0
,
0
,
z
);
gGL
.
color4fv
(
col_next
.
mV
);
gGL
.
vertex3f
(
0
,
0
,
z_next
);
gGL
.
color4fv
(
col_edge
.
mV
);
gGL
.
vertex3f
(
x
*
a
,
y
*
a
,
z
);
gGL
.
color4fv
(
col_edge_next
.
mV
);
gGL
.
vertex3f
(
x
*
an
,
y
*
an
,
z_next
);
gGL
.
end
();
}
}
gGL
.
popMatrix
();
std
::
string
text
;
std
::
string
text
;
text
=
llformat
(
"%.0f m"
,
to_vec
.
magVec
());
text
=
llformat
(
"%.0f m"
,
to_vec
.
magVec
());
...
...
This diff is collapsed.
Click to expand it.
indra/newview/lltracker.h
+
2
−
0
View file @
f04c2a78
...
@@ -108,8 +108,10 @@ class LLTracker
...
@@ -108,8 +108,10 @@ class LLTracker
LLTracker
();
LLTracker
();
~
LLTracker
();
~
LLTracker
();
static
void
drawBeacon
(
LLVector3
pos_agent
,
std
::
string
direction
,
LLColor4
fogged_color
,
F32
dist
);
static
void
renderBeacon
(
LLVector3d
pos_global
,
static
void
renderBeacon
(
LLVector3d
pos_global
,
const
LLColor4
&
color
,
const
LLColor4
&
color
,
const
LLColor4
&
color_under
,
LLHUDText
*
hud_textp
,
LLHUDText
*
hud_textp
,
const
std
::
string
&
label
);
const
std
::
string
&
label
);
...
...
This diff is collapsed.
Click to expand it.
indra/newview/skins/default/colors.xml
+
3
−
0
View file @
f04c2a78
...
@@ -510,6 +510,9 @@
...
@@ -510,6 +510,9 @@
<color
<color
name=
"MapTrackColor"
name=
"MapTrackColor"
reference=
"Red"
/>
reference=
"Red"
/>
<color
name=
"MapTrackColorUnder"
reference=
"Blue"
/>
<color
<color
name=
"MapTrackDisabledColor"
name=
"MapTrackDisabledColor"
value=
"0.5 0 0 1"
/>
value=
"0.5 0 0 1"
/>
...
...
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