Mogre Newton Demo not working. [Solved]


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?

public override void CreateScene()
//// Newton initialization
//m_World = new World();

// 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");

floor.CastShadows = false;

// add some other objects.
Entity floor2;
SceneNode floornode2;
floor2 = sceneMgr.CreateEntity("Floor2", "simple_terrain.mesh");
floornode2 = floornode.CreateChildSceneNode("FloorNode2");
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");
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);

//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);


28-09-2007 04:42:39


What is the exact exception that it's throwing? If you can provided that and maybe the stack trace with it also. If you're in vs2005 (which I suspect) then when ever it pauses at the exception click on "view detail" to get this info. I'm also making the assumption you are running in debug mode in this case also.

Just commenting out stuff randomly will probably only make it harder for you to figure out and debug the problem.

So more than likely the File Not Found is not really your underlying problem.



28-09-2007 08:11:54

Do you have the newton.dll ?
If not, download the latest sdk from the link below. It contains the dll.


29-09-2007 11:14:15


you guessed it. I didn't have it.

I thought if I had MogreNewt.dll that was all I needed.