Merge branch 'master' into careminster

Conflicts:
	OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
	OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
	OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
This commit is contained in:
Melanie
2013-06-11 01:03:15 +01:00
18 changed files with 1128 additions and 53 deletions

View File

@@ -5109,6 +5109,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
s = Math.Cos(angle * 0.5);
t = Math.Sin(angle * 0.5); // temp value to avoid 2 more sin() calcs
axis = LSL_Vector.Norm(axis);
x = axis.x * t;
y = axis.y * t;
z = axis.z * t;
@@ -5149,7 +5150,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
y = rot.y / s;
z = rot.z / s;
}
if ((double.IsNaN(x)) || double.IsInfinity(x)) x = 0;
if ((double.IsNaN(y)) || double.IsInfinity(y)) y = 0;
if ((double.IsNaN(z)) || double.IsInfinity(z)) z = 0;
return new LSL_Vector(x,y,z);
}
@@ -5171,7 +5174,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
double angle = 2 * Math.Acos(rot.s);
if ((double.IsNaN(angle)) || double.IsInfinity(angle)) angle = 0;
return angle;
}

View File

@@ -371,6 +371,31 @@ namespace OpenSim.Region.ScriptEngine.Shared
#endregion
#region Methods
public Quaternion Normalize()
{
double length = Math.Sqrt(x * x + y * y + z * z + s * s);
if (length < float.Epsilon)
{
x = 1;
y = 0;
z = 0;
s = 0;
}
else
{
double invLength = 1.0 / length;
x *= invLength;
y *= invLength;
z *= invLength;
s *= invLength;
}
return this;
}
#endregion
#region Overriders
public override int GetHashCode()