aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs226
1 files changed, 113 insertions, 113 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 9604828..4de207a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -348,23 +348,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
348 a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting 348 a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting
349 vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. 349 vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis.
350 */ 350 */
351 351
352 /* How we arrived at this llEuler2Rot 352 /* How we arrived at this llEuler2Rot
353 * 353 *
354 * Experiment in SL to determine conventions: 354 * Experiment in SL to determine conventions:
355 * llEuler2Rot(<PI,0,0>)=<1,0,0,0> 355 * llEuler2Rot(<PI,0,0>)=<1,0,0,0>
356 * llEuler2Rot(<0,PI,0>)=<0,1,0,0> 356 * llEuler2Rot(<0,PI,0>)=<0,1,0,0>
357 * llEuler2Rot(<0,0,PI>)=<0,0,1,0> 357 * llEuler2Rot(<0,0,PI>)=<0,0,1,0>
358 * 358 *
359 * Important facts about Quaternions 359 * Important facts about Quaternions
360 * - multiplication is non-commutative (a*b != b*a) 360 * - multiplication is non-commutative (a*b != b*a)
361 * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication 361 * - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication
362 * 362 *
363 * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot): 363 * Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot):
364 * Qx = c1+i*s1 364 * Qx = c1+i*s1
365 * Qy = c2+j*s2; 365 * Qy = c2+j*s2;
366 * Qz = c3+k*s3; 366 * Qz = c3+k*s3;
367 * 367 *
368 * Rotations applied in order (from above) Z, Y, X 368 * Rotations applied in order (from above) Z, Y, X
369 * Q = (Qz * Qy) * Qx 369 * Q = (Qz * Qy) * Qx
370 * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3) 370 * ((c1+i*s1)*(c2+j*s2))*(c3+k*s3)
@@ -376,23 +376,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
376 * y=j*(c1*s2*c3-s1*c2*s3) 376 * y=j*(c1*s2*c3-s1*c2*s3)
377 * z=k*(s1*s2*c3+c1*c2*s3) 377 * z=k*(s1*s2*c3+c1*c2*s3)
378 * s= c1*c2*c3-s1*s2*s3 378 * s= c1*c2*c3-s1*s2*s3
379 * 379 *
380 * This implementation agrees with the functions found here: 380 * This implementation agrees with the functions found here:
381 * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions 381 * http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions
382 * And with the results in SL. 382 * And with the results in SL.
383 * 383 *
384 * It's also possible to calculate llEuler2Rot by direct multiplication of 384 * It's also possible to calculate llEuler2Rot by direct multiplication of
385 * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function 385 * the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function
386 * from the wiki). 386 * from the wiki).
387 * Apparently in some cases this is better from a numerical precision perspective? 387 * Apparently in some cases this is better from a numerical precision perspective?
388 */ 388 */
389 389
390 public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) 390 public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v)
391 { 391 {
392 m_host.AddScriptLPS(1); 392 m_host.AddScriptLPS(1);
393 393
394 double x,y,z,s; 394 double x,y,z,s;
395 395
396 double c1 = Math.Cos(v.x/2.0); 396 double c1 = Math.Cos(v.x/2.0);
397 double c2 = Math.Cos(v.y/2.0); 397 double c2 = Math.Cos(v.y/2.0);
398 double c3 = Math.Cos(v.z/2.0); 398 double c3 = Math.Cos(v.z/2.0);
@@ -404,7 +404,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
404 y = c1*s2*c3-s1*c2*s3; 404 y = c1*s2*c3-s1*c2*s3;
405 z = s1*s2*c3+c1*c2*s3; 405 z = s1*s2*c3+c1*c2*s3;
406 s = c1*c2*c3-s1*s2*s3; 406 s = c1*c2*c3-s1*s2*s3;
407 407
408 return new LSL_Types.Quaternion(x, y, z, s); 408 return new LSL_Types.Quaternion(x, y, z, s);
409 } 409 }
410 410
@@ -414,7 +414,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
414 double x, y, z, s; 414 double x, y, z, s;
415 int f = 0; 415 int f = 0;
416 // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s> 416 // Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s>
417 // Computing quaternion x,y,z,s values 417 // Computing quaternion x,y,z,s values
418 x = ((fwd.x - left.y - up.z + 1) / 4); 418 x = ((fwd.x - left.y - up.z + 1) / 4);
419 x *= x; 419 x *= x;
420 x = Math.Sqrt(Math.Sqrt(x)); 420 x = Math.Sqrt(Math.Sqrt(x));
@@ -428,7 +428,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
428 s *= s; 428 s *= s;
429 s = Math.Sqrt(Math.Sqrt(s)); 429 s = Math.Sqrt(Math.Sqrt(s));
430 430
431 // Set f for signs detection 431 // Set f for signs detection
432 if (fwd.y + left.x >= 0) { f += 1; } 432 if (fwd.y + left.x >= 0) { f += 1; }
433 if (fwd.z + up.x >= 0) { f += 2; } 433 if (fwd.z + up.x >= 0) { f += 2; }
434 if (left.z - up.y >= 0) { f += 4; } 434 if (left.z - up.y >= 0) { f += 4; }
@@ -1013,9 +1013,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1013 return; 1013 return;
1014 } 1014 }
1015 } 1015 }
1016 1016
1017 public void SetGlow(SceneObjectPart part, int face, float glow) 1017 public void SetGlow(SceneObjectPart part, int face, float glow)
1018 { 1018 {
1019 LLObject.TextureEntry tex = part.Shape.Textures; 1019 LLObject.TextureEntry tex = part.Shape.Textures;
1020 if (face > -1) 1020 if (face > -1)
1021 { 1021 {
@@ -1023,7 +1023,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1023 tex.FaceTextures[face].Glow = glow; 1023 tex.FaceTextures[face].Glow = glow;
1024 part.UpdateTexture(tex); 1024 part.UpdateTexture(tex);
1025 return; 1025 return;
1026 } 1026 }
1027 else if (face == -1) 1027 else if (face == -1)
1028 { 1028 {
1029 for (uint i = 0; i < 32; i++) 1029 for (uint i = 0; i < 32; i++)
@@ -1038,15 +1038,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1038 return; 1038 return;
1039 } 1039 }
1040 } 1040 }
1041 1041
1042 public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) 1042 public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump)
1043 { 1043 {
1044 1044
1045 Shininess sval = new Shininess(); 1045 Shininess sval = new Shininess();
1046 1046
1047 switch (shiny) 1047 switch (shiny)
1048 { 1048 {
1049 case 0: 1049 case 0:
1050 sval = Shininess.None; 1050 sval = Shininess.None;
1051 break; 1051 break;
1052 case 1: 1052 case 1:
@@ -1062,7 +1062,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1062 sval = Shininess.None; 1062 sval = Shininess.None;
1063 break; 1063 break;
1064 } 1064 }
1065 1065
1066 LLObject.TextureEntry tex = part.Shape.Textures; 1066 LLObject.TextureEntry tex = part.Shape.Textures;
1067 if (face > -1) 1067 if (face > -1)
1068 { 1068 {
@@ -1070,8 +1070,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1070 tex.FaceTextures[face].Shiny = sval; 1070 tex.FaceTextures[face].Shiny = sval;
1071 tex.FaceTextures[face].Bump = bump; 1071 tex.FaceTextures[face].Bump = bump;
1072 part.UpdateTexture(tex); 1072 part.UpdateTexture(tex);
1073 return; 1073 return;
1074 } 1074 }
1075 else if (face == -1) 1075 else if (face == -1)
1076 { 1076 {
1077 for (uint i = 0; i < 32; i++) 1077 for (uint i = 0; i < 32; i++)
@@ -1088,8 +1088,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1088 return; 1088 return;
1089 } 1089 }
1090 } 1090 }
1091 1091
1092 public void SetFullBright(SceneObjectPart part, int face, bool bright) 1092 public void SetFullBright(SceneObjectPart part, int face, bool bright)
1093 { 1093 {
1094 LLObject.TextureEntry tex = part.Shape.Textures; 1094 LLObject.TextureEntry tex = part.Shape.Textures;
1095 if (face > -1) 1095 if (face > -1)
@@ -1106,14 +1106,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1106 if (tex.FaceTextures[i] != null) 1106 if (tex.FaceTextures[i] != null)
1107 { 1107 {
1108 tex.FaceTextures[i].Fullbright = bright; 1108 tex.FaceTextures[i].Fullbright = bright;
1109 } 1109 }
1110 } 1110 }
1111 tex.DefaultTexture.Fullbright = bright; 1111 tex.DefaultTexture.Fullbright = bright;
1112 part.UpdateTexture(tex); 1112 part.UpdateTexture(tex);
1113 return; 1113 return;
1114 } 1114 }
1115 } 1115 }
1116 1116
1117 public double llGetAlpha(int face) 1117 public double llGetAlpha(int face)
1118 { 1118 {
1119 m_host.AddScriptLPS(1); 1119 m_host.AddScriptLPS(1);
@@ -1169,7 +1169,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1169 1169
1170 /// <summary> 1170 /// <summary>
1171 /// Set flexi parameters of a part. 1171 /// Set flexi parameters of a part.
1172 /// 1172 ///
1173 /// FIXME: Much of this code should probably be within the part itself. 1173 /// FIXME: Much of this code should probably be within the part itself.
1174 /// </summary> 1174 /// </summary>
1175 /// <param name="part"></param> 1175 /// <param name="part"></param>
@@ -1179,7 +1179,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1179 /// <param name="friction"></param> 1179 /// <param name="friction"></param>
1180 /// <param name="wind"></param> 1180 /// <param name="wind"></param>
1181 /// <param name="tension"></param> 1181 /// <param name="tension"></param>
1182 /// <param name="Force"></param> 1182 /// <param name="Force"></param>
1183 private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, 1183 private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction,
1184 float wind, float tension, LSL_Types.Vector3 Force) 1184 float wind, float tension, LSL_Types.Vector3 Force)
1185 { 1185 {
@@ -1230,7 +1230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1230 1230
1231 /// <summary> 1231 /// <summary>
1232 /// Set a light point on a part 1232 /// Set a light point on a part
1233 /// 1233 ///
1234 /// FIXME: Much of this code should probably be in SceneObjectGroup 1234 /// FIXME: Much of this code should probably be in SceneObjectGroup
1235 /// </summary> 1235 /// </summary>
1236 /// <param name="part"></param> 1236 /// <param name="part"></param>
@@ -1238,7 +1238,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1238 /// <param name="color"></param> 1238 /// <param name="color"></param>
1239 /// <param name="intensity"></param> 1239 /// <param name="intensity"></param>
1240 /// <param name="radius"></param> 1240 /// <param name="radius"></param>
1241 /// <param name="falloff"></param> 1241 /// <param name="falloff"></param>
1242 private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff) 1242 private void SetPointLight(SceneObjectPart part, bool light, LSL_Types.Vector3 color, float intensity, float radius, float falloff)
1243 { 1243 {
1244 if (part == null) 1244 if (part == null)
@@ -2880,13 +2880,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2880 bool found = false; 2880 bool found = false;
2881 LLUUID destId = LLUUID.Zero; 2881 LLUUID destId = LLUUID.Zero;
2882 LLUUID objId = LLUUID.Zero; 2882 LLUUID objId = LLUUID.Zero;
2883 2883
2884 if (!LLUUID.TryParse(destination, out destId)) 2884 if (!LLUUID.TryParse(destination, out destId))
2885 { 2885 {
2886 llSay(0, "Could not parse key " + destination); 2886 llSay(0, "Could not parse key " + destination);
2887 return; 2887 return;
2888 } 2888 }
2889 2889
2890 // move the first object found with this inventory name 2890 // move the first object found with this inventory name
2891 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) 2891 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
2892 { 2892 {
@@ -4451,7 +4451,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4451 private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues() 4451 private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues()
4452 { 4452 {
4453 Primitive.ParticleSystem ps = new Primitive.ParticleSystem(); 4453 Primitive.ParticleSystem ps = new Primitive.ParticleSystem();
4454 4454
4455 // TODO find out about the other defaults and add them here 4455 // TODO find out about the other defaults and add them here
4456 ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); 4456 ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f);
4457 ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f); 4457 ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f);
@@ -4465,7 +4465,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4465 ps.PartMaxAge = 10.0f; 4465 ps.PartMaxAge = 10.0f;
4466 return ps; 4466 return ps;
4467 } 4467 }
4468 4468
4469 public void llParticleSystem(LSL_Types.list rules) 4469 public void llParticleSystem(LSL_Types.list rules)
4470 { 4470 {
4471 m_host.AddScriptLPS(1); 4471 m_host.AddScriptLPS(1);
@@ -4660,7 +4660,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4660 itemList.Add(itemID); 4660 itemList.Add(itemID);
4661 } 4661 }
4662 } 4662 }
4663 4663
4664 if (itemList.Count == 0) 4664 if (itemList.Count == 0)
4665 return; 4665 return;
4666 4666
@@ -4936,11 +4936,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4936 m_host.AddScriptLPS(1); 4936 m_host.AddScriptLPS(1);
4937 return Util.Md5Hash(src + ":" + nonce.ToString()); 4937 return Util.Md5Hash(src + ":" + nonce.ToString());
4938 } 4938 }
4939 4939
4940 private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) 4940 private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist)
4941 { 4941 {
4942 ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); 4942 ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();
4943 4943
4944 if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT && 4944 if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT &&
4945 holeshape != (int)ScriptBaseClass.PRIM_HOLE_CIRCLE && 4945 holeshape != (int)ScriptBaseClass.PRIM_HOLE_CIRCLE &&
4946 holeshape != (int)ScriptBaseClass.PRIM_HOLE_SQUARE && 4946 holeshape != (int)ScriptBaseClass.PRIM_HOLE_SQUARE &&
@@ -4998,23 +4998,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4998 } 4998 }
4999 shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); 4999 shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x);
5000 shapeBlock.PathTwist = (sbyte)(200 * twist.y); 5000 shapeBlock.PathTwist = (sbyte)(200 * twist.y);
5001 5001
5002 shapeBlock.ObjectLocalID = m_host.LocalId; 5002 shapeBlock.ObjectLocalID = m_host.LocalId;
5003 5003
5004 // retain pathcurve 5004 // retain pathcurve
5005 shapeBlock.PathCurve = m_host.Shape.PathCurve; 5005 shapeBlock.PathCurve = m_host.Shape.PathCurve;
5006 5006
5007 return shapeBlock; 5007 return shapeBlock;
5008 } 5008 }
5009 5009
5010 private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge) 5010 private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge)
5011 { 5011 {
5012 ObjectShapePacket.ObjectDataBlock shapeBlock; 5012 ObjectShapePacket.ObjectDataBlock shapeBlock;
5013 5013
5014 shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); 5014 shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist);
5015 5015
5016 shapeBlock.ProfileCurve += fudge; 5016 shapeBlock.ProfileCurve += fudge;
5017 5017
5018 if (taper_b.x < 0f) 5018 if (taper_b.x < 0f)
5019 { 5019 {
5020 taper_b.x = 0f; 5020 taper_b.x = 0f;
@@ -5051,25 +5051,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5051 } 5051 }
5052 shapeBlock.PathShearX = (byte)(100 * topshear.x); 5052 shapeBlock.PathShearX = (byte)(100 * topshear.x);
5053 shapeBlock.PathShearY = (byte)(100 * topshear.y); 5053 shapeBlock.PathShearY = (byte)(100 * topshear.y);
5054 5054
5055 m_host.UpdateShape(shapeBlock); 5055 m_host.UpdateShape(shapeBlock);
5056 } 5056 }
5057 5057
5058 private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) 5058 private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge)
5059 { 5059 {
5060 ObjectShapePacket.ObjectDataBlock shapeBlock; 5060 ObjectShapePacket.ObjectDataBlock shapeBlock;
5061 5061
5062 shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); 5062 shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist);
5063 5063
5064 // profile/path swapped for a sphere 5064 // profile/path swapped for a sphere
5065 shapeBlock.PathBegin = shapeBlock.ProfileBegin; 5065 shapeBlock.PathBegin = shapeBlock.ProfileBegin;
5066 shapeBlock.PathEnd = shapeBlock.ProfileEnd; 5066 shapeBlock.PathEnd = shapeBlock.ProfileEnd;
5067 5067
5068 shapeBlock.ProfileCurve += fudge; 5068 shapeBlock.ProfileCurve += fudge;
5069 5069
5070 shapeBlock.PathScaleX = 100; 5070 shapeBlock.PathScaleX = 100;
5071 shapeBlock.PathScaleY = 100; 5071 shapeBlock.PathScaleY = 100;
5072 5072
5073 if (dimple.x < 0f) 5073 if (dimple.x < 0f)
5074 { 5074 {
5075 dimple.x = 0f; 5075 dimple.x = 0f;
@@ -5092,22 +5092,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5092 } 5092 }
5093 shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); 5093 shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x);
5094 shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); 5094 shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y));
5095 5095
5096 m_host.UpdateShape(shapeBlock); 5096 m_host.UpdateShape(shapeBlock);
5097 } 5097 }
5098 5098
5099 private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge) 5099 private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge)
5100 { 5100 {
5101 ObjectShapePacket.ObjectDataBlock shapeBlock; 5101 ObjectShapePacket.ObjectDataBlock shapeBlock;
5102 5102
5103 shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); 5103 shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist);
5104 5104
5105 shapeBlock.ProfileCurve += fudge; 5105 shapeBlock.ProfileCurve += fudge;
5106 5106
5107 // profile/path swapped for a torrus, tube, ring 5107 // profile/path swapped for a torrus, tube, ring
5108 shapeBlock.PathBegin = shapeBlock.ProfileBegin; 5108 shapeBlock.PathBegin = shapeBlock.ProfileBegin;
5109 shapeBlock.PathEnd = shapeBlock.ProfileEnd; 5109 shapeBlock.PathEnd = shapeBlock.ProfileEnd;
5110 5110
5111 if (holesize.x < 0.05f) 5111 if (holesize.x < 0.05f)
5112 { 5112 {
5113 holesize.x = 0.05f; 5113 holesize.x = 0.05f;
@@ -5212,15 +5212,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5212 skew = 0.95f; 5212 skew = 0.95f;
5213 } 5213 }
5214 shapeBlock.PathSkew = (sbyte)(100 * skew); 5214 shapeBlock.PathSkew = (sbyte)(100 * skew);
5215 5215
5216 m_host.UpdateShape(shapeBlock); 5216 m_host.UpdateShape(shapeBlock);
5217 } 5217 }
5218 5218
5219 private void SetPrimitiveShapeParams(string map, int type) 5219 private void SetPrimitiveShapeParams(string map, int type)
5220 { 5220 {
5221 ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); 5221 ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();
5222 LLUUID sculptId; 5222 LLUUID sculptId;
5223 5223
5224 if (!LLUUID.TryParse(map, out sculptId)) 5224 if (!LLUUID.TryParse(map, out sculptId))
5225 { 5225 {
5226 llSay(0, "Could not parse key " + map); 5226 llSay(0, "Could not parse key " + map);
@@ -5230,7 +5230,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5230 shapeBlock.ObjectLocalID = m_host.LocalId; 5230 shapeBlock.ObjectLocalID = m_host.LocalId;
5231 shapeBlock.PathScaleX = 100; 5231 shapeBlock.PathScaleX = 100;
5232 shapeBlock.PathScaleY = 150; 5232 shapeBlock.PathScaleY = 150;
5233 5233
5234 if (type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER && 5234 if (type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER &&
5235 type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE && 5235 type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE &&
5236 type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE && 5236 type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE &&
@@ -5239,7 +5239,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5239 // default 5239 // default
5240 type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; 5240 type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE;
5241 } 5241 }
5242 5242
5243 // retain pathcurve 5243 // retain pathcurve
5244 shapeBlock.PathCurve = m_host.Shape.PathCurve; 5244 shapeBlock.PathCurve = m_host.Shape.PathCurve;
5245 5245
@@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5256 public void llSetLinkPrimitiveParams(int linknumber, LSL_Types.list rules) 5256 public void llSetLinkPrimitiveParams(int linknumber, LSL_Types.list rules)
5257 { 5257 {
5258 m_host.AddScriptLPS(1); 5258 m_host.AddScriptLPS(1);
5259 5259
5260 if (m_host.ParentGroup == null) 5260 if (m_host.ParentGroup == null)
5261 return; 5261 return;
5262 5262
@@ -5302,13 +5302,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5302 SetRot(part, q); 5302 SetRot(part, q);
5303 5303
5304 break; 5304 break;
5305 5305
5306 case (int)ScriptBaseClass.PRIM_TYPE: 5306 case (int)ScriptBaseClass.PRIM_TYPE:
5307 if (remain < 3) 5307 if (remain < 3)
5308 return; 5308 return;
5309 5309
5310 code = Convert.ToInt32(rules.Data[idx++]); 5310 code = Convert.ToInt32(rules.Data[idx++]);
5311 5311
5312 remain = rules.Length - idx; 5312 remain = rules.Length - idx;
5313 float hollow; 5313 float hollow;
5314 LSL_Types.Vector3 twist; 5314 LSL_Types.Vector3 twist;
@@ -5319,9 +5319,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5319 float skew; 5319 float skew;
5320 LSL_Types.Vector3 holesize; 5320 LSL_Types.Vector3 holesize;
5321 LSL_Types.Vector3 profilecut; 5321 LSL_Types.Vector3 profilecut;
5322 5322
5323 switch (code) 5323 switch (code)
5324 { 5324 {
5325 case (int)ScriptBaseClass.PRIM_TYPE_BOX: 5325 case (int)ScriptBaseClass.PRIM_TYPE_BOX:
5326 if (remain < 6) 5326 if (remain < 6)
5327 return; 5327 return;
@@ -5335,7 +5335,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5335 m_host.Shape.PathCurve = (byte) Extrusion.Straight; 5335 m_host.Shape.PathCurve = (byte) Extrusion.Straight;
5336 SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1); 5336 SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1);
5337 break; 5337 break;
5338 5338
5339 case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: 5339 case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER:
5340 if (remain < 6) 5340 if (remain < 6)
5341 return; 5341 return;
@@ -5350,12 +5350,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5350 m_host.Shape.PathCurve = (byte) Extrusion.Straight; 5350 m_host.Shape.PathCurve = (byte) Extrusion.Straight;
5351 SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); 5351 SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0);
5352 break; 5352 break;
5353 5353
5354 case (int)ScriptBaseClass.PRIM_TYPE_PRISM: 5354 case (int)ScriptBaseClass.PRIM_TYPE_PRISM:
5355 if (remain < 6) 5355 if (remain < 6)
5356 return; 5356 return;
5357 5357
5358 face = Convert.ToInt32(rules.Data[idx++]); // holeshape 5358 face = Convert.ToInt32(rules.Data[idx++]); // holeshape
5359 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut 5359 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut
5360 hollow = (float)Convert.ToDouble(rules.Data[idx++]); 5360 hollow = (float)Convert.ToDouble(rules.Data[idx++]);
5361 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5361 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
@@ -5377,12 +5377,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5377 m_host.Shape.PathCurve = (byte) Extrusion.Curve1; 5377 m_host.Shape.PathCurve = (byte) Extrusion.Curve1;
5378 SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); 5378 SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5);
5379 break; 5379 break;
5380 5380
5381 case (int)ScriptBaseClass.PRIM_TYPE_TORUS: 5381 case (int)ScriptBaseClass.PRIM_TYPE_TORUS:
5382 if (remain < 11) 5382 if (remain < 11)
5383 return; 5383 return;
5384 5384
5385 face = Convert.ToInt32(rules.Data[idx++]); // holeshape 5385 face = Convert.ToInt32(rules.Data[idx++]); // holeshape
5386 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut 5386 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut
5387 hollow = (float)Convert.ToDouble(rules.Data[idx++]); 5387 hollow = (float)Convert.ToDouble(rules.Data[idx++]);
5388 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5388 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
@@ -5396,12 +5396,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5396 m_host.Shape.PathCurve = (byte) Extrusion.Curve1; 5396 m_host.Shape.PathCurve = (byte) Extrusion.Curve1;
5397 SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); 5397 SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0);
5398 break; 5398 break;
5399 5399
5400 case (int)ScriptBaseClass.PRIM_TYPE_TUBE: 5400 case (int)ScriptBaseClass.PRIM_TYPE_TUBE:
5401 if (remain < 11) 5401 if (remain < 11)
5402 return; 5402 return;
5403 5403
5404 face = Convert.ToInt32(rules.Data[idx++]); // holeshape 5404 face = Convert.ToInt32(rules.Data[idx++]); // holeshape
5405 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut 5405 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut
5406 hollow = (float)Convert.ToDouble(rules.Data[idx++]); 5406 hollow = (float)Convert.ToDouble(rules.Data[idx++]);
5407 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5407 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
@@ -5415,12 +5415,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5415 m_host.Shape.PathCurve = (byte) Extrusion.Curve1; 5415 m_host.Shape.PathCurve = (byte) Extrusion.Curve1;
5416 SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); 5416 SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1);
5417 break; 5417 break;
5418 5418
5419 case (int)ScriptBaseClass.PRIM_TYPE_RING: 5419 case (int)ScriptBaseClass.PRIM_TYPE_RING:
5420 if (remain < 11) 5420 if (remain < 11)
5421 return; 5421 return;
5422 5422
5423 face = Convert.ToInt32(rules.Data[idx++]); // holeshape 5423 face = Convert.ToInt32(rules.Data[idx++]); // holeshape
5424 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut 5424 v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut
5425 hollow = (float)Convert.ToDouble(rules.Data[idx++]); 5425 hollow = (float)Convert.ToDouble(rules.Data[idx++]);
5426 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); 5426 twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
@@ -5434,7 +5434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5434 m_host.Shape.PathCurve = (byte) Extrusion.Curve1; 5434 m_host.Shape.PathCurve = (byte) Extrusion.Curve1;
5435 SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); 5435 SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3);
5436 break; 5436 break;
5437 5437
5438 case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: 5438 case (int)ScriptBaseClass.PRIM_TYPE_SCULPT:
5439 if (remain < 2) 5439 if (remain < 2)
5440 return; 5440 return;
@@ -5445,7 +5445,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5445 SetPrimitiveShapeParams(map, face); 5445 SetPrimitiveShapeParams(map, face);
5446 break; 5446 break;
5447 } 5447 }
5448 5448
5449 break; 5449 break;
5450 5450
5451 case (int)ScriptBaseClass.PRIM_TEXTURE: 5451 case (int)ScriptBaseClass.PRIM_TEXTURE:
@@ -5509,31 +5509,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5509 return; 5509 return;
5510 face = Convert.ToInt32(rules.Data[idx++]); 5510 face = Convert.ToInt32(rules.Data[idx++]);
5511 float glow = (float)Convert.ToDouble(rules.Data[idx++]); 5511 float glow = (float)Convert.ToDouble(rules.Data[idx++]);
5512 5512
5513 SetGlow(part, face, glow); 5513 SetGlow(part, face, glow);
5514 5514
5515 break; 5515 break;
5516 case (int)ScriptBaseClass.PRIM_BUMP_SHINY: 5516 case (int)ScriptBaseClass.PRIM_BUMP_SHINY:
5517 if (remain < 3) 5517 if (remain < 3)
5518 return; 5518 return;
5519 face = Convert.ToInt32(rules.Data[idx++]); 5519 face = Convert.ToInt32(rules.Data[idx++]);
5520 int shiny = Convert.ToInt32(rules.Data[idx++]); 5520 int shiny = Convert.ToInt32(rules.Data[idx++]);
5521 Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); 5521 Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]);
5522 5522
5523 SetShiny(part, face, shiny, bump); 5523 SetShiny(part, face, shiny, bump);
5524 5524
5525 break; 5525 break;
5526 case (int)ScriptBaseClass.PRIM_FULLBRIGHT: 5526 case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
5527 if (remain < 2) 5527 if (remain < 2)
5528 return; 5528 return;
5529 face = Convert.ToInt32(rules.Data[idx++]); 5529 face = Convert.ToInt32(rules.Data[idx++]);
5530 string bv = rules.Data[idx++].ToString(); 5530 string bv = rules.Data[idx++].ToString();
5531 bool st; 5531 bool st;
5532 if (bv.Equals("1")) 5532 if (bv.Equals("1"))
5533 st = true; 5533 st = true;
5534 else 5534 else
5535 st = false; 5535 st = false;
5536 5536
5537 SetFullBright(part, face , st); 5537 SetFullBright(part, face , st);
5538 break; 5538 break;
5539 case (int)ScriptBaseClass.PRIM_MATERIAL: 5539 case (int)ScriptBaseClass.PRIM_MATERIAL:
@@ -5552,29 +5552,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5552 case (int)ScriptBaseClass.PRIM_PHANTOM: 5552 case (int)ScriptBaseClass.PRIM_PHANTOM:
5553 if (remain < 1) 5553 if (remain < 1)
5554 return; 5554 return;
5555 5555
5556 string ph = rules.Data[idx++].ToString(); 5556 string ph = rules.Data[idx++].ToString();
5557 bool phantom; 5557 bool phantom;
5558 5558
5559 if (ph.Equals("1")) 5559 if (ph.Equals("1"))
5560 phantom = true; 5560 phantom = true;
5561 else 5561 else
5562 phantom = false; 5562 phantom = false;
5563 5563
5564 part.ScriptSetPhantomStatus(phantom); 5564 part.ScriptSetPhantomStatus(phantom);
5565 part.ScheduleFullUpdate(); 5565 part.ScheduleFullUpdate();
5566 break; 5566 break;
5567 case (int)ScriptBaseClass.PRIM_PHYSICS: 5567 case (int)ScriptBaseClass.PRIM_PHYSICS:
5568 if (remain < 1) 5568 if (remain < 1)
5569 return; 5569 return;
5570 string phy = rules.Data[idx++].ToString(); 5570 string phy = rules.Data[idx++].ToString();
5571 bool physics; 5571 bool physics;
5572 5572
5573 if (phy.Equals("1")) 5573 if (phy.Equals("1"))
5574 physics = true; 5574 physics = true;
5575 else 5575 else
5576 physics = false; 5576 physics = false;
5577 5577
5578 m_host.ScriptSetPhysicsStatus(physics); 5578 m_host.ScriptSetPhysicsStatus(physics);
5579 part.ScheduleFullUpdate(); 5579 part.ScheduleFullUpdate();
5580 break; 5580 break;
@@ -5645,7 +5645,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5645 public LSL_Types.list llGetAnimationList( string id ) 5645 public LSL_Types.list llGetAnimationList( string id )
5646 { 5646 {
5647 m_host.AddScriptLPS(1); 5647 m_host.AddScriptLPS(1);
5648 5648
5649 LSL_Types.list l = new LSL_Types.list(); 5649 LSL_Types.list l = new LSL_Types.list();
5650 ScenePresence av = World.GetScenePresence(id); 5650 ScenePresence av = World.GetScenePresence(id);
5651 if (av == null) 5651 if (av == null)
@@ -6758,7 +6758,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6758 //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) 6758 //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later)
6759 m_host.AddScriptLPS(1); 6759 m_host.AddScriptLPS(1);
6760 for (int i = 0; i < commandList.Data.Length; i++) 6760 for (int i = 0; i < commandList.Data.Length; i++)
6761 { 6761 {
6762 switch ((ParcelMediaCommandEnum)commandList.Data[i]) 6762 switch ((ParcelMediaCommandEnum)commandList.Data[i])
6763 { 6763 {
6764 case ParcelMediaCommandEnum.Play: 6764 case ParcelMediaCommandEnum.Play:
@@ -6768,7 +6768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6768 if (!agent.IsChildAgent) 6768 if (!agent.IsChildAgent)
6769 { 6769 {
6770 agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); 6770 agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0);
6771 } 6771 }
6772 } 6772 }
6773 break; 6773 break;
6774 case ParcelMediaCommandEnum.Stop: 6774 case ParcelMediaCommandEnum.Stop:
@@ -6799,7 +6799,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6799 { 6799 {
6800 //Set the new media URL only if the user is the owner of the land 6800 //Set the new media URL only if the user is the owner of the land
6801 osSetParcelMediaURL(commandList.Data[i + 1].ToString()); 6801 osSetParcelMediaURL(commandList.Data[i + 1].ToString());
6802 6802
6803 List<ScenePresence> scenePresenceList = World.GetScenePresences(); 6803 List<ScenePresence> scenePresenceList = World.GetScenePresences();
6804 LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); 6804 LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
6805 //Send an update of the mediaURL to all the clients that are in the parcel 6805 //Send an update of the mediaURL to all the clients that are in the parcel
@@ -6810,8 +6810,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6810 //Send parcel media update to the client 6810 //Send parcel media update to the client
6811 agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1); 6811 agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1);
6812 } 6812 }
6813 } 6813 }
6814 6814
6815 } 6815 }
6816 i++; 6816 i++;
6817 } 6817 }
@@ -6821,7 +6821,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6821 NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString()); 6821 NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString());
6822 break; 6822 break;
6823 }//end switch 6823 }//end switch
6824 6824
6825 } 6825 }
6826 6826
6827 6827
@@ -6864,7 +6864,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6864 } 6864 }
6865 } 6865 }
6866 return list; 6866 return list;
6867 6867
6868 } 6868 }
6869 6869
6870 public LSL_Types.LSLInteger llModPow(int a, int b, int c) 6870 public LSL_Types.LSLInteger llModPow(int a, int b, int c)
@@ -6908,7 +6908,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6908 { 6908 {
6909 m_host.AddScriptLPS(1); 6909 m_host.AddScriptLPS(1);
6910 LLUUID invItemID=InventorySelf(); 6910 LLUUID invItemID=InventorySelf();
6911 if (invItemID == LLUUID.Zero) 6911 if (invItemID == LLUUID.Zero)
6912 return new LSL_Types.Vector3(); 6912 return new LSL_Types.Vector3();
6913 if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero) 6913 if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero)
6914 return new LSL_Types.Vector3(); 6914 return new LSL_Types.Vector3();
@@ -7036,8 +7036,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7036 public void llSetCameraParams(LSL_Types.list rules) 7036 public void llSetCameraParams(LSL_Types.list rules)
7037 { 7037 {
7038 m_host.AddScriptLPS(1); 7038 m_host.AddScriptLPS(1);
7039 7039
7040 // our key in the object we are in 7040 // our key in the object we are in
7041 LLUUID invItemID=InventorySelf(); 7041 LLUUID invItemID=InventorySelf();
7042 if (invItemID == LLUUID.Zero) return; 7042 if (invItemID == LLUUID.Zero) return;
7043 7043
@@ -7051,10 +7051,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7051 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; 7051 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return;
7052 7052
7053 ScenePresence presence = World.GetScenePresence(agentID); 7053 ScenePresence presence = World.GetScenePresence(agentID);
7054 7054
7055 // we are not interested in child-agents 7055 // we are not interested in child-agents
7056 if (presence.IsChildAgent) return; 7056 if (presence.IsChildAgent) return;
7057 7057
7058 SortedDictionary<int, float> parameters = new SortedDictionary<int, float>(); 7058 SortedDictionary<int, float> parameters = new SortedDictionary<int, float>();
7059 object[] data = rules.Data; 7059 object[] data = rules.Data;
7060 for (int i = 0; i < data.Length; ++i) { 7060 for (int i = 0; i < data.Length; ++i) {
@@ -7067,8 +7067,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7067 case ScriptBaseClass.CAMERA_FOCUS_OFFSET: 7067 case ScriptBaseClass.CAMERA_FOCUS_OFFSET:
7068 case ScriptBaseClass.CAMERA_POSITION: 7068 case ScriptBaseClass.CAMERA_POSITION:
7069 LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i]; 7069 LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i];
7070 parameters.Add(type + 1, (float)v.x); 7070 parameters.Add(type + 1, (float)v.x);
7071 parameters.Add(type + 2, (float)v.y); 7071 parameters.Add(type + 2, (float)v.y);
7072 parameters.Add(type + 3, (float)v.z); 7072 parameters.Add(type + 3, (float)v.z);
7073 break; 7073 break;
7074 default: 7074 default:
@@ -7088,7 +7088,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7088 { 7088 {
7089 m_host.AddScriptLPS(1); 7089 m_host.AddScriptLPS(1);
7090 7090
7091 // our key in the object we are in 7091 // our key in the object we are in
7092 LLUUID invItemID=InventorySelf(); 7092 LLUUID invItemID=InventorySelf();
7093 if (invItemID == LLUUID.Zero) return; 7093 if (invItemID == LLUUID.Zero) return;
7094 7094
@@ -7102,10 +7102,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7102 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return; 7102 if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return;
7103 7103
7104 ScenePresence presence = World.GetScenePresence(agentID); 7104 ScenePresence presence = World.GetScenePresence(agentID);
7105 7105
7106 // we are not interested in child-agents 7106 // we are not interested in child-agents
7107 if (presence.IsChildAgent) return; 7107 if (presence.IsChildAgent) return;
7108 7108
7109 presence.ControllingClient.SendClearFollowCamProperties(objectID); 7109 presence.ControllingClient.SendClearFollowCamProperties(objectID);
7110 } 7110 }
7111 7111