Added option to disable LLWind

This commit is contained in:
Hazim Gazov
2010-04-17 00:16:35 -03:00
parent c432f3094f
commit 0677acc8e3
10 changed files with 208 additions and 147 deletions

View File

@@ -12692,5 +12692,16 @@
<key>Value</key> <key>Value</key>
<integer>0</integer> <integer>0</integer>
</map> </map>
<key>UseLLWind</key>
<map>
<key>Comment</key>
<string>Disables LLWind's methods and returns nothing if enabled (saves FPS)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map> </map>
</llsd> </llsd>

View File

@@ -394,6 +394,17 @@
max_attachment_offset="2.0" max_attachment_offset="2.0"
visible_in_first_person="true" /> visible_in_first_person="true" />
<attachment_point
id="128"
group="8"
name="Jay Griff"
joint="mScreen"
position="0 0 0"
rotation="0 0 0"
hud="true"
max_attachment_offset="0.0"
visible_in_first_person="true" />
<param <param
id="32" id="32"
group="1" group="1"

View File

@@ -191,6 +191,7 @@
#include "llagentlanguage.h" #include "llagentlanguage.h"
#include "llsocks5.h" #include "llsocks5.h"
#include "jcfloaterareasearch.h" #include "jcfloaterareasearch.h"
#include "llwind.h"
#if LL_WINDOWS #if LL_WINDOWS
#include "llwindebug.h" #include "llwindebug.h"
@@ -2434,6 +2435,7 @@ bool idle_startup()
//--------------------------------------------------------------------- //---------------------------------------------------------------------
if (STATE_WORLD_INIT == LLStartUp::getStartupState()) if (STATE_WORLD_INIT == LLStartUp::getStartupState())
{ {
gUseLLWind = gSavedSettings.getBOOL("UseLLWind");
set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD);
display_startup(); display_startup();
// We should have an agent id by this point. // We should have an agent id by this point.

View File

@@ -131,6 +131,9 @@ BOOL LLToolBar::postBuild()
childSetAction("radar_list_btn", onClickRadarList, this); childSetAction("radar_list_btn", onClickRadarList, this);
childSetControlName("radar_list_btn", "RadarListBtnState"); childSetControlName("radar_list_btn", "RadarListBtnState");
childSetAction("fly_btn", onClickFly, this);
childSetControlName("fly_btn", "FlyBtnState");
childSetAction("sit_btn", onClickSit, this); childSetAction("sit_btn", onClickSit, this);
childSetControlName("sit_btn", "SitBtnState"); childSetControlName("sit_btn", "SitBtnState");

View File

@@ -347,7 +347,7 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
return TRUE; return TRUE;
} }
if (gSavedSettings.getBOOL("RenderAnimateTrees")) if (gSavedSettings.getBOOL("RenderAnimateTrees") && gUseLLWind)
{ {
F32 mass_inv; F32 mass_inv;
@@ -390,7 +390,7 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
} }
} }
if (!gSavedSettings.getBOOL("RenderAnimateTrees")) if (!gSavedSettings.getBOOL("RenderAnimateTrees") || !gUseLLWind)
{ {
if (mReferenceBuffer.isNull()) if (mReferenceBuffer.isNull())
{ {

View File

@@ -54,6 +54,7 @@
const F32 CLOUD_DIVERGENCE_COEF = 0.5f; const F32 CLOUD_DIVERGENCE_COEF = 0.5f;
BOOL gUseLLWind;
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@@ -104,7 +105,7 @@ void LLWind::init()
void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp) void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp)
{ {
if (!mCloudDensityp) if (!mCloudDensityp || !gUseLLWind)
{ {
return; return;
} }
@@ -181,172 +182,200 @@ void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp)
LLVector3 LLWind::getAverage() LLVector3 LLWind::getAverage()
{ {
// Returns in average_wind the average wind velocity if(gUseLLWind)
LLVector3 average(0.0f, 0.0f, 0.0f);
S32 i, grid_count;
grid_count = mSize * mSize;
for (i = 0; i < grid_count; i++)
{ {
average.mV[VX] += mVelX[i]; // Returns in average_wind the average wind velocity
average.mV[VY] += mVelY[i]; LLVector3 average(0.0f, 0.0f, 0.0f);
} S32 i, grid_count;
grid_count = mSize * mSize;
for (i = 0; i < grid_count; i++)
{
average.mV[VX] += mVelX[i];
average.mV[VY] += mVelY[i];
}
average *= 1.f/((F32)(grid_count)) * WIND_SCALE_HACK; average *= 1.f/((F32)(grid_count)) * WIND_SCALE_HACK;
return average; return average;
}
else
{
return LLVector3(0, 0, 0);
}
} }
LLVector3 LLWind::getVelocityNoisy(const LLVector3 &pos_region, const F32 dim) LLVector3 LLWind::getVelocityNoisy(const LLVector3 &pos_region, const F32 dim)
{ {
// Resolve a value, using fractal summing to perturb the returned value if(gUseLLWind)
LLVector3 r_val(0,0,0);
F32 norm = 1.0f;
if (dim == 8)
{ {
norm = 1.875; // Resolve a value, using fractal summing to perturb the returned value
} LLVector3 r_val(0,0,0);
else if (dim == 4) F32 norm = 1.0f;
{ if (dim == 8)
norm = 1.75; {
} norm = 1.875;
else if (dim == 2) }
{ else if (dim == 4)
norm = 1.5; {
} norm = 1.75;
}
else if (dim == 2)
{
norm = 1.5;
}
F32 temp_dim = dim; F32 temp_dim = dim;
while (temp_dim >= 1.0) while (temp_dim >= 1.0)
{ {
LLVector3 pos_region_scaled(pos_region * temp_dim); LLVector3 pos_region_scaled(pos_region * temp_dim);
r_val += getVelocity(pos_region_scaled) * (1.0f/temp_dim); r_val += getVelocity(pos_region_scaled) * (1.0f/temp_dim);
temp_dim /= 2.0; temp_dim /= 2.0;
}
return r_val * (1.0f/norm) * WIND_SCALE_HACK;
}
else
{
return LLVector3(0, 0, 0);
} }
return r_val * (1.0f/norm) * WIND_SCALE_HACK;
} }
LLVector3 LLWind::getVelocity(const LLVector3 &pos_region) LLVector3 LLWind::getVelocity(const LLVector3 &pos_region)
{ {
llassert(mSize == 16); if(gUseLLWind)
// Resolves value of wind at a location relative to SW corner of region {
// llassert(mSize == 16);
// Returns wind magnitude in X,Y components of vector3 // Resolves value of wind at a location relative to SW corner of region
LLVector3 r_val; //
F32 dx,dy; // Returns wind magnitude in X,Y components of vector3
S32 k; LLVector3 r_val;
F32 dx,dy;
S32 k;
LLVector3 pos_clamped_region(pos_region); LLVector3 pos_clamped_region(pos_region);
F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters();
if (pos_clamped_region.mV[VX] < 0.f) if (pos_clamped_region.mV[VX] < 0.f)
{ {
pos_clamped_region.mV[VX] = 0.f; pos_clamped_region.mV[VX] = 0.f;
} }
else if (pos_clamped_region.mV[VX] >= region_width_meters) else if (pos_clamped_region.mV[VX] >= region_width_meters)
{ {
pos_clamped_region.mV[VX] = (F32) fmod(pos_clamped_region.mV[VX], region_width_meters); pos_clamped_region.mV[VX] = (F32) fmod(pos_clamped_region.mV[VX], region_width_meters);
} }
if (pos_clamped_region.mV[VY] < 0.f) if (pos_clamped_region.mV[VY] < 0.f)
{ {
pos_clamped_region.mV[VY] = 0.f; pos_clamped_region.mV[VY] = 0.f;
} }
else if (pos_clamped_region.mV[VY] >= region_width_meters) else if (pos_clamped_region.mV[VY] >= region_width_meters)
{ {
pos_clamped_region.mV[VY] = (F32) fmod(pos_clamped_region.mV[VY], region_width_meters); pos_clamped_region.mV[VY] = (F32) fmod(pos_clamped_region.mV[VY], region_width_meters);
} }
S32 i = llfloor(pos_clamped_region.mV[VX] * mSize / region_width_meters); S32 i = llfloor(pos_clamped_region.mV[VX] * mSize / region_width_meters);
S32 j = llfloor(pos_clamped_region.mV[VY] * mSize / region_width_meters); S32 j = llfloor(pos_clamped_region.mV[VY] * mSize / region_width_meters);
k = i + j*mSize; k = i + j*mSize;
dx = ((pos_clamped_region.mV[VX] * mSize / region_width_meters) - (F32) i); dx = ((pos_clamped_region.mV[VX] * mSize / region_width_meters) - (F32) i);
dy = ((pos_clamped_region.mV[VY] * mSize / region_width_meters) - (F32) j); dy = ((pos_clamped_region.mV[VY] * mSize / region_width_meters) - (F32) j);
if ((i < mSize-1) && (j < mSize-1)) if ((i < mSize-1) && (j < mSize-1))
{ {
// Interior points, no edges // Interior points, no edges
r_val.mV[VX] = mVelX[k]*(1.0f - dx)*(1.0f - dy) + r_val.mV[VX] = mVelX[k]*(1.0f - dx)*(1.0f - dy) +
mVelX[k + 1]*dx*(1.0f - dy) + mVelX[k + 1]*dx*(1.0f - dy) +
mVelX[k + mSize]*dy*(1.0f - dx) + mVelX[k + mSize]*dy*(1.0f - dx) +
mVelX[k + mSize + 1]*dx*dy; mVelX[k + mSize + 1]*dx*dy;
r_val.mV[VY] = mVelY[k]*(1.0f - dx)*(1.0f - dy) + r_val.mV[VY] = mVelY[k]*(1.0f - dx)*(1.0f - dy) +
mVelY[k + 1]*dx*(1.0f - dy) + mVelY[k + 1]*dx*(1.0f - dy) +
mVelY[k + mSize]*dy*(1.0f - dx) + mVelY[k + mSize]*dy*(1.0f - dx) +
mVelY[k + mSize + 1]*dx*dy; mVelY[k + mSize + 1]*dx*dy;
} }
else else
{ {
r_val.mV[VX] = mVelX[k]; r_val.mV[VX] = mVelX[k];
r_val.mV[VY] = mVelY[k]; r_val.mV[VY] = mVelY[k];
} }
r_val.mV[VZ] = 0.f; r_val.mV[VZ] = 0.f;
return r_val * WIND_SCALE_HACK; return r_val * WIND_SCALE_HACK;
}
else
{
return LLVector3(0, 0, 0);
}
} }
LLVector3 LLWind::getCloudVelocity(const LLVector3 &pos_region) LLVector3 LLWind::getCloudVelocity(const LLVector3 &pos_region)
{ {
llassert(mSize == 16); if(gUseLLWind)
// Resolves value of wind at a location relative to SW corner of region {
// llassert(mSize == 16);
// Returns wind magnitude in X,Y components of vector3 // Resolves value of wind at a location relative to SW corner of region
LLVector3 r_val; //
F32 dx,dy; // Returns wind magnitude in X,Y components of vector3
S32 k; LLVector3 r_val;
F32 dx,dy;
S32 k;
LLVector3 pos_clamped_region(pos_region); LLVector3 pos_clamped_region(pos_region);
F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters();
if (pos_clamped_region.mV[VX] < 0.f) if (pos_clamped_region.mV[VX] < 0.f)
{ {
pos_clamped_region.mV[VX] = 0.f; pos_clamped_region.mV[VX] = 0.f;
} }
else if (pos_clamped_region.mV[VX] >= region_width_meters) else if (pos_clamped_region.mV[VX] >= region_width_meters)
{ {
pos_clamped_region.mV[VX] = (F32) fmod(pos_clamped_region.mV[VX], region_width_meters); pos_clamped_region.mV[VX] = (F32) fmod(pos_clamped_region.mV[VX], region_width_meters);
} }
if (pos_clamped_region.mV[VY] < 0.f) if (pos_clamped_region.mV[VY] < 0.f)
{ {
pos_clamped_region.mV[VY] = 0.f; pos_clamped_region.mV[VY] = 0.f;
} }
else if (pos_clamped_region.mV[VY] >= region_width_meters) else if (pos_clamped_region.mV[VY] >= region_width_meters)
{ {
pos_clamped_region.mV[VY] = (F32) fmod(pos_clamped_region.mV[VY], region_width_meters); pos_clamped_region.mV[VY] = (F32) fmod(pos_clamped_region.mV[VY], region_width_meters);
} }
S32 i = llfloor(pos_clamped_region.mV[VX] * mSize / region_width_meters); S32 i = llfloor(pos_clamped_region.mV[VX] * mSize / region_width_meters);
S32 j = llfloor(pos_clamped_region.mV[VY] * mSize / region_width_meters); S32 j = llfloor(pos_clamped_region.mV[VY] * mSize / region_width_meters);
k = i + j*mSize; k = i + j*mSize;
dx = ((pos_clamped_region.mV[VX] * mSize / region_width_meters) - (F32) i); dx = ((pos_clamped_region.mV[VX] * mSize / region_width_meters) - (F32) i);
dy = ((pos_clamped_region.mV[VY] * mSize / region_width_meters) - (F32) j); dy = ((pos_clamped_region.mV[VY] * mSize / region_width_meters) - (F32) j);
if ((i < mSize-1) && (j < mSize-1)) if ((i < mSize-1) && (j < mSize-1))
{ {
// Interior points, no edges // Interior points, no edges
r_val.mV[VX] = mCloudVelX[k]*(1.0f - dx)*(1.0f - dy) + r_val.mV[VX] = mCloudVelX[k]*(1.0f - dx)*(1.0f - dy) +
mCloudVelX[k + 1]*dx*(1.0f - dy) + mCloudVelX[k + 1]*dx*(1.0f - dy) +
mCloudVelX[k + mSize]*dy*(1.0f - dx) + mCloudVelX[k + mSize]*dy*(1.0f - dx) +
mCloudVelX[k + mSize + 1]*dx*dy; mCloudVelX[k + mSize + 1]*dx*dy;
r_val.mV[VY] = mCloudVelY[k]*(1.0f - dx)*(1.0f - dy) + r_val.mV[VY] = mCloudVelY[k]*(1.0f - dx)*(1.0f - dy) +
mCloudVelY[k + 1]*dx*(1.0f - dy) + mCloudVelY[k + 1]*dx*(1.0f - dy) +
mCloudVelY[k + mSize]*dy*(1.0f - dx) + mCloudVelY[k + mSize]*dy*(1.0f - dx) +
mCloudVelY[k + mSize + 1]*dx*dy; mCloudVelY[k + mSize + 1]*dx*dy;
} }
else else
{ {
r_val.mV[VX] = mCloudVelX[k]; r_val.mV[VX] = mCloudVelX[k];
r_val.mV[VY] = mCloudVelY[k]; r_val.mV[VY] = mCloudVelY[k];
} }
r_val.mV[VZ] = 0.f; r_val.mV[VZ] = 0.f;
return r_val * WIND_SCALE_HACK; return r_val * WIND_SCALE_HACK;
}
else
{
return LLVector3(0, 0, 0);
}
} }

View File

@@ -42,6 +42,7 @@ class LLVector3;
class LLBitPack; class LLBitPack;
class LLGroupHeader; class LLGroupHeader;
extern BOOL gUseLLWind;
class LLWind class LLWind
{ {
@@ -58,6 +59,7 @@ public:
void setCloudDensityPointer(F32 *densityp); void setCloudDensityPointer(F32 *densityp);
void setOriginGlobal(const LLVector3d &origin_global); void setOriginGlobal(const LLVector3d &origin_global);
private: private:
S32 mSize; S32 mSize;
F32 * mVelX; F32 * mVelX;

View File

@@ -26,12 +26,13 @@
label_selected="Radar" left="0" name="radar_list_btn" label_selected="Radar" left="0" name="radar_list_btn"
tool_tip="View a list of nearby avatars." tool_tip="View a list of nearby avatars."
width="50" follows="left|right" user_resize="false"/> width="50" follows="left|right" user_resize="false"/>
<button bottom="0" font="SansSerif" height="24" label="Snapshot" left="0" <button bottom="0" font="SansSerif" height="24" label="Fly"
image_overlay="icn_toolbar_snapshot.tga" image_overlay_alignment="left" image_overlay="icn_toolbar_fly.tga" image_overlay_alignment="left"
image_selected="toolbar_btn_selected.tga" image_selected="toolbar_btn_selected.tga"
image_unselected="toolbar_btn_enabled.tga" image_unselected="toolbar_btn_enabled.tga"
image_disabled="toolbar_btn_disabled.tga" scale_image="true" image_disabled="toolbar_btn_disabled.tga" scale_image="true"
name="snapshot_btn" tool_tip="Save a screen shot to disk or inventory." label_selected="Stop Flying" left="0" name="fly_btn"
tool_tip="Start flying. Use E/C or PgUp/PgDn to fly up and down."
width="50" follows="left|right" user_resize="false"/> width="50" follows="left|right" user_resize="false"/>
<button bottom="0" font="SansSerif" height="24" label="Search" left="0" <button bottom="0" font="SansSerif" height="24" label="Search" left="0"
image_overlay="icn_toolbar_search.tga" image_overlay_alignment="left" image_overlay="icn_toolbar_search.tga" image_overlay_alignment="left"

View File

@@ -740,11 +740,13 @@ class LinuxManifest(ViewerManifest):
try: try:
# --numeric-owner hides the username of the builder for # --numeric-owner hides the username of the builder for
# security etc. # security etc.
self.run_command("tar -C '%(dir)s' --numeric-owner -cjf " #I don't really care about this right now, disable it for a bit
"'%(inst_path)s.tar.bz2' %(inst_name)s" % { # self.run_command("tar -C '%(dir)s' --numeric-owner -cjf "
'dir': self.get_build_prefix(), # "'%(inst_path)s.tar.bz2' %(inst_name)s" % {
'inst_name': installer_name, # 'dir': self.get_build_prefix(),
'inst_path':self.build_path_of(installer_name)}) # 'inst_name': installer_name,
# 'inst_path':self.build_path_of(installer_name)})
print ''
finally: finally:
self.run_command("mv '%(inst)s' '%(dst)s'" % { self.run_command("mv '%(inst)s' '%(dst)s'" % {
'dst': self.get_dst_prefix(), 'dst': self.get_dst_prefix(),