本文整理汇总了C#中ISceneChildEntity.UpdateTexture方法的典型用法代码示例。如果您正苦于以下问题:C# ISceneChildEntity.UpdateTexture方法的具体用法?C# ISceneChildEntity.UpdateTexture怎么用?C# ISceneChildEntity.UpdateTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISceneChildEntity
的用法示例。
在下文中一共展示了ISceneChildEntity.UpdateTexture方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RotateTexture
protected void RotateTexture(ISceneChildEntity part, double rotation, int face)
{
Primitive.TextureEntry tex = part.Shape.Textures;
int ns = GetNumberOfSides(part);
if (face >= 0 && face < ns)
{
Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
texface.Rotation = (float)rotation;
tex.FaceTextures[face] = texface;
part.UpdateTexture(tex);
return;
}
if (face == ScriptBaseClass.ALL_SIDES)
{
for (int i = 0; i < ns; i++)
{
if (tex.FaceTextures[i] != null)
{
tex.FaceTextures[i].Rotation = (float)rotation;
}
}
tex.DefaultTexture.Rotation = (float)rotation;
part.UpdateTexture(tex);
return;
}
}
示例2: SetAlpha
protected void SetAlpha (ISceneChildEntity part, double alpha, int face)
{
Primitive.TextureEntry tex = part.Shape.Textures;
Color4 texcolor;
if (face >= 0 && face < GetNumberOfSides(part))
{
texcolor = tex.CreateFace((uint)face).RGBA;
texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
tex.FaceTextures[face].RGBA = texcolor;
part.UpdateTexture(tex);
}
else if (face == ScriptBaseClass.ALL_SIDES)
{
for (int i = 0; i < GetNumberOfSides(part); i++)
{
if (tex.FaceTextures[i] != null)
{
texcolor = tex.FaceTextures[i].RGBA;
texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
tex.FaceTextures[i].RGBA = texcolor;
}
}
texcolor = tex.DefaultTexture.RGBA;
texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
tex.DefaultTexture.RGBA = texcolor;
part.UpdateTexture(tex);
}
part.ScheduleUpdate(PrimUpdateFlags.FullUpdate);
}
示例3: SetTexture
protected void SetTexture (ISceneChildEntity part, string texture, int face)
{
UUID textureID=new UUID();
int ns = GetNumberOfSides(part);
textureID = InventoryKey(texture, (int)AssetType.Texture);
if (textureID == UUID.Zero)
{
if (!UUID.TryParse(texture, out textureID))
return;
}
Primitive.TextureEntry tex = part.Shape.Textures;
if (face >= 0 && face < ns)
{
Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
texface.TextureID = textureID;
tex.FaceTextures[face] = texface;
part.UpdateTexture(tex);
return;
}
else if (face == ScriptBaseClass.ALL_SIDES)
{
for (uint i = 0; i < ns; i++)
{
if (tex.FaceTextures[i] != null)
{
tex.FaceTextures[i].TextureID = textureID;
}
}
tex.DefaultTexture.TextureID = textureID;
part.UpdateTexture(tex);
return;
}
}
示例4: SetFullBright
public void SetFullBright (ISceneChildEntity part, int face, bool bright)
{
Primitive.TextureEntry tex = part.Shape.Textures;
if (face >= 0 && face < GetNumberOfSides(part))
{
tex.CreateFace((uint) face);
tex.FaceTextures[face].Fullbright = bright;
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].Fullbright = bright;
}
}
tex.DefaultTexture.Fullbright = bright;
part.UpdateTexture(tex);
return;
}
}
示例5: SetShiny
public void SetShiny (ISceneChildEntity part, int face, int shiny, Bumpiness bump)
{
Shininess sval = new Shininess();
switch (shiny)
{
case 0:
sval = Shininess.None;
break;
case 1:
sval = Shininess.Low;
break;
case 2:
sval = Shininess.Medium;
break;
case 3:
sval = Shininess.High;
break;
default:
sval = Shininess.None;
break;
}
Primitive.TextureEntry tex = part.Shape.Textures;
if (face >= 0 && face < GetNumberOfSides(part))
{
tex.CreateFace((uint) face);
tex.FaceTextures[face].Shiny = sval;
tex.FaceTextures[face].Bump = bump;
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].Shiny = sval;
tex.FaceTextures[i].Bump = bump;;
}
tex.DefaultTexture.Shiny = sval;
tex.DefaultTexture.Bump = bump;
}
part.UpdateTexture(tex);
return;
}
}
示例6: SetTexGen
public void SetTexGen (ISceneChildEntity 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;
}
}
示例7: SetGlow
public void SetGlow(ISceneChildEntity part, int face, float glow)
{
Primitive.TextureEntry tex = part.Shape.Textures;
if (face >= 0 && face < GetNumberOfSides(part))
{
tex.CreateFace((uint) face);
tex.FaceTextures[face].Glow = glow;
part.UpdateTexture(tex, false);
return;
}
if (face == ScriptBaseClass.ALL_SIDES)
{
for (uint i = 0; i < GetNumberOfSides(part); i++)
{
if (tex.FaceTextures[i] != null)
{
tex.FaceTextures[i].Glow = glow;
}
tex.DefaultTexture.Glow = glow;
}
part.UpdateTexture(tex, false);
}
}
示例8: SetTexture
protected bool SetTexture(ISceneChildEntity part, string texture, int face)
{
UUID textureID = new UUID();
int ns = GetNumberOfSides(part);
textureID = KeyOrName(texture, (int)AssetType.Texture, true);
if (textureID == UUID.Zero)
return false;
Primitive.TextureEntry tex = part.Shape.Textures;
if (face >= 0 && face < ns)
{
Primitive.TextureEntryFace texface = tex.CreateFace((uint) face);
texface.TextureID = textureID;
tex.FaceTextures[face] = texface;
part.UpdateTexture(tex, false);
}
if (face == ScriptBaseClass.ALL_SIDES)
{
for (uint i = 0; i < ns; i++)
{
if (tex.FaceTextures[i] != null)
{
tex.FaceTextures[i].TextureID = textureID;
}
}
tex.DefaultTexture.TextureID = textureID;
part.UpdateTexture(tex, false);
}
return true;
}