aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs177
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs3
3 files changed, 179 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
index 49ddd3f..eccc6d9 100644
--- a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
@@ -1605,9 +1605,9 @@ namespace OpenSim.Region.ScriptEngine.Common
1605 return m_LSL_Functions.llGetGeometricCenter(); 1605 return m_LSL_Functions.llGetGeometricCenter();
1606 } 1606 }
1607 1607
1608 public void llGetPrimitiveParams() 1608 public LSL_Types.list llGetPrimitiveParams(LSL_Types.list rules)
1609 { 1609 {
1610 m_LSL_Functions.llGetPrimitiveParams(); 1610 return m_LSL_Functions.llGetPrimitiveParams(rules);
1611 } 1611 }
1612 1612
1613 // 1613 //
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 805a575..e3bec9d 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -4830,10 +4830,183 @@ namespace OpenSim.Region.ScriptEngine.Common
4830 return new LSL_Types.Vector3(m_host.GetGeometricCenter().X, m_host.GetGeometricCenter().Y, m_host.GetGeometricCenter().Z); 4830 return new LSL_Types.Vector3(m_host.GetGeometricCenter().X, m_host.GetGeometricCenter().Y, m_host.GetGeometricCenter().Z);
4831 } 4831 }
4832 4832
4833 public void llGetPrimitiveParams() 4833 public LSL_Types.list llGetPrimitiveParams(LSL_Types.list rules)
4834 { 4834 {
4835 m_host.AddScriptLPS(1); 4835 m_host.AddScriptLPS(1);
4836 NotImplemented("llGetPrimitiveParams"); 4836
4837 LSL_Types.list res = new LSL_Types.list();
4838 int idx=0;
4839 while(idx < rules.Length)
4840 {
4841 int code=Convert.ToInt32(rules.Data[idx++]);
4842 int remain=rules.Length-idx;
4843
4844 switch(code)
4845 {
4846 case 2: // PRIM_MATERIAL
4847 res.Add(new LSL_Types.LSLInteger(m_host.Material));
4848 break;
4849
4850 case 3: // PRIM_PHYSICS
4851 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) != 0)
4852 res.Add(new LSL_Types.LSLInteger(1));
4853 else
4854 res.Add(new LSL_Types.LSLInteger(0));
4855 break;
4856
4857 case 4: // PRIM_TEMP_ON_REZ
4858 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.TemporaryOnRez) != 0)
4859 res.Add(new LSL_Types.LSLInteger(1));
4860 else
4861 res.Add(new LSL_Types.LSLInteger(0));
4862 break;
4863
4864 case 5: // PRIM_PHANTOM
4865 if ((m_host.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) != 0)
4866 res.Add(new LSL_Types.LSLInteger(1));
4867 else
4868 res.Add(new LSL_Types.LSLInteger(0));
4869 break;
4870
4871 case 6: // PRIM_POSITION
4872 res.Add(new LSL_Types.Vector3(m_host.AbsolutePosition.X,
4873 m_host.AbsolutePosition.Y,
4874 m_host.AbsolutePosition.Z));
4875 break;
4876
4877 case 7: // PRIM_SIZE
4878 res.Add(new LSL_Types.Vector3(m_host.Scale.X,
4879 m_host.Scale.Y,
4880 m_host.Scale.Z));
4881 break;
4882
4883 case 8: // PRIM_ROTATION
4884 res.Add(new LSL_Types.Quaternion(m_host.RotationOffset.X,
4885 m_host.RotationOffset.Y,
4886 m_host.RotationOffset.Z,
4887 m_host.RotationOffset.W));
4888 break;
4889
4890 case 9: // PRIM_TYPE
4891 // TODO--------------
4892 res.Add(new LSL_Types.LSLInteger(0));
4893 break;
4894
4895 case 17: // PRIM_TEXTURE
4896 if (remain < 1)
4897 return res;
4898
4899 int face=Convert.ToInt32(rules.Data[idx++]);
4900 if (face == -1)
4901 face = 0;
4902
4903 LLObject.TextureEntry tex = m_host.Shape.Textures;
4904 LLObject.TextureEntryFace texface = tex.GetFace((uint)face);
4905
4906 res.Add(new LSL_Types.LSLString(texface.TextureID.ToString()));
4907 res.Add(new LSL_Types.Vector3(texface.RepeatU,
4908 texface.RepeatV,
4909 0));
4910 res.Add(new LSL_Types.Vector3(texface.OffsetU,
4911 texface.OffsetV,
4912 0));
4913 res.Add(new LSL_Types.LSLFloat(texface.Rotation));
4914 break;
4915
4916 case 18: // PRIM_COLOR
4917 if (remain < 1)
4918 return res;
4919
4920 face=Convert.ToInt32(rules.Data[idx++]);
4921
4922 tex = m_host.Shape.Textures;
4923 LLColor texcolor;
4924 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color
4925 texcolor = tex.DefaultTexture.RGBA;
4926 else
4927 texcolor = tex.GetFace((uint)face).RGBA;
4928 res.Add(new LSL_Types.Vector3((255 - (texcolor.R * 255)) / 255,
4929 (255 - (texcolor.G * 255)) / 255,
4930 (255 - (texcolor.B * 255)) / 255));
4931 res.Add(new LSL_Types.LSLFloat((texcolor.A * 255) / 255));
4932 break;
4933
4934 case 19: // PRIM_BUMP_SHINY
4935 // TODO--------------
4936 if (remain < 1)
4937 return res;
4938
4939 face=Convert.ToInt32(rules.Data[idx++]);
4940
4941 res.Add(new LSL_Types.LSLInteger(0));
4942 res.Add(new LSL_Types.LSLInteger(0));
4943 break;
4944
4945 case 20: // PRIM_FULLBRIGHT
4946 // TODO--------------
4947 if (remain < 1)
4948 return res;
4949
4950 face=Convert.ToInt32(rules.Data[idx++]);
4951
4952 res.Add(new LSL_Types.LSLInteger(0));
4953 break;
4954
4955 case 21: // PRIM_FLEXIBLE
4956 PrimitiveBaseShape shape = m_host.Shape;
4957
4958 if (shape.FlexiEntry)
4959 res.Add(new LSL_Types.LSLInteger(1)); // active
4960 else
4961 res.Add(new LSL_Types.LSLInteger(0));
4962 res.Add(new LSL_Types.LSLInteger(shape.FlexiSoftness));// softness
4963 res.Add(new LSL_Types.LSLFloat(shape.FlexiGravity)); // gravity
4964 res.Add(new LSL_Types.LSLFloat(shape.FlexiDrag)); // friction
4965 res.Add(new LSL_Types.LSLFloat(shape.FlexiWind)); // wind
4966 res.Add(new LSL_Types.LSLFloat(shape.FlexiTension)); // tension
4967 res.Add(new LSL_Types.Vector3(shape.FlexiForceX, // force
4968 shape.FlexiForceY,
4969 shape.FlexiForceZ));
4970 break;
4971
4972 case 22: // PRIM_TEXGEN
4973 // TODO--------------
4974 // (PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR)
4975 if (remain < 1)
4976 return res;
4977
4978 face=Convert.ToInt32(rules.Data[idx++]);
4979
4980 res.Add(new LSL_Types.LSLInteger(0));
4981 break;
4982
4983 case 23: // PRIM_POINT_LIGHT:
4984 shape = m_host.Shape;
4985
4986 if (shape.LightEntry)
4987 res.Add(new LSL_Types.LSLInteger(1)); // active
4988 else
4989 res.Add(new LSL_Types.LSLInteger(0));
4990 res.Add(new LSL_Types.Vector3(shape.LightColorR, // color
4991 shape.LightColorG,
4992 shape.LightColorB));
4993 res.Add(new LSL_Types.LSLFloat(shape.LightIntensity)); // intensity
4994 res.Add(new LSL_Types.LSLFloat(shape.LightRadius)); // radius
4995 res.Add(new LSL_Types.LSLFloat(shape.LightFalloff)); // falloff
4996 break;
4997
4998 case 24: // PRIM_GLOW
4999 // TODO--------------
5000 if (remain < 1)
5001 return res;
5002
5003 face=Convert.ToInt32(rules.Data[idx++]);
5004
5005 res.Add(new LSL_Types.LSLFloat(0));
5006 break;
5007 }
5008 }
5009 return res;
4837 } 5010 }
4838 5011
4839 // <remarks> 5012 // <remarks>
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
index 115e4e8..f970878 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs
@@ -544,7 +544,8 @@ namespace OpenSim.Region.ScriptEngine.Common
544 LSL_Types.list llGetBoundingBox(string obj); 544 LSL_Types.list llGetBoundingBox(string obj);
545 //wiki: vector llGetGeometricCenter() 545 //wiki: vector llGetGeometricCenter()
546 LSL_Types.Vector3 llGetGeometricCenter(); 546 LSL_Types.Vector3 llGetGeometricCenter();
547 void llGetPrimitiveParams(); 547 //wiki: list llGetPrimitiveParams(list rules)
548 LSL_Types.list llGetPrimitiveParams(LSL_Types.list rules);
548 //wiki: string llIntegerToBase64(integer number) 549 //wiki: string llIntegerToBase64(integer number)
549 string llIntegerToBase64(int number); 550 string llIntegerToBase64(int number);
550 //wiki integer llBase64ToInteger(string str) 551 //wiki integer llBase64ToInteger(string str)