aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs140
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs75
6 files changed, 156 insertions, 71 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index c84afee..81f1f38 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -843,6 +843,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
843 wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text); 843 wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text);
844 } 844 }
845 845
846 public void llRegionSayTo(string target, int channel, string msg)
847 {
848 string error = String.Empty;
849
850 if (msg.Length > 1023)
851 msg = msg.Substring(0, 1023);
852
853 m_host.AddScriptLPS(1);
854
855 UUID TargetID;
856 UUID.TryParse(target, out TargetID);
857
858 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
859 if (wComm != null)
860 if (!wComm.DeliverMessageTo(TargetID, channel, m_host.AbsolutePosition, m_host.Name, m_host.UUID, msg, out error))
861 LSLError(error);
862 }
863
846 public LSL_Integer llListen(int channelID, string name, string ID, string msg) 864 public LSL_Integer llListen(int channelID, string name, string ID, string msg)
847 { 865 {
848 m_host.AddScriptLPS(1); 866 m_host.AddScriptLPS(1);
@@ -1601,9 +1619,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1601 tex.FaceTextures[i].RGBA = texcolor; 1619 tex.FaceTextures[i].RGBA = texcolor;
1602 } 1620 }
1603 } 1621 }
1604 texcolor = tex.DefaultTexture.RGBA; 1622
1605 texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); 1623 // In some cases, the default texture can be null, eg when every face
1606 tex.DefaultTexture.RGBA = texcolor; 1624 // has a unique texture
1625 if (tex.DefaultTexture != null)
1626 {
1627 texcolor = tex.DefaultTexture.RGBA;
1628 texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
1629 tex.DefaultTexture.RGBA = texcolor;
1630 }
1631
1607 part.UpdateTexture(tex); 1632 part.UpdateTexture(tex);
1608 return; 1633 return;
1609 } 1634 }
@@ -2074,7 +2099,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2074 { 2099 {
2075 if (part.ParentGroup.RootPart.AttachmentPoint != 0) 2100 if (part.ParentGroup.RootPart.AttachmentPoint != 0)
2076 { 2101 {
2077 ScenePresence avatar = World.GetScenePresence(part.AttachedAvatar); 2102 ScenePresence avatar = World.GetScenePresence(part.ParentGroup.AttachedAvatar);
2078 if (avatar != null) 2103 if (avatar != null)
2079 { 2104 {
2080 if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0) 2105 if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0)
@@ -2218,7 +2243,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2218 2243
2219 if (m_host.IsAttachment) 2244 if (m_host.IsAttachment)
2220 { 2245 {
2221 ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.AttachedAvatar); 2246 ScenePresence avatar = m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.AttachedAvatar);
2222 vel = avatar.Velocity; 2247 vel = avatar.Velocity;
2223 } 2248 }
2224 else 2249 else
@@ -2939,8 +2964,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2939 { 2964 {
2940 m_host.AddScriptLPS(1); 2965 m_host.AddScriptLPS(1);
2941 2966
2942 if (m_host.ParentGroup.RootPart.AttachmentPoint == 0) 2967// if (m_host.ParentGroup.RootPart.AttachmentPoint == 0)
2943 return; 2968// return;
2944 2969
2945 TaskInventoryItem item; 2970 TaskInventoryItem item;
2946 2971
@@ -3006,7 +3031,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3006 3031
3007 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; 3032 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
3008 if (attachmentsModule != null) 3033 if (attachmentsModule != null)
3009 attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient); 3034 attachmentsModule.DetachSingleAttachmentToInv(itemID, presence.ControllingClient);
3010 } 3035 }
3011 3036
3012 public void llTakeCamera(string avatar) 3037 public void llTakeCamera(string avatar)
@@ -3363,7 +3388,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3363 3388
3364 m_host.AddScriptLPS(1); 3389 m_host.AddScriptLPS(1);
3365 3390
3366 if (m_host.ParentGroup.IsAttachment && (UUID)agent == m_host.ParentGroup.RootPart.AttachedAvatar) 3391 if (m_host.ParentGroup.IsAttachment && (UUID)agent == m_host.ParentGroup.AttachedAvatar)
3367 { 3392 {
3368 // When attached, certain permissions are implicit if requested from owner 3393 // When attached, certain permissions are implicit if requested from owner
3369 int implicitPerms = ScriptBaseClass.PERMISSION_TAKE_CONTROLS | 3394 int implicitPerms = ScriptBaseClass.PERMISSION_TAKE_CONTROLS |
@@ -3909,7 +3934,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3909 GridInstantMessage msg = new GridInstantMessage(World, 3934 GridInstantMessage msg = new GridInstantMessage(World,
3910 m_host.UUID, m_host.Name+", an object owned by "+ 3935 m_host.UUID, m_host.Name+", an object owned by "+
3911 resolveName(m_host.OwnerID)+",", destId, 3936 resolveName(m_host.OwnerID)+",", destId,
3912 (byte)InstantMessageDialog.InventoryOffered, 3937 (byte)InstantMessageDialog.TaskInventoryOffered,
3913 false, objName+"\n"+m_host.Name+" is located at "+ 3938 false, objName+"\n"+m_host.Name+" is located at "+
3914 World.RegionInfo.RegionName+" "+ 3939 World.RegionInfo.RegionName+" "+
3915 m_host.AbsolutePosition.ToString(), 3940 m_host.AbsolutePosition.ToString(),
@@ -6583,7 +6608,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6583 return Util.SHA1Hash(src).ToLower(); 6608 return Util.SHA1Hash(src).ToLower();
6584 } 6609 }
6585 6610
6586 protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist) 6611 protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, byte profileshape, byte pathcurve)
6587 { 6612 {
6588 ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); 6613 ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();
6589 6614
@@ -6594,7 +6619,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6594 { 6619 {
6595 holeshape = (int)ScriptBaseClass.PRIM_HOLE_DEFAULT; 6620 holeshape = (int)ScriptBaseClass.PRIM_HOLE_DEFAULT;
6596 } 6621 }
6597 shapeBlock.ProfileCurve = (byte)holeshape; 6622 shapeBlock.PathCurve = pathcurve;
6623 shapeBlock.ProfileCurve = (byte)holeshape; // Set the hole shape.
6624 shapeBlock.ProfileCurve += profileshape; // Add in the profile shape.
6598 if (cut.x < 0f) 6625 if (cut.x < 0f)
6599 { 6626 {
6600 cut.x = 0f; 6627 cut.x = 0f;
@@ -6626,9 +6653,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6626 { 6653 {
6627 hollow = 0f; 6654 hollow = 0f;
6628 } 6655 }
6629 if (hollow > 0.95) 6656 // If the prim is a Cylinder, Prism, Sphere, Torus or Ring (or not a
6657 // Box or Tube) and the hole shape is a square, hollow is limited to
6658 // a max of 70%. The viewer performs its own check on this value but
6659 // we need to do it here also so llGetPrimitiveParams can have access
6660 // to the correct value.
6661 if (profileshape != (byte)ProfileCurve.Square &&
6662 holeshape == (int)ScriptBaseClass.PRIM_HOLE_SQUARE)
6630 { 6663 {
6631 hollow = 0.95f; 6664 if (hollow > 0.70f)
6665 {
6666 hollow = 0.70f;
6667 }
6668 }
6669 // Otherwise, hollow is limited to 95%.
6670 else
6671 {
6672 if (hollow > 0.95f)
6673 {
6674 hollow = 0.95f;
6675 }
6632 } 6676 }
6633 shapeBlock.ProfileHollow = (ushort)(50000 * hollow); 6677 shapeBlock.ProfileHollow = (ushort)(50000 * hollow);
6634 if (twist.x < -1.0f) 6678 if (twist.x < -1.0f)
@@ -6652,20 +6696,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6652 6696
6653 shapeBlock.ObjectLocalID = part.LocalId; 6697 shapeBlock.ObjectLocalID = part.LocalId;
6654 6698
6655 // retain pathcurve
6656 shapeBlock.PathCurve = part.Shape.PathCurve;
6657
6658 part.Shape.SculptEntry = false; 6699 part.Shape.SculptEntry = false;
6659 return shapeBlock; 6700 return shapeBlock;
6660 } 6701 }
6661 6702
6662 protected void SetPrimitiveShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, LSL_Vector taper_b, LSL_Vector topshear, byte fudge) 6703 // Prim type box, cylinder and prism.
6704 protected void SetPrimitiveShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, LSL_Vector taper_b, LSL_Vector topshear, byte profileshape, byte pathcurve)
6663 { 6705 {
6664 ObjectShapePacket.ObjectDataBlock shapeBlock; 6706 ObjectShapePacket.ObjectDataBlock shapeBlock;
6665 6707
6666 shapeBlock = SetPrimitiveBlockShapeParams(part, holeshape, cut, hollow, twist); 6708 shapeBlock = SetPrimitiveBlockShapeParams(part, holeshape, cut, hollow, twist, profileshape, pathcurve);
6667
6668 shapeBlock.ProfileCurve += fudge;
6669 6709
6670 if (taper_b.x < 0f) 6710 if (taper_b.x < 0f)
6671 { 6711 {
@@ -6708,18 +6748,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6708 part.UpdateShape(shapeBlock); 6748 part.UpdateShape(shapeBlock);
6709 } 6749 }
6710 6750
6711 protected void SetPrimitiveShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, LSL_Vector dimple, byte fudge) 6751 // Prim type sphere.
6752 protected void SetPrimitiveShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, LSL_Vector dimple, byte profileshape, byte pathcurve)
6712 { 6753 {
6713 ObjectShapePacket.ObjectDataBlock shapeBlock; 6754 ObjectShapePacket.ObjectDataBlock shapeBlock;
6714 6755
6715 shapeBlock = SetPrimitiveBlockShapeParams(part, holeshape, cut, hollow, twist); 6756 shapeBlock = SetPrimitiveBlockShapeParams(part, holeshape, cut, hollow, twist, profileshape, pathcurve);
6716 6757
6717 // profile/path swapped for a sphere 6758 // profile/path swapped for a sphere
6718 shapeBlock.PathBegin = shapeBlock.ProfileBegin; 6759 shapeBlock.PathBegin = shapeBlock.ProfileBegin;
6719 shapeBlock.PathEnd = shapeBlock.ProfileEnd; 6760 shapeBlock.PathEnd = shapeBlock.ProfileEnd;
6720 6761
6721 shapeBlock.ProfileCurve += fudge;
6722
6723 shapeBlock.PathScaleX = 100; 6762 shapeBlock.PathScaleX = 100;
6724 shapeBlock.PathScaleY = 100; 6763 shapeBlock.PathScaleY = 100;
6725 6764
@@ -6750,13 +6789,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6750 part.UpdateShape(shapeBlock); 6789 part.UpdateShape(shapeBlock);
6751 } 6790 }
6752 6791
6753 protected void SetPrimitiveShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, LSL_Vector holesize, LSL_Vector topshear, LSL_Vector profilecut, LSL_Vector taper_a, float revolutions, float radiusoffset, float skew, byte fudge) 6792 // Prim type torus, tube and ring.
6793 protected void SetPrimitiveShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, LSL_Vector holesize, LSL_Vector topshear, LSL_Vector profilecut, LSL_Vector taper_a, float revolutions, float radiusoffset, float skew, byte profileshape, byte pathcurve)
6754 { 6794 {
6755 ObjectShapePacket.ObjectDataBlock shapeBlock; 6795 ObjectShapePacket.ObjectDataBlock shapeBlock;
6756 6796
6757 shapeBlock = SetPrimitiveBlockShapeParams(part, holeshape, cut, hollow, twist); 6797 shapeBlock = SetPrimitiveBlockShapeParams(part, holeshape, cut, hollow, twist, profileshape, pathcurve);
6758
6759 shapeBlock.ProfileCurve += fudge;
6760 6798
6761 // profile/path swapped for a torrus, tube, ring 6799 // profile/path swapped for a torrus, tube, ring
6762 shapeBlock.PathBegin = shapeBlock.ProfileBegin; 6800 shapeBlock.PathBegin = shapeBlock.ProfileBegin;
@@ -6876,7 +6914,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6876 part.UpdateShape(shapeBlock); 6914 part.UpdateShape(shapeBlock);
6877 } 6915 }
6878 6916
6879 protected void SetPrimitiveShapeParams(SceneObjectPart part, string map, int type) 6917 // Prim type sculpt.
6918 protected void SetPrimitiveShapeParams(SceneObjectPart part, string map, int type, byte pathcurve)
6880 { 6919 {
6881 ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); 6920 ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();
6882 UUID sculptId; 6921 UUID sculptId;
@@ -6889,6 +6928,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6889 if (sculptId == UUID.Zero) 6928 if (sculptId == UUID.Zero)
6890 return; 6929 return;
6891 6930
6931 shapeBlock.PathCurve = pathcurve;
6892 shapeBlock.ObjectLocalID = part.LocalId; 6932 shapeBlock.ObjectLocalID = part.LocalId;
6893 shapeBlock.PathScaleX = 100; 6933 shapeBlock.PathScaleX = 100;
6894 shapeBlock.PathScaleY = 150; 6934 shapeBlock.PathScaleY = 150;
@@ -6902,9 +6942,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6902 type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; 6942 type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE;
6903 } 6943 }
6904 6944
6905 // retain pathcurve
6906 shapeBlock.PathCurve = part.Shape.PathCurve;
6907
6908 part.Shape.SetSculptProperties((byte)type, sculptId); 6945 part.Shape.SetSculptProperties((byte)type, sculptId);
6909 part.Shape.SculptEntry = true; 6946 part.Shape.SculptEntry = true;
6910 part.UpdateShape(shapeBlock); 6947 part.UpdateShape(shapeBlock);
@@ -7028,8 +7065,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7028 taper_b = rules.GetVector3Item(idx++); 7065 taper_b = rules.GetVector3Item(idx++);
7029 topshear = rules.GetVector3Item(idx++); 7066 topshear = rules.GetVector3Item(idx++);
7030 7067
7031 part.Shape.PathCurve = (byte)Extrusion.Straight; 7068 SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear,
7032 SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear, 1); 7069 (byte)ProfileShape.Square, (byte)Extrusion.Straight);
7033 break; 7070 break;
7034 7071
7035 case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: 7072 case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER:
@@ -7042,9 +7079,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7042 twist = rules.GetVector3Item(idx++); 7079 twist = rules.GetVector3Item(idx++);
7043 taper_b = rules.GetVector3Item(idx++); 7080 taper_b = rules.GetVector3Item(idx++);
7044 topshear = rules.GetVector3Item(idx++); 7081 topshear = rules.GetVector3Item(idx++);
7045 part.Shape.ProfileShape = ProfileShape.Circle; 7082 SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear,
7046 part.Shape.PathCurve = (byte)Extrusion.Straight; 7083 (byte)ProfileShape.Circle, (byte)Extrusion.Straight);
7047 SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear, 0);
7048 break; 7084 break;
7049 7085
7050 case (int)ScriptBaseClass.PRIM_TYPE_PRISM: 7086 case (int)ScriptBaseClass.PRIM_TYPE_PRISM:
@@ -7057,8 +7093,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7057 twist = rules.GetVector3Item(idx++); 7093 twist = rules.GetVector3Item(idx++);
7058 taper_b = rules.GetVector3Item(idx++); 7094 taper_b = rules.GetVector3Item(idx++);
7059 topshear = rules.GetVector3Item(idx++); 7095 topshear = rules.GetVector3Item(idx++);
7060 part.Shape.PathCurve = (byte)Extrusion.Straight; 7096 SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear,
7061 SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear, 3); 7097 (byte)ProfileShape.EquilateralTriangle, (byte)Extrusion.Straight);
7062 break; 7098 break;
7063 7099
7064 case (int)ScriptBaseClass.PRIM_TYPE_SPHERE: 7100 case (int)ScriptBaseClass.PRIM_TYPE_SPHERE:
@@ -7070,8 +7106,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7070 hollow = (float)rules.GetLSLFloatItem(idx++); 7106 hollow = (float)rules.GetLSLFloatItem(idx++);
7071 twist = rules.GetVector3Item(idx++); 7107 twist = rules.GetVector3Item(idx++);
7072 taper_b = rules.GetVector3Item(idx++); // dimple 7108 taper_b = rules.GetVector3Item(idx++); // dimple
7073 part.Shape.PathCurve = (byte)Extrusion.Curve1; 7109 SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b,
7074 SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, 5); 7110 (byte)ProfileShape.HalfCircle, (byte)Extrusion.Curve1);
7075 break; 7111 break;
7076 7112
7077 case (int)ScriptBaseClass.PRIM_TYPE_TORUS: 7113 case (int)ScriptBaseClass.PRIM_TYPE_TORUS:
@@ -7089,9 +7125,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7089 revolutions = (float)rules.GetLSLFloatItem(idx++); 7125 revolutions = (float)rules.GetLSLFloatItem(idx++);
7090 radiusoffset = (float)rules.GetLSLFloatItem(idx++); 7126 radiusoffset = (float)rules.GetLSLFloatItem(idx++);
7091 skew = (float)rules.GetLSLFloatItem(idx++); 7127 skew = (float)rules.GetLSLFloatItem(idx++);
7092 part.Shape.PathCurve = (byte)Extrusion.Curve1;
7093 SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, 7128 SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
7094 revolutions, radiusoffset, skew, 0); 7129 revolutions, radiusoffset, skew, (byte)ProfileShape.Circle, (byte)Extrusion.Curve1);
7095 break; 7130 break;
7096 7131
7097 case (int)ScriptBaseClass.PRIM_TYPE_TUBE: 7132 case (int)ScriptBaseClass.PRIM_TYPE_TUBE:
@@ -7109,9 +7144,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7109 revolutions = (float)rules.GetLSLFloatItem(idx++); 7144 revolutions = (float)rules.GetLSLFloatItem(idx++);
7110 radiusoffset = (float)rules.GetLSLFloatItem(idx++); 7145 radiusoffset = (float)rules.GetLSLFloatItem(idx++);
7111 skew = (float)rules.GetLSLFloatItem(idx++); 7146 skew = (float)rules.GetLSLFloatItem(idx++);
7112 part.Shape.PathCurve = (byte)Extrusion.Curve1;
7113 SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, 7147 SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
7114 revolutions, radiusoffset, skew, 1); 7148 revolutions, radiusoffset, skew, (byte)ProfileShape.Square, (byte)Extrusion.Curve1);
7115 break; 7149 break;
7116 7150
7117 case (int)ScriptBaseClass.PRIM_TYPE_RING: 7151 case (int)ScriptBaseClass.PRIM_TYPE_RING:
@@ -7129,9 +7163,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7129 revolutions = (float)rules.GetLSLFloatItem(idx++); 7163 revolutions = (float)rules.GetLSLFloatItem(idx++);
7130 radiusoffset = (float)rules.GetLSLFloatItem(idx++); 7164 radiusoffset = (float)rules.GetLSLFloatItem(idx++);
7131 skew = (float)rules.GetLSLFloatItem(idx++); 7165 skew = (float)rules.GetLSLFloatItem(idx++);
7132 part.Shape.PathCurve = (byte)Extrusion.Curve1;
7133 SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, 7166 SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
7134 revolutions, radiusoffset, skew, 3); 7167 revolutions, radiusoffset, skew, (byte)ProfileShape.EquilateralTriangle, (byte)Extrusion.Curve1);
7135 break; 7168 break;
7136 7169
7137 case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: 7170 case (int)ScriptBaseClass.PRIM_TYPE_SCULPT:
@@ -7140,8 +7173,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7140 7173
7141 string map = rules.Data[idx++].ToString(); 7174 string map = rules.Data[idx++].ToString();
7142 face = (int)rules.GetLSLIntegerItem(idx++); // type 7175 face = (int)rules.GetLSLIntegerItem(idx++); // type
7143 part.Shape.PathCurve = (byte)Extrusion.Curve1; 7176 SetPrimitiveShapeParams(part, map, face, (byte)Extrusion.Curve1);
7144 SetPrimitiveShapeParams(part, map, face);
7145 break; 7177 break;
7146 } 7178 }
7147 7179
@@ -7428,7 +7460,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7428 Quaternion q; 7460 Quaternion q;
7429 if (m_host.ParentGroup.RootPart.AttachmentPoint != 0) 7461 if (m_host.ParentGroup.RootPart.AttachmentPoint != 0)
7430 { 7462 {
7431 ScenePresence avatar = World.GetScenePresence(m_host.AttachedAvatar); 7463 ScenePresence avatar = World.GetScenePresence(m_host.ParentGroup.AttachedAvatar);
7432 if (avatar != null) 7464 if (avatar != null)
7433 if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0) 7465 if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0)
7434 q = avatar.CameraRotation; // Mouselook 7466 q = avatar.CameraRotation; // Mouselook
@@ -10486,12 +10518,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10486 NotImplemented("llGetUsedMemory"); 10518 NotImplemented("llGetUsedMemory");
10487 } 10519 }
10488 10520
10489 public void llRegionSayTo(LSL_Key target, LSL_Integer channel, LSL_String msg)
10490 {
10491 m_host.AddScriptLPS(1);
10492 NotImplemented("llRegionSayTo");
10493 }
10494
10495 public void llScriptProfiler(LSL_Integer flags) 10521 public void llScriptProfiler(LSL_Integer flags)
10496 { 10522 {
10497 m_host.AddScriptLPS(1); 10523 m_host.AddScriptLPS(1);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index e53a61a..bf74760 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -308,7 +308,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
308 // In attachments, the sensor cone always orients with the 308 // In attachments, the sensor cone always orients with the
309 // avatar rotation. This may include a nonzero elevation if 309 // avatar rotation. This may include a nonzero elevation if
310 // in mouselook. 310 // in mouselook.
311 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.RootPart.AttachedAvatar); 311 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
312 q = avatar.Rotation; 312 q = avatar.Rotation;
313 } 313 }
314 LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); 314 LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
@@ -428,7 +428,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
428 // In attachments, the sensor cone always orients with the 428 // In attachments, the sensor cone always orients with the
429 // avatar rotation. This may include a nonzero elevation if 429 // avatar rotation. This may include a nonzero elevation if
430 // in mouselook. 430 // in mouselook.
431 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.RootPart.AttachedAvatar); 431 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
432 q = avatar.Rotation; 432 q = avatar.Rotation;
433 } 433 }
434 434
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
index 27f9c84..4d7d60d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
@@ -271,6 +271,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
271 void llPushObject(string target, LSL_Vector impulse, LSL_Vector ang_impulse, int local); 271 void llPushObject(string target, LSL_Vector impulse, LSL_Vector ang_impulse, int local);
272 void llRefreshPrimURL(); 272 void llRefreshPrimURL();
273 void llRegionSay(int channelID, string text); 273 void llRegionSay(int channelID, string text);
274 void llRegionSayTo(string target, int channelID, string text);
274 void llReleaseCamera(string avatar); 275 void llReleaseCamera(string avatar);
275 void llReleaseControls(); 276 void llReleaseControls();
276 void llReleaseURL(string url); 277 void llReleaseURL(string url);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
index 303d75e..96e46fd 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
@@ -1199,6 +1199,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
1199 m_LSL_Functions.llRegionSay(channelID, text); 1199 m_LSL_Functions.llRegionSay(channelID, text);
1200 } 1200 }
1201 1201
1202 public void llRegionSayTo(string key, int channelID, string text)
1203 {
1204 m_LSL_Functions.llRegionSayTo(key, channelID, text);
1205 }
1206
1202 public void llReleaseCamera(string avatar) 1207 public void llReleaseCamera(string avatar)
1203 { 1208 {
1204 m_LSL_Functions.llReleaseCamera(avatar); 1209 m_LSL_Functions.llReleaseCamera(avatar);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 783791f..ef9b2ac 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -233,7 +233,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
233 m_MaxScriptQueue = maxScriptQueue; 233 m_MaxScriptQueue = maxScriptQueue;
234 m_stateSource = stateSource; 234 m_stateSource = stateSource;
235 m_postOnRez = postOnRez; 235 m_postOnRez = postOnRez;
236 m_AttachedAvatar = part.AttachedAvatar; 236 m_AttachedAvatar = part.ParentGroup.AttachedAvatar;
237 m_RegionID = part.ParentGroup.Scene.RegionInfo.RegionID; 237 m_RegionID = part.ParentGroup.Scene.RegionInfo.RegionID;
238 238
239 if (part != null) 239 if (part != null)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
index 623c82d..8cd1e84 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
@@ -182,6 +182,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
182 Vector3.Zero) { Name = obj1Name, UUID = objUuid }; 182 Vector3.Zero) { Name = obj1Name, UUID = objUuid };
183 Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True); 183 Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True);
184 184
185 // Note that prim hollow check is passed with the other prim params in order to allow the
186 // specification of a different check value from the prim param. A cylinder, prism, sphere,
187 // torus or ring, with a hole shape of square, is limited to a hollow of 70%. Test 5 below
188 // specifies a value of 95% and checks to see if 70% was properly returned.
189
185 // Test a sphere. 190 // Test a sphere.
186 CheckllSetPrimitiveParams( 191 CheckllSetPrimitiveParams(
187 "test 1", // Prim test identification string 192 "test 1", // Prim test identification string
@@ -191,7 +196,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
191 new LSL_Types.Vector3(0.0d, 0.075d, 0.0d), // Prim cut 196 new LSL_Types.Vector3(0.0d, 0.075d, 0.0d), // Prim cut
192 0.80d, // Prim hollow 197 0.80d, // Prim hollow
193 new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), // Prim twist 198 new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), // Prim twist
194 new LSL_Types.Vector3(0.32d, 0.76d, 0.0d)); // Prim dimple 199 new LSL_Types.Vector3(0.32d, 0.76d, 0.0d), // Prim dimple
200 0.80d); // Prim hollow check
195 201
196 // Test a prism. 202 // Test a prism.
197 CheckllSetPrimitiveParams( 203 CheckllSetPrimitiveParams(
@@ -203,7 +209,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
203 0.90d, // Prim hollow 209 0.90d, // Prim hollow
204 new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), // Prim twist 210 new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), // Prim twist
205 new LSL_Types.Vector3(2.0d, 1.0d, 0.0d), // Prim taper 211 new LSL_Types.Vector3(2.0d, 1.0d, 0.0d), // Prim taper
206 new LSL_Types.Vector3(0.0d, 0.0d, 0.0d)); // Prim shear 212 new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), // Prim shear
213 0.90d); // Prim hollow check
207 214
208 // Test a box. 215 // Test a box.
209 CheckllSetPrimitiveParams( 216 CheckllSetPrimitiveParams(
@@ -212,10 +219,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
212 ScriptBaseClass.PRIM_TYPE_BOX, // Prim type 219 ScriptBaseClass.PRIM_TYPE_BOX, // Prim type
213 ScriptBaseClass.PRIM_HOLE_TRIANGLE, // Prim hole type 220 ScriptBaseClass.PRIM_HOLE_TRIANGLE, // Prim hole type
214 new LSL_Types.Vector3(0.0d, 1.0d, 0.0d), // Prim cut 221 new LSL_Types.Vector3(0.0d, 1.0d, 0.0d), // Prim cut
215 0.90d, // Prim hollow 222 0.95d, // Prim hollow
216 new LSL_Types.Vector3(1.0d, 0.0d, 0.0d), // Prim twist 223 new LSL_Types.Vector3(1.0d, 0.0d, 0.0d), // Prim twist
217 new LSL_Types.Vector3(1.0d, 1.0d, 0.0d), // Prim taper 224 new LSL_Types.Vector3(1.0d, 1.0d, 0.0d), // Prim taper
218 new LSL_Types.Vector3(0.0d, 0.0d, 0.0d)); // Prim shear 225 new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), // Prim shear
226 0.95d); // Prim hollow check
219 227
220 // Test a tube. 228 // Test a tube.
221 CheckllSetPrimitiveParams( 229 CheckllSetPrimitiveParams(
@@ -232,13 +240,36 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
232 new LSL_Types.Vector3(-1.0d, 1.0d, 0.0d), // Prim taper 240 new LSL_Types.Vector3(-1.0d, 1.0d, 0.0d), // Prim taper
233 1.0d, // Prim revolutions 241 1.0d, // Prim revolutions
234 1.0d, // Prim radius 242 1.0d, // Prim radius
235 0.0d); // Prim skew 243 0.0d, // Prim skew
244 0.00d); // Prim hollow check
245
246 // Test a prism.
247 CheckllSetPrimitiveParams(
248 "test 5", // Prim test identification string
249 new LSL_Types.Vector3(3.5d, 3.5d, 3.5d), // Prim size
250 ScriptBaseClass.PRIM_TYPE_PRISM, // Prim type
251 ScriptBaseClass.PRIM_HOLE_SQUARE, // Prim hole type
252 new LSL_Types.Vector3(0.0d, 1.0d, 0.0d), // Prim cut
253 0.95d, // Prim hollow
254 new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), // Prim twist
255 new LSL_Types.Vector3(2.0d, 1.0d, 0.0d), // Prim taper
256 new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), // Prim shear
257 0.70d); // Prim hollow check
258
259 // Test a sculpted prim.
260 CheckllSetPrimitiveParams(
261 "test 6", // Prim test identification string
262 new LSL_Types.Vector3(2.0d, 2.0d, 2.0d), // Prim size
263 ScriptBaseClass.PRIM_TYPE_SCULPT, // Prim type
264 "be293869-d0d9-0a69-5989-ad27f1946fd4", // Prim map
265 ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE); // Prim sculpt type
236 } 266 }
237 267
238 // Set prim params for a box, cylinder or prism and check results. 268 // Set prim params for a box, cylinder or prism and check results.
239 public void CheckllSetPrimitiveParams(string primTest, 269 public void CheckllSetPrimitiveParams(string primTest,
240 LSL_Types.Vector3 primSize, int primType, int primHoleType, LSL_Types.Vector3 primCut, 270 LSL_Types.Vector3 primSize, int primType, int primHoleType, LSL_Types.Vector3 primCut,
241 double primHollow, LSL_Types.Vector3 primTwist, LSL_Types.Vector3 primTaper, LSL_Types.Vector3 primShear) 271 double primHollow, LSL_Types.Vector3 primTwist, LSL_Types.Vector3 primTaper, LSL_Types.Vector3 primShear,
272 double primHollowCheck)
242 { 273 {
243 // Set the prim params. 274 // Set the prim params.
244 m_lslApi.llSetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, primSize, 275 m_lslApi.llSetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, primSize,
@@ -256,7 +287,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
256 Assert.AreEqual(primHoleType, m_lslApi.llList2Integer(primParams, 2), 287 Assert.AreEqual(primHoleType, m_lslApi.llList2Integer(primParams, 2),
257 "TestllSetPrimitiveParams " + primTest + " prim hole default check fail"); 288 "TestllSetPrimitiveParams " + primTest + " prim hole default check fail");
258 CheckllSetPrimitiveParamsVector(primCut, m_lslApi.llList2Vector(primParams, 3), primTest + " prim cut"); 289 CheckllSetPrimitiveParamsVector(primCut, m_lslApi.llList2Vector(primParams, 3), primTest + " prim cut");
259 Assert.AreEqual(primHollow, m_lslApi.llList2Float(primParams, 4), FLOAT_ACCURACY, 290 Assert.AreEqual(primHollowCheck, m_lslApi.llList2Float(primParams, 4), FLOAT_ACCURACY,
260 "TestllSetPrimitiveParams " + primTest + " prim hollow check fail"); 291 "TestllSetPrimitiveParams " + primTest + " prim hollow check fail");
261 CheckllSetPrimitiveParamsVector(primTwist, m_lslApi.llList2Vector(primParams, 5), primTest + " prim twist"); 292 CheckllSetPrimitiveParamsVector(primTwist, m_lslApi.llList2Vector(primParams, 5), primTest + " prim twist");
262 CheckllSetPrimitiveParamsVector(primTaper, m_lslApi.llList2Vector(primParams, 6), primTest + " prim taper"); 293 CheckllSetPrimitiveParamsVector(primTaper, m_lslApi.llList2Vector(primParams, 6), primTest + " prim taper");
@@ -266,7 +297,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
266 // Set prim params for a sphere and check results. 297 // Set prim params for a sphere and check results.
267 public void CheckllSetPrimitiveParams(string primTest, 298 public void CheckllSetPrimitiveParams(string primTest,
268 LSL_Types.Vector3 primSize, int primType, int primHoleType, LSL_Types.Vector3 primCut, 299 LSL_Types.Vector3 primSize, int primType, int primHoleType, LSL_Types.Vector3 primCut,
269 double primHollow, LSL_Types.Vector3 primTwist, LSL_Types.Vector3 primDimple) 300 double primHollow, LSL_Types.Vector3 primTwist, LSL_Types.Vector3 primDimple, double primHollowCheck)
270 { 301 {
271 // Set the prim params. 302 // Set the prim params.
272 m_lslApi.llSetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, primSize, 303 m_lslApi.llSetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, primSize,
@@ -284,7 +315,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
284 Assert.AreEqual(primHoleType, m_lslApi.llList2Integer(primParams, 2), 315 Assert.AreEqual(primHoleType, m_lslApi.llList2Integer(primParams, 2),
285 "TestllSetPrimitiveParams " + primTest + " prim hole default check fail"); 316 "TestllSetPrimitiveParams " + primTest + " prim hole default check fail");
286 CheckllSetPrimitiveParamsVector(primCut, m_lslApi.llList2Vector(primParams, 3), primTest + " prim cut"); 317 CheckllSetPrimitiveParamsVector(primCut, m_lslApi.llList2Vector(primParams, 3), primTest + " prim cut");
287 Assert.AreEqual(primHollow, m_lslApi.llList2Float(primParams, 4), FLOAT_ACCURACY, 318 Assert.AreEqual(primHollowCheck, m_lslApi.llList2Float(primParams, 4), FLOAT_ACCURACY,
288 "TestllSetPrimitiveParams " + primTest + " prim hollow check fail"); 319 "TestllSetPrimitiveParams " + primTest + " prim hollow check fail");
289 CheckllSetPrimitiveParamsVector(primTwist, m_lslApi.llList2Vector(primParams, 5), primTest + " prim twist"); 320 CheckllSetPrimitiveParamsVector(primTwist, m_lslApi.llList2Vector(primParams, 5), primTest + " prim twist");
290 CheckllSetPrimitiveParamsVector(primDimple, m_lslApi.llList2Vector(primParams, 6), primTest + " prim dimple"); 321 CheckllSetPrimitiveParamsVector(primDimple, m_lslApi.llList2Vector(primParams, 6), primTest + " prim dimple");
@@ -295,7 +326,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
295 LSL_Types.Vector3 primSize, int primType, int primHoleType, LSL_Types.Vector3 primCut, 326 LSL_Types.Vector3 primSize, int primType, int primHoleType, LSL_Types.Vector3 primCut,
296 double primHollow, LSL_Types.Vector3 primTwist, LSL_Types.Vector3 primHoleSize, 327 double primHollow, LSL_Types.Vector3 primTwist, LSL_Types.Vector3 primHoleSize,
297 LSL_Types.Vector3 primShear, LSL_Types.Vector3 primProfCut, LSL_Types.Vector3 primTaper, 328 LSL_Types.Vector3 primShear, LSL_Types.Vector3 primProfCut, LSL_Types.Vector3 primTaper,
298 double primRev, double primRadius, double primSkew) 329 double primRev, double primRadius, double primSkew, double primHollowCheck)
299 { 330 {
300 // Set the prim params. 331 // Set the prim params.
301 m_lslApi.llSetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, primSize, 332 m_lslApi.llSetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, primSize,
@@ -314,7 +345,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
314 Assert.AreEqual(primHoleType, m_lslApi.llList2Integer(primParams, 2), 345 Assert.AreEqual(primHoleType, m_lslApi.llList2Integer(primParams, 2),
315 "TestllSetPrimitiveParams " + primTest + " prim hole default check fail"); 346 "TestllSetPrimitiveParams " + primTest + " prim hole default check fail");
316 CheckllSetPrimitiveParamsVector(primCut, m_lslApi.llList2Vector(primParams, 3), primTest + " prim cut"); 347 CheckllSetPrimitiveParamsVector(primCut, m_lslApi.llList2Vector(primParams, 3), primTest + " prim cut");
317 Assert.AreEqual(primHollow, m_lslApi.llList2Float(primParams, 4), FLOAT_ACCURACY, 348 Assert.AreEqual(primHollowCheck, m_lslApi.llList2Float(primParams, 4), FLOAT_ACCURACY,
318 "TestllSetPrimitiveParams " + primTest + " prim hollow check fail"); 349 "TestllSetPrimitiveParams " + primTest + " prim hollow check fail");
319 CheckllSetPrimitiveParamsVector(primTwist, m_lslApi.llList2Vector(primParams, 5), primTest + " prim twist"); 350 CheckllSetPrimitiveParamsVector(primTwist, m_lslApi.llList2Vector(primParams, 5), primTest + " prim twist");
320 CheckllSetPrimitiveParamsVector(primHoleSize, m_lslApi.llList2Vector(primParams, 6), primTest + " prim hole size"); 351 CheckllSetPrimitiveParamsVector(primHoleSize, m_lslApi.llList2Vector(primParams, 6), primTest + " prim hole size");
@@ -329,6 +360,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
329 "TestllSetPrimitiveParams " + primTest + " prim skew fail"); 360 "TestllSetPrimitiveParams " + primTest + " prim skew fail");
330 } 361 }
331 362
363 // Set prim params for a sculpted prim and check results.
364 public void CheckllSetPrimitiveParams(string primTest,
365 LSL_Types.Vector3 primSize, int primType, string primMap, int primSculptType)
366 {
367 // Set the prim params.
368 m_lslApi.llSetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, primSize,
369 ScriptBaseClass.PRIM_TYPE, primType, primMap, primSculptType));
370
371 // Get params for prim to validate settings.
372 LSL_Types.list primParams =
373 m_lslApi.llGetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, ScriptBaseClass.PRIM_TYPE));
374
375 // Validate settings.
376 CheckllSetPrimitiveParamsVector(primSize, m_lslApi.llList2Vector(primParams, 0), primTest + " prim size");
377 Assert.AreEqual(primType, m_lslApi.llList2Integer(primParams, 1),
378 "TestllSetPrimitiveParams " + primTest + " prim type check fail");
379 Assert.AreEqual(primMap, (string)m_lslApi.llList2String(primParams, 2),
380 "TestllSetPrimitiveParams " + primTest + " prim map check fail");
381 Assert.AreEqual(primSculptType, m_lslApi.llList2Integer(primParams, 3),
382 "TestllSetPrimitiveParams " + primTest + " prim type scuplt check fail");
383 }
384
332 public void CheckllSetPrimitiveParamsVector(LSL_Types.Vector3 vecCheck, LSL_Types.Vector3 vecReturned, string msg) 385 public void CheckllSetPrimitiveParamsVector(LSL_Types.Vector3 vecCheck, LSL_Types.Vector3 vecReturned, string msg)
333 { 386 {
334 // Check each vector component against expected result. 387 // Check each vector component against expected result.