From c3d619498f7d92ea69a269bd22720056965fb048 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sun, 26 Apr 2009 00:45:48 +0000 Subject: Thank you kindly, Ewe Loon, for a patch that solves: PRIM_TEXGEN not in llSetPrimitiveParams. Patch has been included to implement it. --- .../Shared/Api/Implementation/LSL_Api.cs | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index faacc76..cf3270e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1305,6 +1305,36 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + public void SetTexGen(SceneObjectPart part, int face,int style) + { + Primitive.TextureEntry tex = part.Shape.Textures; + MappingType textype; + textype = MappingType.Default; + if (style == (int)ScriptBaseClass.PRIM_TEXGEN_PLANAR) + textype = MappingType.Planar; + + if (face >= 0 && face < GetNumberOfSides(part)) + { + tex.CreateFace((uint) face); + tex.FaceTextures[face].TexMapType = textype; + part.UpdateTexture(tex); + return; + } + else if (face == ScriptBaseClass.ALL_SIDES) + { + for (uint i = 0; i < GetNumberOfSides(part); i++) + { + if (tex.FaceTextures[i] != null) + { + tex.FaceTextures[i].TexMapType = textype; + } + tex.DefaultTexture.TexMapType = textype; + } + part.UpdateTexture(tex); + return; + } + } + public void SetGlow(SceneObjectPart part, int face, float glow) { Primitive.TextureEntry tex = part.Shape.Textures; @@ -6822,6 +6852,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api part.ScriptSetTemporaryStatus(tempOnRez); break; + + case (int)ScriptBaseClass.PRIM_TEXGEN: + if (remain < 2) + return; + //face,type + face = rules.GetLSLIntegerItem(idx++); + int style = rules.GetLSLIntegerItem(idx++); + SetTexGen(part, face, style); + break; } } } -- cgit v1.1