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

View File

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