diff options
author | Jeff Ames | 2008-07-23 13:24:25 +0000 |
---|---|---|
committer | Jeff Ames | 2008-07-23 13:24:25 +0000 |
commit | 80d8e2889e62d8900837d37a800a4eeaae5ffc5a (patch) | |
tree | 47bdf0f48ae8ace3bb7cd10ab91d91b52b96f80e /OpenSim/Region/ScriptEngine | |
parent | get rid of some LLQuaternion == null checks. Because LLQuaternion is (diff) | |
download | opensim-SC-80d8e2889e62d8900837d37a800a4eeaae5ffc5a.zip opensim-SC-80d8e2889e62d8900837d37a800a4eeaae5ffc5a.tar.gz opensim-SC-80d8e2889e62d8900837d37a800a4eeaae5ffc5a.tar.bz2 opensim-SC-80d8e2889e62d8900837d37a800a4eeaae5ffc5a.tar.xz |
Update svn properties. Formatting cleanup. Remove a compiler warning.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
7 files changed, 54 insertions, 54 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 3129c19..da1e511 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -425,8 +425,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
425 | m_host.AddScriptLPS(1); | 425 | m_host.AddScriptLPS(1); |
426 | double x,y,z,s; | 426 | double x,y,z,s; |
427 | int f=0; | 427 | int f=0; |
428 | // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> | 428 | // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> |
429 | // Computing quaternion x,y,z,s values | 429 | // Computing quaternion x,y,z,s values |
430 | x = ((fwd.x - left.y - up.z + 1) / 4); | 430 | x = ((fwd.x - left.y - up.z + 1) / 4); |
431 | x *= x; | 431 | x *= x; |
432 | x = Math.Sqrt(Math.Sqrt(x)); | 432 | x = Math.Sqrt(Math.Sqrt(x)); |
@@ -440,11 +440,11 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
440 | s *= s; | 440 | s *= s; |
441 | s = Math.Sqrt(Math.Sqrt(s)); | 441 | s = Math.Sqrt(Math.Sqrt(s)); |
442 | 442 | ||
443 | // Set f for signs detection | 443 | // Set f for signs detection |
444 | if (fwd.y+left.x >= 0){f+=1;} | 444 | if (fwd.y+left.x >= 0){f+=1;} |
445 | if (fwd.z+up.x >= 0){f+=2;} | 445 | if (fwd.z+up.x >= 0){f+=2;} |
446 | if (left.z-up.y >= 0){f+=4;} | 446 | if (left.z-up.y >= 0){f+=4;} |
447 | // Set correct quaternion signs based on f value | 447 | // Set correct quaternion signs based on f value |
448 | if (f == 0) { x = -x; } | 448 | if (f == 0) { x = -x; } |
449 | if (f == 1) { x = -x; y = -y; } | 449 | if (f == 1) { x = -x; y = -y; } |
450 | if (f == 2) { x = -x; z = -z; } | 450 | if (f == 2) { x = -x; z = -z; } |
@@ -459,7 +459,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
459 | if (llVecDist(llRot2Fwd(result), fwd) > 0.001 || llVecDist(llRot2Left(result), left) > 0.001) | 459 | if (llVecDist(llRot2Fwd(result), fwd) > 0.001 || llVecDist(llRot2Left(result), left) > 0.001) |
460 | result.s = -s; | 460 | result.s = -s; |
461 | 461 | ||
462 | return result; | 462 | return result; |
463 | } | 463 | } |
464 | 464 | ||
465 | public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r) | 465 | public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r) |
@@ -950,19 +950,19 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
950 | if (value == 1) | 950 | if (value == 1) |
951 | { | 951 | { |
952 | SceneObjectGroup group = m_host.ParentGroup; | 952 | SceneObjectGroup group = m_host.ParentGroup; |
953 | if(group == null) | 953 | if (group == null) |
954 | return; | 954 | return; |
955 | bool allow = true; | 955 | bool allow = true; |
956 | foreach(SceneObjectPart part in group.Children.Values) | 956 | foreach (SceneObjectPart part in group.Children.Values) |
957 | { | 957 | { |
958 | if(part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) | 958 | if (part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) |
959 | { | 959 | { |
960 | allow = false; | 960 | allow = false; |
961 | break; | 961 | break; |
962 | } | 962 | } |
963 | } | 963 | } |
964 | 964 | ||
965 | if(!allow) | 965 | if (!allow) |
966 | return; | 966 | return; |
967 | m_host.ScriptSetPhysicsStatus(true); | 967 | m_host.ScriptSetPhysicsStatus(true); |
968 | } | 968 | } |
@@ -1083,23 +1083,23 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1083 | { | 1083 | { |
1084 | // TODO: this needs to trigger a persistance save as well | 1084 | // TODO: this needs to trigger a persistance save as well |
1085 | 1085 | ||
1086 | if(part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null) | 1086 | if (part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null) |
1087 | return; | 1087 | return; |
1088 | 1088 | ||
1089 | if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) | 1089 | if (part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) |
1090 | { | 1090 | { |
1091 | if(scale.x > World.m_maxPhys) | 1091 | if (scale.x > World.m_maxPhys) |
1092 | scale.x = World.m_maxPhys; | 1092 | scale.x = World.m_maxPhys; |
1093 | if(scale.y > World.m_maxPhys) | 1093 | if (scale.y > World.m_maxPhys) |
1094 | scale.y = World.m_maxPhys; | 1094 | scale.y = World.m_maxPhys; |
1095 | if(scale.z > World.m_maxPhys) | 1095 | if (scale.z > World.m_maxPhys) |
1096 | scale.z = World.m_maxPhys; | 1096 | scale.z = World.m_maxPhys; |
1097 | } | 1097 | } |
1098 | if(scale.x > World.m_maxNonphys) | 1098 | if (scale.x > World.m_maxNonphys) |
1099 | scale.x = World.m_maxNonphys; | 1099 | scale.x = World.m_maxNonphys; |
1100 | if(scale.y > World.m_maxNonphys) | 1100 | if (scale.y > World.m_maxNonphys) |
1101 | scale.y = World.m_maxNonphys; | 1101 | scale.y = World.m_maxNonphys; |
1102 | if(scale.z > World.m_maxNonphys) | 1102 | if (scale.z > World.m_maxNonphys) |
1103 | scale.z = World.m_maxNonphys; | 1103 | scale.z = World.m_maxNonphys; |
1104 | LLVector3 tmp = part.Scale; | 1104 | LLVector3 tmp = part.Scale; |
1105 | tmp.X = (float)scale.x; | 1105 | tmp.X = (float)scale.x; |
@@ -6776,7 +6776,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6776 | 6776 | ||
6777 | public LSL_Types.Vector3 llGetCameraPos() | 6777 | public LSL_Types.Vector3 llGetCameraPos() |
6778 | { | 6778 | { |
6779 | m_host.AddScriptLPS(1); | 6779 | m_host.AddScriptLPS(1); |
6780 | LLUUID invItemID=InventorySelf(); | 6780 | LLUUID invItemID=InventorySelf(); |
6781 | if (invItemID == LLUUID.Zero) | 6781 | if (invItemID == LLUUID.Zero) |
6782 | return new LSL_Types.Vector3(); | 6782 | return new LSL_Types.Vector3(); |
@@ -6784,16 +6784,16 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6784 | return new LSL_Types.Vector3(); | 6784 | return new LSL_Types.Vector3(); |
6785 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRACK_CAMERA) == 0) | 6785 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRACK_CAMERA) == 0) |
6786 | { | 6786 | { |
6787 | ShoutError("No permissions to track the camera"); | 6787 | ShoutError("No permissions to track the camera"); |
6788 | return new LSL_Types.Vector3(); | 6788 | return new LSL_Types.Vector3(); |
6789 | } | 6789 | } |
6790 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); | 6790 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); |
6791 | if(presence != null) | 6791 | if (presence != null) |
6792 | { | 6792 | { |
6793 | LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); | 6793 | LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); |
6794 | return pos; | 6794 | return pos; |
6795 | } | 6795 | } |
6796 | return new LSL_Types.Vector3(); | 6796 | return new LSL_Types.Vector3(); |
6797 | } | 6797 | } |
6798 | 6798 | ||
6799 | public LSL_Types.Quaternion llGetCameraRot() | 6799 | public LSL_Types.Quaternion llGetCameraRot() |
@@ -6968,7 +6968,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6968 | { | 6968 | { |
6969 | m_host.AddScriptLPS(1); | 6969 | m_host.AddScriptLPS(1); |
6970 | IEstateModule estate = World.RequestModuleInterface<IEstateModule>(); | 6970 | IEstateModule estate = World.RequestModuleInterface<IEstateModule>(); |
6971 | if(estate == null) | 6971 | if (estate == null) |
6972 | return 67108864; | 6972 | return 67108864; |
6973 | return estate.GetRegionFlags(); | 6973 | return estate.GetRegionFlags(); |
6974 | } | 6974 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs index 537c114..ac56875 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs | |||
@@ -2108,7 +2108,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
2108 | string results = ""; | 2108 | string results = ""; |
2109 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) | 2109 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) |
2110 | { | 2110 | { |
2111 | //Console.WriteLine( m ); | 2111 | //Console.WriteLine( m ); |
2112 | results += presep+ m + postsep; | 2112 | results += presep+ m + postsep; |
2113 | } | 2113 | } |
2114 | return results; | 2114 | return results; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ac4d43a..a5c5453 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -790,19 +790,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
790 | if (value == 1) | 790 | if (value == 1) |
791 | { | 791 | { |
792 | SceneObjectGroup group = m_host.ParentGroup; | 792 | SceneObjectGroup group = m_host.ParentGroup; |
793 | if(group == null) | 793 | if (group == null) |
794 | return; | 794 | return; |
795 | bool allow = true; | 795 | bool allow = true; |
796 | foreach(SceneObjectPart part in group.Children.Values) | 796 | foreach (SceneObjectPart part in group.Children.Values) |
797 | { | 797 | { |
798 | if(part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) | 798 | if (part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) |
799 | { | 799 | { |
800 | allow = false; | 800 | allow = false; |
801 | break; | 801 | break; |
802 | } | 802 | } |
803 | } | 803 | } |
804 | 804 | ||
805 | if(!allow) | 805 | if (!allow) |
806 | return; | 806 | return; |
807 | m_host.ScriptSetPhysicsStatus(true); | 807 | m_host.ScriptSetPhysicsStatus(true); |
808 | } | 808 | } |
@@ -937,23 +937,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
937 | { | 937 | { |
938 | // TODO: this needs to trigger a persistance save as well | 938 | // TODO: this needs to trigger a persistance save as well |
939 | 939 | ||
940 | if(part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null) | 940 | if (part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null) |
941 | return; | 941 | return; |
942 | 942 | ||
943 | if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) | 943 | if (part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) |
944 | { | 944 | { |
945 | if(scale.x > World.m_maxPhys) | 945 | if (scale.x > World.m_maxPhys) |
946 | scale.x = World.m_maxPhys; | 946 | scale.x = World.m_maxPhys; |
947 | if(scale.y > World.m_maxPhys) | 947 | if (scale.y > World.m_maxPhys) |
948 | scale.y = World.m_maxPhys; | 948 | scale.y = World.m_maxPhys; |
949 | if(scale.z > World.m_maxPhys) | 949 | if (scale.z > World.m_maxPhys) |
950 | scale.z = World.m_maxPhys; | 950 | scale.z = World.m_maxPhys; |
951 | } | 951 | } |
952 | if(scale.x > World.m_maxNonphys) | 952 | if (scale.x > World.m_maxNonphys) |
953 | scale.x = World.m_maxNonphys; | 953 | scale.x = World.m_maxNonphys; |
954 | if(scale.y > World.m_maxNonphys) | 954 | if (scale.y > World.m_maxNonphys) |
955 | scale.y = World.m_maxNonphys; | 955 | scale.y = World.m_maxNonphys; |
956 | if(scale.z > World.m_maxNonphys) | 956 | if (scale.z > World.m_maxNonphys) |
957 | scale.z = World.m_maxNonphys; | 957 | scale.z = World.m_maxNonphys; |
958 | LLVector3 tmp = part.Scale; | 958 | LLVector3 tmp = part.Scale; |
959 | tmp.X = (float)scale.x; | 959 | tmp.X = (float)scale.x; |
@@ -6748,7 +6748,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6748 | { | 6748 | { |
6749 | m_host.AddScriptLPS(1); | 6749 | m_host.AddScriptLPS(1); |
6750 | IEstateModule estate = World.RequestModuleInterface<IEstateModule>(); | 6750 | IEstateModule estate = World.RequestModuleInterface<IEstateModule>(); |
6751 | if(estate == null) | 6751 | if (estate == null) |
6752 | return 67108864; | 6752 | return 67108864; |
6753 | return (int)estate.GetRegionFlags(); | 6753 | return (int)estate.GetRegionFlags(); |
6754 | } | 6754 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs index 17f2f1c..76e307a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs | |||
@@ -2108,7 +2108,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
2108 | string results = ""; | 2108 | string results = ""; |
2109 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) | 2109 | for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) |
2110 | { | 2110 | { |
2111 | //Console.WriteLine( m ); | 2111 | //Console.WriteLine( m ); |
2112 | results += presep+ m + postsep; | 2112 | results += presep+ m + postsep; |
2113 | } | 2113 | } |
2114 | return results; | 2114 | return results; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index f7b6d08..e8cfdf7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -327,7 +327,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
327 | { | 327 | { |
328 | // Its LSL, convert it to C# | 328 | // Its LSL, convert it to C# |
329 | //compileScript = LSL_Converter.Convert(Script); | 329 | //compileScript = LSL_Converter.Convert(Script); |
330 | if(m_UseCompiler) | 330 | if (m_UseCompiler) |
331 | LSL_Converter = (ICodeConverter)new CSCodeGenerator(); | 331 | LSL_Converter = (ICodeConverter)new CSCodeGenerator(); |
332 | else | 332 | else |
333 | LSL_Converter = (ICodeConverter)new LSL2CSConverter(); | 333 | LSL_Converter = (ICodeConverter)new LSL2CSConverter(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/ICodeConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/ICodeConverter.cs index a57530c..28e42da 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/ICodeConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/ICodeConverter.cs | |||
@@ -30,8 +30,8 @@ using System; | |||
30 | 30 | ||
31 | namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | 31 | namespace OpenSim.Region.ScriptEngine.Shared.CodeTools |
32 | { | 32 | { |
33 | public interface ICodeConverter | 33 | public interface ICodeConverter |
34 | { | 34 | { |
35 | string Convert(string script); | 35 | string Convert(string script); |
36 | } | 36 | } |
37 | } | 37 | } |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 9f67dc1..673189a 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1191,8 +1191,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1191 | if (result == null) | 1191 | if (result == null) |
1192 | return true; | 1192 | return true; |
1193 | 1193 | ||
1194 | if(!m_InSelfDelete) | 1194 | if (!m_InSelfDelete) |
1195 | result.Abort(); | 1195 | result.Abort(); |
1196 | 1196 | ||
1197 | lock (m_EventQueue) | 1197 | lock (m_EventQueue) |
1198 | { | 1198 | { |
@@ -1342,10 +1342,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1342 | e.ToString()); | 1342 | e.ToString()); |
1343 | } | 1343 | } |
1344 | } | 1344 | } |
1345 | else if((e is TargetInvocationException) && (e.InnerException is SelfDeleteException)) | 1345 | else if ((e is TargetInvocationException) && (e.InnerException is SelfDeleteException)) |
1346 | { | 1346 | { |
1347 | m_InSelfDelete = true; | 1347 | m_InSelfDelete = true; |
1348 | if(part != null && part.ParentGroup != null) | 1348 | if (part != null && part.ParentGroup != null) |
1349 | m_Engine.World.DeleteSceneObject(part.ParentGroup); | 1349 | m_Engine.World.DeleteSceneObject(part.ParentGroup); |
1350 | } | 1350 | } |
1351 | } | 1351 | } |