diff options
author | Charles Krinke | 2008-07-02 23:19:00 +0000 |
---|---|---|
committer | Charles Krinke | 2008-07-02 23:19:00 +0000 |
commit | 35ec3b7a3f54548ac34a42d7e1df987ae4bf3571 (patch) | |
tree | 61958f857348cb59b0767efedc7fbd3f8bd77313 /OpenSim/Region | |
parent | * Allow archiver to operate even if there are 0 scene objects to save (diff) | |
download | opensim-SC_OLD-35ec3b7a3f54548ac34a42d7e1df987ae4bf3571.zip opensim-SC_OLD-35ec3b7a3f54548ac34a42d7e1df987ae4bf3571.tar.gz opensim-SC_OLD-35ec3b7a3f54548ac34a42d7e1df987ae4bf3571.tar.bz2 opensim-SC_OLD-35ec3b7a3f54548ac34a42d7e1df987ae4bf3571.tar.xz |
Mantis#1649. Thank you kindly, Matth for a patch that:
This patch adds the ability to set the prim type using llSetPrimitiveParams().
Seems to work ok, but there are a staggering number of cases to test,
so I have not yet tested them all.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 470 |
1 files changed, 463 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 7122d65..aa4fb13 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -34,6 +34,7 @@ using System.Threading; | |||
34 | using Nini.Config; | 34 | using Nini.Config; |
35 | using Axiom.Math; | 35 | using Axiom.Math; |
36 | using libsecondlife; | 36 | using libsecondlife; |
37 | using libsecondlife.Packets; | ||
37 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Communications.Cache; | 39 | using OpenSim.Framework.Communications.Cache; |
39 | using OpenSim.Region.Environment; | 40 | using OpenSim.Region.Environment; |
@@ -4778,6 +4779,316 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4778 | m_host.AddScriptLPS(1); | 4779 | m_host.AddScriptLPS(1); |
4779 | return Util.Md5Hash(src + ":" + nonce.ToString()); | 4780 | return Util.Md5Hash(src + ":" + nonce.ToString()); |
4780 | } | 4781 | } |
4782 | |||
4783 | private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist) | ||
4784 | { | ||
4785 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); | ||
4786 | |||
4787 | if (holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_DEFAULT && | ||
4788 | holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_CIRCLE && | ||
4789 | holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_SQUARE && | ||
4790 | holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_TRIANGLE) | ||
4791 | { | ||
4792 | holeshape = (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_DEFAULT; | ||
4793 | } | ||
4794 | shapeBlock.ProfileCurve = (byte)holeshape; | ||
4795 | if (cut.x < 0f) | ||
4796 | { | ||
4797 | cut.x = 0f; | ||
4798 | } | ||
4799 | if (cut.x > 1f) | ||
4800 | { | ||
4801 | cut.x = 1f; | ||
4802 | } | ||
4803 | if (cut.y < 0f) | ||
4804 | { | ||
4805 | cut.y = 0f; | ||
4806 | } | ||
4807 | if (cut.y > 1f) | ||
4808 | { | ||
4809 | cut.y = 1f; | ||
4810 | } | ||
4811 | if (cut.y - cut.x < 0.05f) | ||
4812 | { | ||
4813 | cut.x = cut.y - 0.05f; | ||
4814 | } | ||
4815 | shapeBlock.ProfileBegin = (ushort)(50000 * cut.x); | ||
4816 | shapeBlock.ProfileEnd = (ushort)(50000 * (1 - cut.y)); | ||
4817 | if (hollow < 0f) | ||
4818 | { | ||
4819 | hollow = 0f; | ||
4820 | } | ||
4821 | if (hollow > 0.95) | ||
4822 | { | ||
4823 | hollow = 0.95f; | ||
4824 | } | ||
4825 | shapeBlock.ProfileHollow = (ushort)(50000 * hollow); | ||
4826 | if (twist.x < -0.5f) | ||
4827 | { | ||
4828 | twist.x = -0.5f; | ||
4829 | } | ||
4830 | if (twist.x > 0.5f) | ||
4831 | { | ||
4832 | twist.x = 0.5f; | ||
4833 | } | ||
4834 | if (twist.y < -0.5f) | ||
4835 | { | ||
4836 | twist.y = -0.5f; | ||
4837 | } | ||
4838 | if (twist.y > 0.5f) | ||
4839 | { | ||
4840 | twist.y = 0.5f; | ||
4841 | } | ||
4842 | shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x); | ||
4843 | shapeBlock.PathTwist = (sbyte)(200 * twist.y); | ||
4844 | |||
4845 | shapeBlock.ObjectLocalID = m_host.LocalId; | ||
4846 | |||
4847 | // retain pathcurve | ||
4848 | shapeBlock.PathCurve = m_host.Shape.PathCurve; | ||
4849 | |||
4850 | return shapeBlock; | ||
4851 | } | ||
4852 | |||
4853 | 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) | ||
4854 | { | ||
4855 | ObjectShapePacket.ObjectDataBlock shapeBlock; | ||
4856 | |||
4857 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | ||
4858 | |||
4859 | shapeBlock.ProfileCurve += fudge; | ||
4860 | |||
4861 | if (taper_b.x < 0f) | ||
4862 | { | ||
4863 | taper_b.x = 0f; | ||
4864 | } | ||
4865 | if (taper_b.x > 2f) | ||
4866 | { | ||
4867 | taper_b.x = 2f; | ||
4868 | } | ||
4869 | if (taper_b.y < 0f) | ||
4870 | { | ||
4871 | taper_b.y = 0f; | ||
4872 | } | ||
4873 | if (taper_b.y > 2f) | ||
4874 | { | ||
4875 | taper_b.y = 2f; | ||
4876 | } | ||
4877 | shapeBlock.PathScaleX = (byte)(100 * taper_b.x); | ||
4878 | shapeBlock.PathScaleY = (byte)(100 * taper_b.y); | ||
4879 | if (topshear.x < -0.5f) | ||
4880 | { | ||
4881 | topshear.x = -0.5f; | ||
4882 | } | ||
4883 | if (topshear.x > 0.5f) | ||
4884 | { | ||
4885 | topshear.x = 0.5f; | ||
4886 | } | ||
4887 | if (topshear.y < -0.5f) | ||
4888 | { | ||
4889 | topshear.y = -0.5f; | ||
4890 | } | ||
4891 | if (topshear.y > 0.5f) | ||
4892 | { | ||
4893 | topshear.y = 0.5f; | ||
4894 | } | ||
4895 | shapeBlock.PathShearX = (byte)(100 * topshear.x); | ||
4896 | shapeBlock.PathShearY = (byte)(100 * topshear.y); | ||
4897 | |||
4898 | m_host.UpdateShape(shapeBlock); | ||
4899 | } | ||
4900 | |||
4901 | private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge) | ||
4902 | { | ||
4903 | ObjectShapePacket.ObjectDataBlock shapeBlock; | ||
4904 | |||
4905 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | ||
4906 | |||
4907 | // profile/path swapped for a sphere | ||
4908 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; | ||
4909 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; | ||
4910 | |||
4911 | shapeBlock.ProfileCurve += fudge; | ||
4912 | |||
4913 | shapeBlock.PathScaleX = 100; | ||
4914 | shapeBlock.PathScaleY = 100; | ||
4915 | |||
4916 | if (dimple.x < 0f) | ||
4917 | { | ||
4918 | dimple.x = 0f; | ||
4919 | } | ||
4920 | if (dimple.x > 1f) | ||
4921 | { | ||
4922 | dimple.x = 1f; | ||
4923 | } | ||
4924 | if (dimple.y < 0f) | ||
4925 | { | ||
4926 | dimple.y = 0f; | ||
4927 | } | ||
4928 | if (dimple.y > 1f) | ||
4929 | { | ||
4930 | dimple.y = 1f; | ||
4931 | } | ||
4932 | if (dimple.y - cut.x < 0.05f) | ||
4933 | { | ||
4934 | dimple.x = cut.y - 0.05f; | ||
4935 | } | ||
4936 | shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x); | ||
4937 | shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y)); | ||
4938 | |||
4939 | m_host.UpdateShape(shapeBlock); | ||
4940 | } | ||
4941 | |||
4942 | 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) | ||
4943 | { | ||
4944 | ObjectShapePacket.ObjectDataBlock shapeBlock; | ||
4945 | |||
4946 | shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist); | ||
4947 | |||
4948 | shapeBlock.ProfileCurve += fudge; | ||
4949 | |||
4950 | // profile/path swapped for a torrus, tube, ring | ||
4951 | shapeBlock.PathBegin = shapeBlock.ProfileBegin; | ||
4952 | shapeBlock.PathEnd = shapeBlock.ProfileEnd; | ||
4953 | |||
4954 | if (holesize.x < 0.05f) | ||
4955 | { | ||
4956 | holesize.x = 0.05f; | ||
4957 | } | ||
4958 | if (holesize.x > 1f) | ||
4959 | { | ||
4960 | holesize.x = 1f; | ||
4961 | } | ||
4962 | if (holesize.y < 0.05f) | ||
4963 | { | ||
4964 | holesize.y = 0.05f; | ||
4965 | } | ||
4966 | if (holesize.y > 0.5f) | ||
4967 | { | ||
4968 | holesize.y = 0.5f; | ||
4969 | } | ||
4970 | shapeBlock.PathScaleX = (byte)(100 * (2 - holesize.x)); | ||
4971 | shapeBlock.PathScaleY = (byte)(100 * (2 - holesize.y)); | ||
4972 | if (topshear.x < -0.5f) | ||
4973 | { | ||
4974 | topshear.x = -0.5f; | ||
4975 | } | ||
4976 | if (topshear.x > 0.5f) | ||
4977 | { | ||
4978 | topshear.x = 0.5f; | ||
4979 | } | ||
4980 | if (topshear.y < -0.5f) | ||
4981 | { | ||
4982 | topshear.y = -0.5f; | ||
4983 | } | ||
4984 | if (topshear.y > 0.5f) | ||
4985 | { | ||
4986 | topshear.y = 0.5f; | ||
4987 | } | ||
4988 | shapeBlock.PathShearX = (byte)(100 * topshear.x); | ||
4989 | shapeBlock.PathShearY = (byte)(100 * topshear.y); | ||
4990 | if (profilecut.x < 0f) | ||
4991 | { | ||
4992 | profilecut.x = 0f; | ||
4993 | } | ||
4994 | if (profilecut.x > 1f) | ||
4995 | { | ||
4996 | profilecut.x = 1f; | ||
4997 | } | ||
4998 | if (profilecut.y < 0f) | ||
4999 | { | ||
5000 | profilecut.y = 0f; | ||
5001 | } | ||
5002 | if (profilecut.y > 1f) | ||
5003 | { | ||
5004 | profilecut.y = 1f; | ||
5005 | } | ||
5006 | if (profilecut.y - cut.x < 0.05f) | ||
5007 | { | ||
5008 | profilecut.x = cut.y - 0.05f; | ||
5009 | } | ||
5010 | shapeBlock.ProfileBegin = (ushort)(50000 * profilecut.x); | ||
5011 | shapeBlock.ProfileEnd = (ushort)(50000 * (1 - profilecut.y)); | ||
5012 | if (taper_a.x < -1f) | ||
5013 | { | ||
5014 | taper_a.x = -1f; | ||
5015 | } | ||
5016 | if (taper_a.x > 1f) | ||
5017 | { | ||
5018 | taper_a.x = 1f; | ||
5019 | } | ||
5020 | if (taper_a.y < -1f) | ||
5021 | { | ||
5022 | taper_a.y = -1f; | ||
5023 | } | ||
5024 | if (taper_a.y > 1f) | ||
5025 | { | ||
5026 | taper_a.y = 1f; | ||
5027 | } | ||
5028 | shapeBlock.PathTaperX = (sbyte)(100 * taper_a.x); | ||
5029 | shapeBlock.PathTaperY = (sbyte)(100 * taper_a.y); | ||
5030 | if (revolutions < 1f) | ||
5031 | { | ||
5032 | revolutions = 1f; | ||
5033 | } | ||
5034 | if (revolutions > 4f) | ||
5035 | { | ||
5036 | revolutions = 4f; | ||
5037 | } | ||
5038 | shapeBlock.PathRevolutions = (byte)(100 * revolutions); | ||
5039 | // limits on radiusoffset depend on revolutions and hole size (how?) seems like the maximum range is 0 to 1 | ||
5040 | if (radiusoffset < 0f) | ||
5041 | { | ||
5042 | radiusoffset = 0f; | ||
5043 | } | ||
5044 | if (radiusoffset > 1f) | ||
5045 | { | ||
5046 | radiusoffset = 1f; | ||
5047 | } | ||
5048 | shapeBlock.PathRadiusOffset = (sbyte)(100 * radiusoffset); | ||
5049 | if (skew < -0.95f) | ||
5050 | { | ||
5051 | skew = -0.95f; | ||
5052 | } | ||
5053 | if (skew > 0.95f) | ||
5054 | { | ||
5055 | skew = 0.95f; | ||
5056 | } | ||
5057 | shapeBlock.PathSkew = (sbyte)(100 * skew); | ||
5058 | |||
5059 | m_host.UpdateShape(shapeBlock); | ||
5060 | } | ||
5061 | |||
5062 | private void SetPrimitiveShapeParams(string map, int type) | ||
5063 | { | ||
5064 | ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); | ||
5065 | LLUUID sculptId; | ||
5066 | |||
5067 | if (!LLUUID.TryParse(map, out sculptId)) | ||
5068 | { | ||
5069 | llSay(0, "Could not parse key " + map); | ||
5070 | return; | ||
5071 | } | ||
5072 | |||
5073 | shapeBlock.ObjectLocalID = m_host.LocalId; | ||
5074 | shapeBlock.PathScaleX = 100; | ||
5075 | shapeBlock.PathScaleY = 150; | ||
5076 | |||
5077 | if (type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_CYLINDER && | ||
5078 | type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_PLANE && | ||
5079 | type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE && | ||
5080 | type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_TORUS) | ||
5081 | { | ||
5082 | // default | ||
5083 | type = (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE; | ||
5084 | } | ||
5085 | |||
5086 | // retain pathcurve | ||
5087 | shapeBlock.PathCurve = m_host.Shape.PathCurve; | ||
5088 | |||
5089 | m_host.Shape.SetSculptData((byte)type, sculptId); | ||
5090 | m_host.UpdateShape(shapeBlock); | ||
5091 | } | ||
4781 | 5092 | ||
4782 | public void llSetPrimitiveParams(LSL_Types.list rules) | 5093 | public void llSetPrimitiveParams(LSL_Types.list rules) |
4783 | { | 5094 | { |
@@ -4822,7 +5133,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4822 | 5133 | ||
4823 | switch (code) | 5134 | switch (code) |
4824 | { | 5135 | { |
4825 | case 6: // PRIM_POSITION | 5136 | case (int)BuiltIn_Commands_BaseClass.PRIM_POSITION: |
4826 | if (remain < 1) | 5137 | if (remain < 1) |
4827 | return; | 5138 | return; |
4828 | 5139 | ||
@@ -4830,7 +5141,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4830 | SetPos(part, v); | 5141 | SetPos(part, v); |
4831 | 5142 | ||
4832 | break; | 5143 | break; |
4833 | case 7: // PRIM_SIZE | 5144 | case (int)BuiltIn_Commands_BaseClass.PRIM_SIZE: |
4834 | if (remain < 1) | 5145 | if (remain < 1) |
4835 | return; | 5146 | return; |
4836 | 5147 | ||
@@ -4838,7 +5149,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4838 | SetScale(part, v); | 5149 | SetScale(part, v); |
4839 | 5150 | ||
4840 | break; | 5151 | break; |
4841 | case 8: // PRIM_ROTATION | 5152 | case (int)BuiltIn_Commands_BaseClass.PRIM_ROTATION: |
4842 | if (remain < 1) | 5153 | if (remain < 1) |
4843 | return; | 5154 | return; |
4844 | 5155 | ||
@@ -4846,8 +5157,153 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4846 | SetRot(part, q); | 5157 | SetRot(part, q); |
4847 | 5158 | ||
4848 | break; | 5159 | break; |
5160 | |||
5161 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE: | ||
5162 | if (remain < 3) | ||
5163 | return; | ||
5164 | |||
5165 | code = Convert.ToInt32(rules.Data[idx++]); | ||
5166 | |||
5167 | remain = rules.Length - idx; | ||
5168 | float hollow; | ||
5169 | LSL_Types.Vector3 twist; | ||
5170 | LSL_Types.Vector3 taper_b; | ||
5171 | LSL_Types.Vector3 topshear; | ||
5172 | float revolutions; | ||
5173 | float radiusoffset; | ||
5174 | float skew; | ||
5175 | LSL_Types.Vector3 holesize; | ||
5176 | LSL_Types.Vector3 profilecut; | ||
5177 | |||
5178 | switch(code) | ||
5179 | { | ||
5180 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_BOX: | ||
5181 | if (remain < 6) | ||
5182 | return; | ||
5183 | |||
5184 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | ||
5185 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut | ||
5186 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5187 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5188 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5189 | topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5190 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; | ||
5191 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1);; | ||
5192 | break; | ||
5193 | |||
5194 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_CYLINDER: | ||
5195 | if (remain < 6) | ||
5196 | return; | ||
5197 | |||
5198 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | ||
5199 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut | ||
5200 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5201 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5202 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5203 | topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5204 | m_host.Shape.ProfileShape = ProfileShape.Circle; | ||
5205 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; | ||
5206 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0); | ||
5207 | break; | ||
5208 | |||
5209 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_PRISM: | ||
5210 | if (remain < 6) | ||
5211 | return; | ||
5212 | |||
5213 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | ||
5214 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | ||
5215 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5216 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5217 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5218 | topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5219 | m_host.Shape.PathCurve = (byte) Extrusion.Straight; | ||
5220 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 3); | ||
5221 | break; | ||
4849 | 5222 | ||
4850 | case 17: // PRIM_TEXTURE | 5223 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_SPHERE: |
5224 | if (remain < 5) | ||
5225 | return; | ||
5226 | |||
5227 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | ||
5228 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut | ||
5229 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5230 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5231 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // dimple | ||
5232 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | ||
5233 | SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5); | ||
5234 | break; | ||
5235 | |||
5236 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TORUS: | ||
5237 | if (remain < 11) | ||
5238 | return; | ||
5239 | |||
5240 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | ||
5241 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | ||
5242 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5243 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5244 | holesize = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5245 | topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5246 | profilecut = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5247 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // taper_a | ||
5248 | revolutions = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5249 | radiusoffset = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5250 | skew = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5251 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | ||
5252 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); | ||
5253 | break; | ||
5254 | |||
5255 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TUBE: | ||
5256 | if (remain < 11) | ||
5257 | return; | ||
5258 | |||
5259 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | ||
5260 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | ||
5261 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5262 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5263 | holesize = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5264 | topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5265 | profilecut = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5266 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // taper_a | ||
5267 | revolutions = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5268 | radiusoffset = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5269 | skew = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5270 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | ||
5271 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); | ||
5272 | break; | ||
5273 | |||
5274 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_RING: | ||
5275 | if (remain < 11) | ||
5276 | return; | ||
5277 | |||
5278 | face = Convert.ToInt32(rules.Data[idx++]); // holeshape | ||
5279 | v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut | ||
5280 | hollow = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5281 | twist = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5282 | holesize = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5283 | topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5284 | profilecut = new LSL_Types.Vector3(rules.Data[idx++].ToString()); | ||
5285 | taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // taper_a | ||
5286 | revolutions = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5287 | radiusoffset = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5288 | skew = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5289 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | ||
5290 | SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); | ||
5291 | break; | ||
5292 | |||
5293 | case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_SCULPT: | ||
5294 | if (remain < 2) | ||
5295 | return; | ||
5296 | |||
5297 | string map = rules.Data[idx++].ToString(); | ||
5298 | face = Convert.ToInt32(rules.Data[idx++]); // type | ||
5299 | m_host.Shape.PathCurve = (byte) Extrusion.Curve1; | ||
5300 | SetPrimitiveShapeParams(map, face); | ||
5301 | break; | ||
5302 | } | ||
5303 | |||
5304 | break; | ||
5305 | |||
5306 | case (int)BuiltIn_Commands_BaseClass.PRIM_TEXTURE: | ||
4851 | if (remain < 5) | 5307 | if (remain < 5) |
4852 | return; | 5308 | return; |
4853 | 5309 | ||
@@ -4864,7 +5320,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4864 | 5320 | ||
4865 | break; | 5321 | break; |
4866 | 5322 | ||
4867 | case 18: // PRIM_COLOR | 5323 | case (int)BuiltIn_Commands_BaseClass.PRIM_COLOR: |
4868 | if (remain < 3) | 5324 | if (remain < 3) |
4869 | return; | 5325 | return; |
4870 | 5326 | ||
@@ -4876,7 +5332,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4876 | SetAlpha(part, alpha, face); | 5332 | SetAlpha(part, alpha, face); |
4877 | 5333 | ||
4878 | break; | 5334 | break; |
4879 | case 21: // PRIM_FLEXI | 5335 | case (int)BuiltIn_Commands_BaseClass.PRIM_FLEXIBLE: |
4880 | if (remain < 7) | 5336 | if (remain < 7) |
4881 | return; | 5337 | return; |
4882 | 5338 | ||
@@ -4891,7 +5347,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4891 | SetFlexi(part, (flexi == 1), softness, gravity, friction, wind, tension, force); | 5347 | SetFlexi(part, (flexi == 1), softness, gravity, friction, wind, tension, force); |
4892 | 5348 | ||
4893 | break; | 5349 | break; |
4894 | case 23: // PRIM_POINT_LIGHT | 5350 | case (int)BuiltIn_Commands_BaseClass.PRIM_POINT_LIGHT: |
4895 | if (remain < 5) | 5351 | if (remain < 5) |
4896 | return; | 5352 | return; |
4897 | int light = Convert.ToInt32(rules.Data[idx++]); | 5353 | int light = Convert.ToInt32(rules.Data[idx++]); |