BSP Example

Nachtwind

12-12-2007 23:52:23

Hi, is there an example arround that does not use the Example Framework? Somehow i cant get my code to show up the BSP at all:

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using MogreFramework;
using Mogre;

namespace Test
{
static class Program
{
[STAThread]
static void Main()
{
try
{
OgreWindow win = new OgreWindow();
new SceneCreator(win);
win.Go();
}
catch (System.Runtime.InteropServices.SEHException)
{
if (OgreException.IsThrown)
MessageBox.Show(OgreException.LastException.FullDescription, "An Ogre exception has occurred!");
else
throw;
}
}
}

class SceneCreator
{
private String quakePk3;
private String quakeLevel;

public SceneCreator(OgreWindow win)
{
win.SceneCreating += new OgreWindow.SceneEventHandler(SceneCreating);
}

void SceneCreating(OgreWindow win)
{
// Setting the ambient light
SceneManager mgr = win.SceneManager;
mgr = Root.Singleton.CreateSceneManager("BspSceneManager");
mgr.SetShadowUseInfiniteFarPlane(false);
mgr.AmbientLight = ColourValue.Black;
mgr.ShadowTechnique = ShadowTechnique.SHADOWTYPE_STENCIL_ADDITIVE;



Camera cam = new Camera("cam", mgr);

cam.NearClipDistance = 4F;
cam.FarClipDistance = 4000F;

ViewPoint vp = mgr.GetSuggestedViewpoint(true);

cam.Position = vp.Position;
cam.Pitch(new Degree(90F));
cam.Rotate(vp.Orientation);
cam.SetFixedYawAxis(true, Vector3.UNIT_Z);


ConfigFile cf = new ConfigFile();
cf.Load("quake3settings.cfg", "\t:=", true);
quakePk3 = cf.GetSetting("Pak0Location");
quakeLevel = cf.GetSetting("Map");


ResourceGroupManager.Singleton.AddResourceLocation(quakePk3, "Zip", ResourceGroupManager.Singleton.WorldResourceGroupName, true);
}
}
}


Any ideas?