mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 13:55:35 +08:00
Thank you kindly, Ewe Loon, for a patch that solves:
PRIM_TEXGEN not in llSetPrimitiveParams. Patch has been included to implement it.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user