terrachild
28-09-2007 01:55:21
I can't get the mogre newton demo sample to run.
It seems to choke on create scene. I commented out parts of it to see where it is throwing an exception. If I comment out the first section it seems to make it to a breakpoint at camera.Setposition.
But the moment I uncomment out the line: m_World = new World();
or, if I uncomment out the "SceneParser" TreeCollision section it throws a File not found exception.
What am I doing wrong?
It seems to choke on create scene. I commented out parts of it to see where it is throwing an exception. If I comment out the first section it seems to make it to a breakpoint at camera.Setposition.
But the moment I uncomment out the line: m_World = new World();
or, if I uncomment out the "SceneParser" TreeCollision section it throws a File not found exception.
What am I doing wrong?
public override void CreateScene()
{
//// Newton initialization
//m_World = new World();
//MogreNewt.Debugger.Instance.Init(sceneMgr);
// sky box.
sceneMgr.SetSkyBox(true, "Examples/CloudyNoonSkyBox");
// shadows on!
sceneMgr.ShadowTechnique = ShadowTechnique.SHADOWTYPE_STENCIL_ADDITIVE;
// floor object!
Entity floor;
SceneNode floornode;
floor = sceneMgr.CreateEntity("Floor", "simple_terrain.mesh");
floornode = sceneMgr.RootSceneNode.CreateChildSceneNode("FloorNode");
floornode.AttachObject(floor);
floor.SetMaterialName("Simple/BeachStones");
floor.CastShadows = false;
//-------------------------------------------------------------
// add some other objects.
Entity floor2;
SceneNode floornode2;
floor2 = sceneMgr.CreateEntity("Floor2", "simple_terrain.mesh");
floornode2 = floornode.CreateChildSceneNode("FloorNode2");
floornode2.AttachObject(floor2);
floor2.SetMaterialName("Simple/BeachStones");
floor2.CastShadows = false;
floornode2.SetPosition(80.0f, 0.0f, 0.0f);
Entity floor3;
SceneNode floornode3;
floor3 = sceneMgr.CreateEntity("Floor3", "simple_terrain.mesh");
floornode3 = floornode.CreateChildSceneNode("FloorNode3");
floornode3.AttachObject(floor3);
floor3.SetMaterialName("Simple/BeachStones");
floor3.CastShadows = false;
floornode3.SetPosition(-80.0f, -5.0f, 0.0f);
floornode3.Orientation = new Quaternion(new Degree(15.0f), Vector3.UNIT_Z);
//-------------------------------------------------------------
//// using the new "SceneParser" TreeCollision primitive. this will automatically parse an entire tree of
//// SceneNodes (parsing all children), and add collision for all meshes in the tree.
//MogreNewt.CollisionPrimitives.TreeCollisionSceneParser stat_col = new MogreNewt.CollisionPrimitives.TreeCollisionSceneParser(m_World);
//stat_col.ParseScene(floornode, true);
//MogreNewt.Body bod = new MogreNewt.Body(m_World, stat_col);
//stat_col.Dispose();
//bod.AttachToNode(floornode);
//bod.SetPositionOrientation(new Vector3(0.0f, -20.0f, 0.0f), Quaternion.IDENTITY);
// position camera
camera.SetPosition(0.0f, -3.0f, 20.0f);
//make a light
Light light;
light = sceneMgr.CreateLight("Light1");
light.Type = Light.LightTypes.LT_POINT;
light.SetPosition(0.0f, 100.0f, 100.0f);
}