aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
authorunknown2010-03-06 00:56:55 -0600
committerMelanie2010-03-06 11:52:59 +0000
commitc0bc25059c932bbef41b2fbe2f319163407aed1b (patch)
tree2aa986de6f23d35bc2ca8fa25f16e7423e13606d /OpenSim/Region/ScriptEngine/Shared/Api/Implementation
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-c0bc25059c932bbef41b2fbe2f319163407aed1b.zip
opensim-SC-c0bc25059c932bbef41b2fbe2f319163407aed1b.tar.gz
opensim-SC-c0bc25059c932bbef41b2fbe2f319163407aed1b.tar.bz2
opensim-SC-c0bc25059c932bbef41b2fbe2f319163407aed1b.tar.xz
- implementing server 1.38 functions
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs99
1 files changed, 89 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index dc4249c..f1241a1 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -5406,12 +5406,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5406 public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) 5406 public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate)
5407 { 5407 {
5408 m_host.AddScriptLPS(1); 5408 m_host.AddScriptLPS(1);
5409
5410 SetTextureAnim(m_host, mode, face, sizex, sizey, start, length, rate);
5411 }
5412
5413 public void llSetLinkTextureAnim(int linknumber, int mode, int face, int sizex, int sizey, double start, double length, double rate)
5414 {
5415 m_host.AddScriptLPS(1);
5416
5417 List<SceneObjectPart> parts = GetLinkParts(linknumber);
5418
5419 foreach (var part in parts)
5420 {
5421 SetTextureAnim(part, mode, face, sizex, sizey, start, length, rate);
5422 }
5423 }
5424
5425 private void SetTextureAnim(SceneObjectPart part, int mode, int face, int sizex, int sizey, double start, double length, double rate)
5426 {
5427
5409 Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation(); 5428 Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation();
5410 pTexAnim.Flags = (Primitive.TextureAnimMode)mode; 5429 pTexAnim.Flags = (Primitive.TextureAnimMode)mode;
5411 5430
5412 //ALL_SIDES 5431 //ALL_SIDES
5413 if (face == ScriptBaseClass.ALL_SIDES) 5432 if (face == ScriptBaseClass.ALL_SIDES)
5414 face = 255; 5433 face = 255;
5415 5434
5416 pTexAnim.Face = (uint)face; 5435 pTexAnim.Face = (uint)face;
5417 pTexAnim.Length = (float)length; 5436 pTexAnim.Length = (float)length;
@@ -5420,9 +5439,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5420 pTexAnim.SizeY = (uint)sizey; 5439 pTexAnim.SizeY = (uint)sizey;
5421 pTexAnim.Start = (float)start; 5440 pTexAnim.Start = (float)start;
5422 5441
5423 m_host.AddTextureAnimation(pTexAnim); 5442 part.AddTextureAnimation(pTexAnim);
5424 m_host.SendFullUpdateToAllClients(); 5443 part.SendFullUpdateToAllClients();
5425 m_host.ParentGroup.HasGroupChanged = true; 5444 part.ParentGroup.HasGroupChanged = true;
5426 } 5445 }
5427 5446
5428 public void llTriggerSoundLimited(string sound, double volume, LSL_Vector top_north_east, 5447 public void llTriggerSoundLimited(string sound, double volume, LSL_Vector top_north_east,
@@ -5819,13 +5838,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5819 return ps; 5838 return ps;
5820 } 5839 }
5821 5840
5841 public void llLinkParticleSystem(int linknumber, LSL_List rules)
5842 {
5843 m_host.AddScriptLPS(1);
5844
5845 List<SceneObjectPart> parts = GetLinkParts(linknumber);
5846
5847 foreach (var part in parts)
5848 {
5849 SetParticleSystem(part, rules);
5850 }
5851 }
5852
5822 public void llParticleSystem(LSL_List rules) 5853 public void llParticleSystem(LSL_List rules)
5823 { 5854 {
5824 m_host.AddScriptLPS(1); 5855 m_host.AddScriptLPS(1);
5856 SetParticleSystem(m_host, rules);
5857 }
5858
5859 private void SetParticleSystem(SceneObjectPart part, LSL_List rules) {
5860
5861
5825 if (rules.Length == 0) 5862 if (rules.Length == 0)
5826 { 5863 {
5827 m_host.RemoveParticleSystem(); 5864 part.RemoveParticleSystem();
5828 m_host.ParentGroup.HasGroupChanged = true; 5865 part.ParentGroup.HasGroupChanged = true;
5829 } 5866 }
5830 else 5867 else
5831 { 5868 {
@@ -5936,7 +5973,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5936 } 5973 }
5937 else 5974 else
5938 { 5975 {
5939 prules.Target = m_host.UUID; 5976 prules.Target = part.UUID;
5940 } 5977 }
5941 break; 5978 break;
5942 5979
@@ -5962,10 +5999,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5962 } 5999 }
5963 prules.CRC = 1; 6000 prules.CRC = 1;
5964 6001
5965 m_host.AddNewParticleSystem(prules); 6002 part.AddNewParticleSystem(prules);
5966 m_host.ParentGroup.HasGroupChanged = true; 6003 part.ParentGroup.HasGroupChanged = true;
5967 } 6004 }
5968 m_host.SendFullUpdateToAllClients(); 6005 part.SendFullUpdateToAllClients();
5969 } 6006 }
5970 6007
5971 public void llGroundRepel(double height, int water, double tau) 6008 public void llGroundRepel(double height, int water, double tau)
@@ -6759,6 +6796,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6759 SetPrimParams(part, rules); 6796 SetPrimParams(part, rules);
6760 } 6797 }
6761 6798
6799 public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules)
6800 {
6801 llSetLinkPrimitiveParams(linknumber, rules);
6802 }
6803
6762 protected void SetPrimParams(SceneObjectPart part, LSL_List rules) 6804 protected void SetPrimParams(SceneObjectPart part, LSL_List rules)
6763 { 6805 {
6764 int idx = 0; 6806 int idx = 0;
@@ -7115,6 +7157,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7115 int style = rules.GetLSLIntegerItem(idx++); 7157 int style = rules.GetLSLIntegerItem(idx++);
7116 SetTexGen(part, face, style); 7158 SetTexGen(part, face, style);
7117 break; 7159 break;
7160 case (int)ScriptBaseClass.PRIM_TEXT:
7161 if (remain < 3)
7162 return;
7163 string primText = rules.GetLSLStringItem(idx++);
7164 LSL_Vector primTextColor = rules.GetVector3Item(idx++);
7165 LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
7166 Vector3 av3 = new Vector3(Util.Clip((float)primTextColor.x, 0.0f, 1.0f),
7167 Util.Clip((float)primTextColor.y, 0.0f, 1.0f),
7168 Util.Clip((float)primTextColor.z, 0.0f, 1.0f));
7169 part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
7170
7171 break;
7118 } 7172 }
7119 } 7173 }
7120 } 7174 }
@@ -7358,6 +7412,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7358 return GetLinkPrimitiveParams(m_host, rules); 7412 return GetLinkPrimitiveParams(m_host, rules);
7359 } 7413 }
7360 7414
7415 public LSL_List llGetLinkPrimitiveParams(int linknumber, LSL_List rules)
7416 {
7417 m_host.AddScriptLPS(1);
7418
7419 List<SceneObjectPart> parts = GetLinkParts(linknumber);
7420
7421 LSL_List res = new LSL_List();
7422
7423 foreach (var part in parts)
7424 {
7425 LSL_List partRes = GetLinkPrimitiveParams(part, rules);
7426 res += partRes;
7427 }
7428
7429 return res;
7430 }
7431
7361 public LSL_List GetLinkPrimitiveParams(SceneObjectPart part, LSL_List rules) 7432 public LSL_List GetLinkPrimitiveParams(SceneObjectPart part, LSL_List rules)
7362 { 7433 {
7363 LSL_List res = new LSL_List(); 7434 LSL_List res = new LSL_List();
@@ -7635,6 +7706,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7635 7706
7636 res.Add(new LSL_Float(0)); 7707 res.Add(new LSL_Float(0));
7637 break; 7708 break;
7709 case (int)ScriptBaseClass.PRIM_TEXT:
7710 Color4 textColor = part.GetTextColor();
7711 res.Add(part.Text);
7712 res.Add(new LSL_Vector(textColor.R,
7713 textColor.G,
7714 textColor.B));
7715 res.Add(new LSL_Float(textColor.A));
7716 break;
7638 } 7717 }
7639 } 7718 }
7640 return res; 7719 return res;