implicit operators mean one does not need to instantiate new objects manually

integration
SignpostMarv 2012-08-18 15:04:07 +01:00 committed by Melanie
parent 52d7af05bc
commit fb84ff96a9
2 changed files with 5 additions and 7 deletions

View File

@ -2231,8 +2231,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llRotTarget(LSL_Rotation rot, double error)
{
m_host.AddScriptLPS(1);
return m_host.ParentGroup.registerRotTargetWaypoint(
new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), (float)error);
return m_host.ParentGroup.registerRotTargetWaypoint(rot, (float)error);
}
public void llRotTargetRemove(int number)
@ -10531,7 +10530,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
else
rot = obj.GetWorldRotation();
LSL_Rotation objrot = new LSL_Rotation(rot.X, rot.Y, rot.Z, rot.W);
LSL_Rotation objrot = new LSL_Rotation(rot);
ret.Add(objrot);
}
break;

View File

@ -333,8 +333,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
if (type == typeof(OpenMetaverse.Quaternion))
{
LSL_Rotation rot = (LSL_Rotation)lslparm;
return new OpenMetaverse.Quaternion((float)rot.x,(float)rot.y,(float)rot.z,(float)rot.s);
return (OpenMetaverse.Quaternion)((LSL_Rotation)lslparm);
}
}
@ -366,8 +365,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
result[i] = new UUID((LSL_Key)plist[i]);
else if (plist[i] is LSL_Rotation)
{
LSL_Rotation rot = (LSL_Rotation)plist[i];
result[i] = new OpenMetaverse.Quaternion((float)rot.x,(float)rot.y,(float)rot.z,(float)rot.s);
result[i] = (OpenMetaverse.Quaternion)(
(LSL_Rotation)plist[i]);
}
else if (plist[i] is LSL_Vector)
{