public override double GetValue(double x, double y, double z)
{
System.Diagnostics.Debug.Assert(this.m_modules[0] != null);
System.Diagnostics.Debug.Assert(this.m_modules[1] != null);
System.Diagnostics.Debug.Assert(this.m_modules[2] != null);
double cv = this.m_modules[2].GetValue(x, y, z);
double a;
if (this.m_fallOff > 0.0)
{
if (cv < (this.m_min - this.m_fallOff))
{
return this.m_modules[0].GetValue(x, y, z);
}
else if (cv < (this.m_min + this.m_fallOff))
{
double lc = (this.m_min - this.m_fallOff);
double uc = (this.m_min + this.m_fallOff);
a = Utils.MapCubicSCurve((cv - lc) / (uc - lc));
return Utils.InterpolateLinear(this.m_modules[0].GetValue(x, y, z), this.m_modules[1].GetValue(x, y, z), a);
}
else if (cv < (this.m_max - this.m_fallOff))
{
return this.m_modules[1].GetValue(x, y, z);
}
else if (cv < (this.m_max + this.m_fallOff))
{
double lc = (this.m_max - this.m_fallOff);
double uc = (this.m_max + this.m_fallOff);
a = Utils.MapCubicSCurve((cv - lc) / (uc - lc));
return Utils.InterpolateLinear(this.m_modules[1].GetValue(x, y, z), this.m_modules[0].GetValue(x, y, z), a);
}
return this.m_modules[0].GetValue(x, y, z);
}
else
{
if (cv < this.m_min || cv > this.m_max)
{
return this.m_modules[0].GetValue(x, y, z);
}
return this.m_modules[1].GetValue(x, y, z);
}
}