* Applying melanie's List2Vector and List2Rot patch. Added a routine in the Quaternion constructors to catch 0,0,0,0 quaternions and convert them to 0,0,0,1 (as 0,0,0,0 is implicitly converted to 0,0,0,1 in LSL and will crash libsl if left which will in turn crash the simulator)

0.6.0-stable
Teravus Ovares 2008-04-29 12:09:55 +00:00
parent dbdeb40d46
commit 06a367be19
2 changed files with 8 additions and 2 deletions

View File

@ -2979,7 +2979,7 @@ namespace OpenSim.Region.ScriptEngine.Common
}
else
{
return new LSL_Types.Vector3(0, 0, 0);
return new LSL_Types.Vector3(src.Data[index].ToString());
}
}
@ -3000,7 +3000,7 @@ namespace OpenSim.Region.ScriptEngine.Common
}
else
{
return new LSL_Types.Quaternion(0, 0, 0, 1);
return new LSL_Types.Quaternion(src.Data[index].ToString());
}
}

View File

@ -259,6 +259,8 @@ namespace OpenSim.Region.ScriptEngine.Common
y = (float)Quat.y;
z = (float)Quat.z;
s = (float)Quat.s;
if (x == 0 && y == 0 && z == 0 && s == 0)
s = 1;
}
public Quaternion(double X, double Y, double Z, double S)
@ -267,6 +269,8 @@ namespace OpenSim.Region.ScriptEngine.Common
y = Y;
z = Z;
s = S;
if (x == 0 && y == 0 && z == 0 && s == 0)
s = 1;
}
public Quaternion(string str)
@ -279,6 +283,8 @@ namespace OpenSim.Region.ScriptEngine.Common
res = res & Double.TryParse(tmps[1], out y);
res = res & Double.TryParse(tmps[2], out z);
res = res & Double.TryParse(tmps[3], out s);
if (x == 0 && y == 0 && z == 0 && s == 0)
s = 1;
}
#endregion