本文整理汇总了C#中SceneManager.AddOctreeSceneNode方法的典型用法代码示例。如果您正苦于以下问题:C# SceneManager.AddOctreeSceneNode方法的具体用法?C# SceneManager.AddOctreeSceneNode怎么用?C# SceneManager.AddOctreeSceneNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SceneManager
的用法示例。
在下文中一共展示了SceneManager.AddOctreeSceneNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createScreen
/// <summary>
/// Létrehoz egy sizex*sizey méretű ablakot, windowCaption címmel és deviceType renderelési eszközzel.
/// </summary>
/// <param name="windowCaption">Ablak címe</param>
/// <param name="sizex">Ablak szélessége</param>
/// <param name="sizey">Ablak magassága</param>
/// <param name="deviceType">A render eszköz típusa ("DriverType.OpenGL;" (OpenGL) vagy "DriverType.Direct3D8;"/"DriverType.Direct3D9;" (DirectX))</param>
/// <param name="mapName">Betöltendő pálya neve a kiterjesztés nélkül (pl. "devmap")</param>
/// <param name="pak0">A pak0 fájl neve (pl. "pak0" vagy "pack1")</param>
/// <param name="pak1">A pak1 fájl neve (pl. "pak1" vagy "pack4")</param>
/// <param name="pak2">A pak2 fájl neve (pl. "pak2" vagy "pack2")</param>
public static void createScreen(string windowCaption, int sizex, int sizey, DriverType deviceType, string mapName, string pak0, string pak1, string pak2, bool isFullScreen)
{
//Ablakot megjeleníteni
if (isFullScreen == true)
{
device = IrrlichtDevice.CreateDevice(deviceType, new Dimension2Di(sizex, sizey), 32, true, false, true);
}
else
{
device = IrrlichtDevice.CreateDevice(deviceType, new Dimension2Di(sizex, sizey), 32, false, false, true);
}
if (device == null)
return;
AnimatedMesh q3levelmesh = null;
device.OnEvent += new IrrlichtDevice.EventHandler(device_OnEvent);
device.SetWindowCaption(Property.modName + " Build " + Property.modVersion);
driver = device.VideoDriver;
smgr = device.SceneManager;
GUIEnvironment gui = device.GUIEnvironment;
//fadein
GUIInOutFader fader = device.GUIEnvironment.AddInOutFader();
fader.SetColor(new Color(0, 0, 0, 255));
fader.FadeIn(2000);
//hurtOverlay = device.GUIEnvironment.AddImage(driver.GetTexture("./Content/2D/Overlays/hurt.png"), new Vector2Di(0, 0));
//hurtOverlay.Visible = false;
GUIImage copyrightScreen = device.GUIEnvironment.AddImage(driver.GetTexture("./Content/2D/exit.tga"), new Vector2Di(0, 0));
float guiScalex = sizex / 800;
float guiScaley = sizey / 600;
copyrightScreen.Visible = false;
copyrightScreen.ScaleImage = true;
copyrightScreen.SetMaxSize(new Dimension2Di(sizex, sizey));
copyrightScreen.SetMinSize(new Dimension2Di(sizex, sizey));
//Betölteni a mapot
try
{
device.FileSystem.AddFileArchive("./Content/PK3/" + pak0 + ".edsf");
}
catch (Exception ex)
{
Logger.Log("pak0 fajl betoltese sikertelen vagy nem talalhato, a jatek nem tud betoltodni");
string error = ex.ToString();
Logger.Log(error);
Environment.Exit(0);
}
try
{
device.FileSystem.AddFileArchive("./Content/PK3/" + pak1 + ".edsf");
}
catch (Exception ex)
{
Logger.Log("pak1 fajl betoltese sikertelen vagy nem talalhato, ignoralva");
string error = ex.ToString();
Logger.Log(error);
}
try
{
device.FileSystem.AddFileArchive("./Content/PK3/" + pak2 + ".edsf");
}
catch (Exception ex)
{
Logger.Log("pak2 fajl betoltese sikertelen vagy nem talalhato, ignoralva");
string error = ex.ToString();
Logger.Log(error);
}
try
{
q3levelmesh = smgr.GetMesh(mapName + ".bsp");
}
catch (Exception ex)
{
Logger.Log("Palya betoltese sikertelen vagy nem talalhato, a jatek nem tud betoltodni");
string error = ex.ToString();
Logger.Log(error);
Environment.Exit(0);
}
MeshSceneNode q3node = null;
q3node = smgr.AddOctreeSceneNode(q3levelmesh.GetMesh(0), null, IDFlag_IsPickable);
q3node.Position = new Vector3Df(-1350, -130, -1400);
SceneNode node = null;
if (mapName == "rpg")
{
IsRPG = true;
}
//LightSceneNode light = smgr.AddLightSceneNode(q3node, new Vector3Df(-1319, -118, -1410), new Color(255, 255, 255), 600.0, 10);
//Half-Life Headcrab
AnimatedMeshSceneNode anode3 = smgr.AddAnimatedMeshSceneNode(smgr.GetMesh("./Content/3D/headcrab.mdl"));
if (IsRPG)
//.........这里部分代码省略.........