aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs99
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs20
4 files changed, 114 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 8217248..0a871d9 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -5408,12 +5408,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5408 public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) 5408 public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate)
5409 { 5409 {
5410 m_host.AddScriptLPS(1); 5410 m_host.AddScriptLPS(1);
5411
5412 SetTextureAnim(m_host, mode, face, sizex, sizey, start, length, rate);
5413 }
5414
5415 public void llSetLinkTextureAnim(int linknumber, int mode, int face, int sizex, int sizey, double start, double length, double rate)
5416 {
5417 m_host.AddScriptLPS(1);
5418
5419 List<SceneObjectPart> parts = GetLinkParts(linknumber);
5420
5421 foreach (var part in parts)
5422 {
5423 SetTextureAnim(part, mode, face, sizex, sizey, start, length, rate);
5424 }
5425 }
5426
5427 private void SetTextureAnim(SceneObjectPart part, int mode, int face, int sizex, int sizey, double start, double length, double rate)
5428 {
5429
5411 Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation(); 5430 Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation();
5412 pTexAnim.Flags = (Primitive.TextureAnimMode)mode; 5431 pTexAnim.Flags = (Primitive.TextureAnimMode)mode;
5413 5432
5414 //ALL_SIDES 5433 //ALL_SIDES
5415 if (face == ScriptBaseClass.ALL_SIDES) 5434 if (face == ScriptBaseClass.ALL_SIDES)
5416 face = 255; 5435 face = 255;
5417 5436
5418 pTexAnim.Face = (uint)face; 5437 pTexAnim.Face = (uint)face;
5419 pTexAnim.Length = (float)length; 5438 pTexAnim.Length = (float)length;
@@ -5422,9 +5441,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5422 pTexAnim.SizeY = (uint)sizey; 5441 pTexAnim.SizeY = (uint)sizey;
5423 pTexAnim.Start = (float)start; 5442 pTexAnim.Start = (float)start;
5424 5443
5425 m_host.AddTextureAnimation(pTexAnim); 5444 part.AddTextureAnimation(pTexAnim);
5426 m_host.SendFullUpdateToAllClients(); 5445 part.SendFullUpdateToAllClients();
5427 m_host.ParentGroup.HasGroupChanged = true; 5446 part.ParentGroup.HasGroupChanged = true;
5428 } 5447 }
5429 5448
5430 public void llTriggerSoundLimited(string sound, double volume, LSL_Vector top_north_east, 5449 public void llTriggerSoundLimited(string sound, double volume, LSL_Vector top_north_east,
@@ -5821,13 +5840,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5821 return ps; 5840 return ps;
5822 } 5841 }
5823 5842
5843 public void llLinkParticleSystem(int linknumber, LSL_List rules)
5844 {
5845 m_host.AddScriptLPS(1);
5846
5847 List<SceneObjectPart> parts = GetLinkParts(linknumber);
5848
5849 foreach (var part in parts)
5850 {
5851 SetParticleSystem(part, rules);
5852 }
5853 }
5854
5824 public void llParticleSystem(LSL_List rules) 5855 public void llParticleSystem(LSL_List rules)
5825 { 5856 {
5826 m_host.AddScriptLPS(1); 5857 m_host.AddScriptLPS(1);
5858 SetParticleSystem(m_host, rules);
5859 }
5860
5861 private void SetParticleSystem(SceneObjectPart part, LSL_List rules) {
5862
5863
5827 if (rules.Length == 0) 5864 if (rules.Length == 0)
5828 { 5865 {
5829 m_host.RemoveParticleSystem(); 5866 part.RemoveParticleSystem();
5830 m_host.ParentGroup.HasGroupChanged = true; 5867 part.ParentGroup.HasGroupChanged = true;
5831 } 5868 }
5832 else 5869 else
5833 { 5870 {
@@ -5938,7 +5975,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5938 } 5975 }
5939 else 5976 else
5940 { 5977 {
5941 prules.Target = m_host.UUID; 5978 prules.Target = part.UUID;
5942 } 5979 }
5943 break; 5980 break;
5944 5981
@@ -5964,10 +6001,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5964 } 6001 }
5965 prules.CRC = 1; 6002 prules.CRC = 1;
5966 6003
5967 m_host.AddNewParticleSystem(prules); 6004 part.AddNewParticleSystem(prules);
5968 m_host.ParentGroup.HasGroupChanged = true; 6005 part.ParentGroup.HasGroupChanged = true;
5969 } 6006 }
5970 m_host.SendFullUpdateToAllClients(); 6007 part.SendFullUpdateToAllClients();
5971 } 6008 }
5972 6009
5973 public void llGroundRepel(double height, int water, double tau) 6010 public void llGroundRepel(double height, int water, double tau)
@@ -6761,6 +6798,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6761 SetPrimParams(part, rules); 6798 SetPrimParams(part, rules);
6762 } 6799 }
6763 6800
6801 public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules)
6802 {
6803 llSetLinkPrimitiveParams(linknumber, rules);
6804 }
6805
6764 protected void SetPrimParams(SceneObjectPart part, LSL_List rules) 6806 protected void SetPrimParams(SceneObjectPart part, LSL_List rules)
6765 { 6807 {
6766 int idx = 0; 6808 int idx = 0;
@@ -7117,6 +7159,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7117 int style = rules.GetLSLIntegerItem(idx++); 7159 int style = rules.GetLSLIntegerItem(idx++);
7118 SetTexGen(part, face, style); 7160 SetTexGen(part, face, style);
7119 break; 7161 break;
7162 case (int)ScriptBaseClass.PRIM_TEXT:
7163 if (remain < 3)
7164 return;
7165 string primText = rules.GetLSLStringItem(idx++);
7166 LSL_Vector primTextColor = rules.GetVector3Item(idx++);
7167 LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
7168 Vector3 av3 = new Vector3(Util.Clip((float)primTextColor.x, 0.0f, 1.0f),
7169 Util.Clip((float)primTextColor.y, 0.0f, 1.0f),
7170 Util.Clip((float)primTextColor.z, 0.0f, 1.0f));
7171 part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
7172
7173 break;
7120 } 7174 }
7121 } 7175 }
7122 } 7176 }
@@ -7360,6 +7414,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7360 return GetLinkPrimitiveParams(m_host, rules); 7414 return GetLinkPrimitiveParams(m_host, rules);
7361 } 7415 }
7362 7416
7417 public LSL_List llGetLinkPrimitiveParams(int linknumber, LSL_List rules)
7418 {
7419 m_host.AddScriptLPS(1);
7420
7421 List<SceneObjectPart> parts = GetLinkParts(linknumber);
7422
7423 LSL_List res = new LSL_List();
7424
7425 foreach (var part in parts)
7426 {
7427 LSL_List partRes = GetLinkPrimitiveParams(part, rules);
7428 res += partRes;
7429 }
7430
7431 return res;
7432 }
7433
7363 public LSL_List GetLinkPrimitiveParams(SceneObjectPart part, LSL_List rules) 7434 public LSL_List GetLinkPrimitiveParams(SceneObjectPart part, LSL_List rules)
7364 { 7435 {
7365 LSL_List res = new LSL_List(); 7436 LSL_List res = new LSL_List();
@@ -7637,6 +7708,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7637 7708
7638 res.Add(new LSL_Float(0)); 7709 res.Add(new LSL_Float(0));
7639 break; 7710 break;
7711 case (int)ScriptBaseClass.PRIM_TEXT:
7712 Color4 textColor = part.GetTextColor();
7713 res.Add(part.Text);
7714 res.Add(new LSL_Vector(textColor.R,
7715 textColor.G,
7716 textColor.B));
7717 res.Add(new LSL_Float(textColor.A));
7718 break;
7640 } 7719 }
7641 } 7720 }
7642 return res; 7721 return res;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
index a74e8da..7ab04a3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
@@ -135,6 +135,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
135 LSL_Key llGetLinkKey(int linknum); 135 LSL_Key llGetLinkKey(int linknum);
136 LSL_String llGetLinkName(int linknum); 136 LSL_String llGetLinkName(int linknum);
137 LSL_Integer llGetLinkNumber(); 137 LSL_Integer llGetLinkNumber();
138 LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules);
138 LSL_Integer llGetListEntryType(LSL_List src, int index); 139 LSL_Integer llGetListEntryType(LSL_List src, int index);
139 LSL_Integer llGetListLength(LSL_List src); 140 LSL_Integer llGetListLength(LSL_List src);
140 LSL_Vector llGetLocalPos(); 141 LSL_Vector llGetLocalPos();
@@ -206,6 +207,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
206 void llInstantMessage(string user, string message); 207 void llInstantMessage(string user, string message);
207 LSL_String llIntegerToBase64(int number); 208 LSL_String llIntegerToBase64(int number);
208 LSL_String llKey2Name(string id); 209 LSL_String llKey2Name(string id);
210 void llLinkParticleSystem(int linknum, LSL_List rules);
209 LSL_String llList2CSV(LSL_List src); 211 LSL_String llList2CSV(LSL_List src);
210 LSL_Float llList2Float(LSL_List src, int index); 212 LSL_Float llList2Float(LSL_List src, int index);
211 LSL_Integer llList2Integer(LSL_List src, int index); 213 LSL_Integer llList2Integer(LSL_List src, int index);
@@ -322,6 +324,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
322 void llSetLinkColor(int linknumber, LSL_Vector color, int face); 324 void llSetLinkColor(int linknumber, LSL_Vector color, int face);
323 void llSetLinkPrimitiveParams(int linknumber, LSL_List rules); 325 void llSetLinkPrimitiveParams(int linknumber, LSL_List rules);
324 void llSetLinkTexture(int linknumber, string texture, int face); 326 void llSetLinkTexture(int linknumber, string texture, int face);
327 void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate);
325 void llSetLocalRot(LSL_Rotation rot); 328 void llSetLocalRot(LSL_Rotation rot);
326 void llSetObjectDesc(string desc); 329 void llSetObjectDesc(string desc);
327 void llSetObjectName(string name); 330 void llSetObjectName(string name);
@@ -330,6 +333,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
330 void llSetPayPrice(int price, LSL_List quick_pay_buttons); 333 void llSetPayPrice(int price, LSL_List quick_pay_buttons);
331 void llSetPos(LSL_Vector pos); 334 void llSetPos(LSL_Vector pos);
332 void llSetPrimitiveParams(LSL_List rules); 335 void llSetPrimitiveParams(LSL_List rules);
336 void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules);
333 void llSetPrimURL(string url); 337 void llSetPrimURL(string url);
334 void llSetRemoteScriptAccessPin(int pin); 338 void llSetRemoteScriptAccessPin(int pin);
335 void llSetRot(LSL_Rotation rot); 339 void llSetRot(LSL_Rotation rot);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 7cf82b2..ee35fa4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -313,6 +313,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
313 public const int PRIM_CAST_SHADOWS = 24; // Not implemented, here for completeness sake 313 public const int PRIM_CAST_SHADOWS = 24; // Not implemented, here for completeness sake
314 public const int PRIM_POINT_LIGHT = 23; // Huh? 314 public const int PRIM_POINT_LIGHT = 23; // Huh?
315 public const int PRIM_GLOW = 25; 315 public const int PRIM_GLOW = 25;
316 public const int PRIM_TEXT = 26;
316 public const int PRIM_TEXGEN_DEFAULT = 0; 317 public const int PRIM_TEXGEN_DEFAULT = 0;
317 public const int PRIM_TEXGEN_PLANAR = 1; 318 public const int PRIM_TEXGEN_PLANAR = 1;
318 319
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
index a28e97b..3339995 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
@@ -674,6 +674,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
674 return m_LSL_Functions.llGetPrimitiveParams(rules); 674 return m_LSL_Functions.llGetPrimitiveParams(rules);
675 } 675 }
676 676
677 public LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules)
678 {
679 return m_LSL_Functions.llGetLinkPrimitiveParams(linknum, rules);
680 }
681
677 public LSL_Integer llGetRegionAgentCount() 682 public LSL_Integer llGetRegionAgentCount()
678 { 683 {
679 return m_LSL_Functions.llGetRegionAgentCount(); 684 return m_LSL_Functions.llGetRegionAgentCount();
@@ -889,6 +894,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
889 return m_LSL_Functions.llKey2Name(id); 894 return m_LSL_Functions.llKey2Name(id);
890 } 895 }
891 896
897 public void llLinkParticleSystem(int linknum, LSL_List rules)
898 {
899 m_LSL_Functions.llLinkParticleSystem(linknum, rules);
900 }
901
892 public LSL_String llList2CSV(LSL_List src) 902 public LSL_String llList2CSV(LSL_List src)
893 { 903 {
894 return m_LSL_Functions.llList2CSV(src); 904 return m_LSL_Functions.llList2CSV(src);
@@ -1468,6 +1478,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
1468 m_LSL_Functions.llSetLinkTexture(linknumber, texture, face); 1478 m_LSL_Functions.llSetLinkTexture(linknumber, texture, face);
1469 } 1479 }
1470 1480
1481 public void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate)
1482 {
1483 m_LSL_Functions.llSetLinkTextureAnim(linknum, mode, face, sizex, sizey, start, length, rate);
1484 }
1485
1471 public void llSetLocalRot(LSL_Rotation rot) 1486 public void llSetLocalRot(LSL_Rotation rot)
1472 { 1487 {
1473 m_LSL_Functions.llSetLocalRot(rot); 1488 m_LSL_Functions.llSetLocalRot(rot);
@@ -1508,6 +1523,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
1508 m_LSL_Functions.llSetPrimitiveParams(rules); 1523 m_LSL_Functions.llSetPrimitiveParams(rules);
1509 } 1524 }
1510 1525
1526 public void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules)
1527 {
1528 m_LSL_Functions.llSetLinkPrimitiveParamsFast(linknum, rules);
1529 }
1530
1511 public void llSetPrimURL(string url) 1531 public void llSetPrimURL(string url)
1512 { 1532 {
1513 m_LSL_Functions.llSetPrimURL(url); 1533 m_LSL_Functions.llSetPrimURL(url);