diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 99 |
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 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; |