本文整理汇总了C#中IrrlichtNETCP.SceneNode.AddChild方法的典型用法代码示例。如果您正苦于以下问题:C# SceneNode.AddChild方法的具体用法?C# SceneNode.AddChild怎么用?C# SceneNode.AddChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IrrlichtNETCP.SceneNode
的用法示例。
在下文中一共展示了SceneNode.AddChild方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IrrMeshLoad
private AnimatedMeshSceneNode IrrMeshLoad(IrrParseLib.IrrDatas _datas, SceneManager _smgr, SceneNode _node, string _prefix)
{
string prefix = string.Empty;
if (!string.IsNullOrEmpty(_prefix))
{
prefix = _prefix;
try
{
string copy = workDirectory + prefix + _datas.Mesh.Param.Mesh;
if (!File.Exists(copy))
System.IO.File.Copy(workDirectory + _datas.Mesh.Param.Mesh, copy);
}
catch (Exception e)
{
Reference.Log.Error("IrrMeshLoad", e);
}
}
AnimatedMesh mesh = _smgr.GetMesh(workDirectory + prefix + _datas.Mesh.Param.Mesh);
AnimatedMeshSceneNode node = _smgr.AddAnimatedMeshSceneNode(mesh);
Reference.Log.Info("[LOADING MESH]: " + workDirectory + prefix + _datas.Mesh.Param.Mesh);
// Set material.
for (int i = 0; i < node.MaterialCount; i++)
{
if (i < _datas.Materials.Count)
{
node.GetMaterial(i).MaterialType = (MaterialType)_datas.Materials[i].Type;
node.GetMaterial(i).BackfaceCulling = _datas.Materials[i].BackfaceCulling;
node.GetMaterial(i).FogEnable = _datas.Materials[i].FogEnable;
node.GetMaterial(i).GouraudShading = _datas.Materials[i].GouraudShading;
node.GetMaterial(i).Lighting = _datas.Materials[i].Lighting;
node.GetMaterial(i).NormalizeNormals = _datas.Materials[i].NormalizeNormals;
node.GetMaterial(i).Shininess = _datas.Materials[i].Shininess;
node.GetMaterial(i).ZBuffer = (uint)_datas.Materials[i].ZBuffer;
node.GetMaterial(i).ZWriteEnable = _datas.Materials[i].ZWriteEnable;
node.GetMaterial(i).Wireframe = _datas.Materials[i].Wireframe;
}
}
_node.AddChild(node);
if (_datas.Childs != null)
{
foreach (IrrParseLib.IrrDatas datas in _datas.Childs)
{
IrrMeshLoad(datas, _smgr, node, _prefix);
}
}
return node;
}
示例2: IrrMeshLoad
private AnimatedMeshSceneNode IrrMeshLoad(IrrParseLib.IrrDatas _datas, SceneManager _smgr, SceneNode _node, string _prefix)
{
string prefix = string.Empty;
if (string.IsNullOrEmpty(_prefix) == false)
{
prefix = _prefix;
try
{
string copy = workDirectory + prefix + _datas.Mesh.Param.Mesh;
if (!File.Exists(copy))
System.IO.File.Copy(workDirectory + _datas.Mesh.Param.Mesh, copy);
}
catch (Exception e)
{
Reference.Log.Error("IrrMeshLoad", e);
}
}
AnimatedMesh mesh = _smgr.GetMesh(prefix + _datas.Mesh.Param.Mesh);
AnimatedMeshSceneNode node = _smgr.AddAnimatedMeshSceneNode(mesh);
// Set material.
for (int i = 0; i < node.MaterialCount; i++)
{
if (i < _datas.Materials.Count)
{
node.GetMaterial(i).MaterialType = (MaterialType)_datas.Materials[i].Type;
node.GetMaterial(i).BackfaceCulling = _datas.Materials[i].BackfaceCulling;
node.GetMaterial(i).FogEnable = _datas.Materials[i].FogEnable;
node.GetMaterial(i).GouraudShading = _datas.Materials[i].GouraudShading;
node.GetMaterial(i).Lighting = _datas.Materials[i].Lighting;
node.GetMaterial(i).NormalizeNormals = _datas.Materials[i].NormalizeNormals;
node.GetMaterial(i).Shininess = _datas.Materials[i].Shininess;
node.GetMaterial(i).ZBuffer = (uint)_datas.Materials[i].ZBuffer;
node.GetMaterial(i).ZWriteEnable = _datas.Materials[i].ZWriteEnable;
#if YK_VIDEO_WIREFRAME
node.GetMaterial(i).Wireframe = true;
#else
node.GetMaterial(i).Wireframe = _datas.Materials[i].Wireframe;
#endif
// [YK:NEXT]
//node.GetMaterial(i).AmbientColor = _datas.Materials[i].Ambient;
//node.GetMaterial(i).DiffuseColor = _datas.Materials[i].Diffuse;
//node.GetMaterial(i).SpecularColor = _datas.Materials[i].Specular;
//node.GetMaterial(i).EmissiveColor = _datas.Materials[i].Emissive;
}
}
_node.AddChild(node);
if (_datas.Childs != null)
{
foreach (IrrParseLib.IrrDatas datas in _datas.Childs)
{
IrrMeshLoad(datas, _smgr, node, _prefix);
}
}
return node;
}