diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
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 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; |
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); |