Skip to content
Snippets Groups Projects
Commit 6b1d835f authored by Jonathan Yap's avatar Jonathan Yap
Browse files

STORM-1981 Rough initial changes for evaluation purposes.

parent ea1e1b09
Branches
Tags
No related merge requests found
...@@ -674,6 +674,7 @@ Jonathan Yap ...@@ -674,6 +674,7 @@ Jonathan Yap
OPEN-161 OPEN-161
STORM-1953 STORM-1953
STORM-1957 STORM-1957
STORM-1981
Kadah Coba Kadah Coba
STORM-1060 STORM-1060
STORM-1843 STORM-1843
......
...@@ -412,7 +412,7 @@ const std::string& LLTracker::getTrackedLocationName() ...@@ -412,7 +412,7 @@ const std::string& LLTracker::getTrackedLocationName()
return instance()->mTrackedLocationName; return instance()->mTrackedLocationName;
} }
F32 pulse_func(F32 t, F32 z) F32 pulse_func(F32 t, F32 z, bool tracking_avatar)
{ {
if (!LLTracker::sCheesyBeacon) if (!LLTracker::sCheesyBeacon)
{ {
...@@ -420,7 +420,14 @@ F32 pulse_func(F32 t, F32 z) ...@@ -420,7 +420,14 @@ F32 pulse_func(F32 t, F32 z)
} }
t *= F_PI; t *= F_PI;
if (tracking_avatar)
{
z += t*64.f - 256.f;
}
else
{
z -= t*64.f - 256.f; z -= t*64.f - 256.f;
}
F32 a = cosf(z*F_PI/512.f)*10.0f; F32 a = cosf(z*F_PI/512.f)*10.0f;
a = llmax(a, 9.9f); a = llmax(a, 9.9f);
...@@ -497,9 +504,11 @@ void LLTracker::renderBeacon(LLVector3d pos_global, ...@@ -497,9 +504,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_color = color_frac * LLColor4::blue + (1 - color_frac) * gSky.getFogColor();
F32 FADE_DIST = 3.f; F32 FADE_DIST = 3.f;
fogged_color.mV[3] = llmax(0.2f, llmin(0.5f,(dist-FADE_DIST)/FADE_DIST)); fogged_color.mV[3] = llmax(0.2f, llmin(0.5f,(dist-FADE_DIST)/FADE_DIST));
under_color.mV[3] = llmax(0.2f, llmin(0.5f,(dist-FADE_DIST)/FADE_DIST));
LLVector3 pos_agent = gAgent.getPosAgentFromGlobal(pos_global); LLVector3 pos_agent = gAgent.getPosAgentFromGlobal(pos_global);
...@@ -508,7 +517,6 @@ void LLTracker::renderBeacon(LLVector3d pos_global, ...@@ -508,7 +517,6 @@ 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); gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.pushMatrix(); gGL.pushMatrix();
{ {
...@@ -518,7 +526,7 @@ void LLTracker::renderBeacon(LLVector3d pos_global, ...@@ -518,7 +526,7 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
gGL.color4fv(fogged_color.mV); gGL.color4fv(fogged_color.mV);
const U32 BEACON_VERTS = 256; const U32 BEACON_VERTS = 256;
const F32 step = 1024.0f/BEACON_VERTS; const F32 step = (5020.0f - pos_agent.mV[2]) / BEACON_VERTS;
LLVector3 x_axis = LLViewerCamera::getInstance()->getLeftAxis(); LLVector3 x_axis = LLViewerCamera::getInstance()->getLeftAxis();
F32 t = gRenderStartTime.getElapsedTimeF32(); F32 t = gRenderStartTime.getElapsedTimeF32();
...@@ -532,8 +540,9 @@ void LLTracker::renderBeacon(LLVector3d pos_global, ...@@ -532,8 +540,9 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
F32 z = i * step; F32 z = i * step;
F32 z_next = (i+1)*step; F32 z_next = (i+1)*step;
F32 a = pulse_func(t, z); bool tracking_avatar = getTrackingStatus() == TRACKING_AVATAR;
F32 an = pulse_func(t, z_next); 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 c_col = fogged_color + LLColor4(a,a,a,a);
LLColor4 col_next = fogged_color + LLColor4(an,an,an,an); LLColor4 col_next = fogged_color + LLColor4(an,an,an,an);
...@@ -561,7 +570,63 @@ void LLTracker::renderBeacon(LLVector3d pos_global, ...@@ -561,7 +570,63 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
gGL.vertex3f(x*a,y*a,z); gGL.vertex3f(x*a,y*a,z);
gGL.color4fv(col_edge_next.mV); gGL.color4fv(col_edge_next.mV);
gGL.vertex3f(x*an,y*an,z_next); 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.0f);
LLColor4 col_edge_next = under_color * LLColor4(an,an,an,0.0f);
a *= 2.f;
a += 1.0f+dr;
an *= 2.f;
an += 1.0f+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.end();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment