本文整理汇总了C#中IEntity.ModuleInterfaceTypeNames方法的典型用法代码示例。如果您正苦于以下问题:C# IEntity.ModuleInterfaceTypeNames方法的具体用法?C# IEntity.ModuleInterfaceTypeNames怎么用?C# IEntity.ModuleInterfaceTypeNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEntity
的用法示例。
在下文中一共展示了IEntity.ModuleInterfaceTypeNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAvatarTextures
/// <summary>
/// Create the textures for the avatar. If this is an LLEntityAvatar, extract the
/// texture info from the avatar description and blindly create textures for the
/// parts of the body in the order of the faces that were generated above.
/// </summary>
/// <param name="ent">The entity of the avatar being decorated</param>
/// <param name="forceUpdateFlag">'true' if to force a redraw. If doing the initial
/// creation, a redraw update is not necessary.</param>
public bool CreateAvatarTextures(IEntity ent, bool forceUpdateFlag)
{
IEntityAvatar ientav;
LLEntityAvatar entav;
if (ent.TryGet<IEntityAvatar>(out ientav)) {
if (ientav is LLEntityAvatar) {
entav = (LLEntityAvatar)ientav;
OMV.Avatar av = entav.Avatar;
if (av != null && av.Textures != null) {
OMV.Primitive.TextureEntry texEnt = av.Textures;
OMV.Primitive.TextureEntryFace[] texFaces = texEnt.FaceTextures;
const int genCount = 7;
float[] textureParams = new float[1 + ((int)Ogr.CreateMaterialParam.maxParam) * genCount];
string[] materialNames = new string[genCount];
string[] textureOgreNames = new string[genCount];
textureParams[0] = (float)Ogr.CreateMaterialParam.maxParam;
int[] texIndexes = {
(int)OMV.AvatarTextureIndex.HeadBaked,
(int)OMV.AvatarTextureIndex.UpperBaked,
(int)OMV.AvatarTextureIndex.LowerBaked,
(int)OMV.AvatarTextureIndex.EyesBaked,
(int)OMV.AvatarTextureIndex.HairBaked,
// (int)OMV.AvatarTextureIndex.SkirtBaked
};
int pBase = 1;
int jj = 0;
string textureOgreName;
foreach (int baker in texIndexes) {
CreateMaterialParameters(texFaces[baker],
ent, null, pBase, ref textureParams, jj, out textureOgreName);
materialNames[jj] = EntityNameOgre.ConvertToOgreMaterialNameX(ent.Name, jj);
textureOgreNames[jj] = textureOgreName;
// m_log.Log(LogLevel.DRENDERDETAIL, "CreateAvatarTextures: mat={0}, tex={1}",
// materialNames[jj], textureOgreName);
/*
// The textures for the baked avatar textures are processed specially
// Here we request they be loaded (if not already available) so we can specify their type
EntityNameOgre textureEnt = EntityNameOgre.ConvertOgreResourceToEntityName(textureOgreName);
System.Drawing.Bitmap textureBitmap = ent.AssetContext.GetTexture(textureEnt);
if (textureBitmap == null) {
// texture is not immediately available. Ask for it in a special way
ent.AssetContext.DoTextureLoad(textureEnt, AssetContextBase.AssetType.BakedTexture,
delegate(string name, bool trans) { return; });
}
*/
pBase += (int)textureParams[0];
jj++;
}
m_log.Log(LogLevel.DRENDERDETAIL, "CreateAvatarTextures: materials for {0}", ent.Name);
Ogr.CreateMaterialResource7BF(0f, materialNames[0],
materialNames[0], materialNames[1], materialNames[2], materialNames[3],
materialNames[4], materialNames[5], materialNames[6],
textureOgreNames[0], textureOgreNames[1], textureOgreNames[2], textureOgreNames[3],
textureOgreNames[4], textureOgreNames[5], textureOgreNames[6],
textureParams
);
}
else {
// the avatar is not initialized yet. Try again later.
return false;
}
}
else {
m_log.Log(LogLevel.DBADERROR, "CreateAvatarTexture: REQUEST BUT NOT LLAVATAR");
}
}
else {
string modNames = "";
foreach (string mod in ent.ModuleInterfaceTypeNames()) modNames += " " + mod;
m_log.Log(LogLevel.DBADERROR, "CreateAvatarTexture: REQUEST FOR TEXTURES FOR NON LL ENTITY. Mod={0}", modNames);
}
return true;
}