aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs60
1 files changed, 30 insertions, 30 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 }