Loading
06-12-2006 02:19:19
Hi!
I'm new to the forums, and Mogre and MogreNewt too. I'm having some difficulty trying to get MogreNewt to work. I followed all the code and C++ tutorials i could find until I got it as good as I could get it. Here is the code i used to make a few stuff fall onto a box.
Here's my code:
It compiles but then all of a sudden I get a File Not Found Exception! out of nowhere!
I have tried everything I could and I found out that the 1 line of code that actually made the exception happen was this like:
Is there anything that I'm doing wrong to get that random exception? ANY help is needed and appreciated.
Thank you for your support of a n00b like me.
I'm new to the forums, and Mogre and MogreNewt too. I'm having some difficulty trying to get MogreNewt to work. I followed all the code and C++ tutorials i could find until I got it as good as I could get it. Here is the code i used to make a few stuff fall onto a box.
Here's my code:
void CreateScene()
{
mgr = mRoot.CreateSceneManager(SceneType.ST_EXTERIOR_CLOSE);
mWorld = new World();
cam = mgr.CreateCamera("PlayerCamera");
//cam.Position = new Vector3(50000, 1500, 50000);
camPosition = cam.Position;
//cam.LookAt(1, 0, 0);
Radian r = new Radian();
r = 1.5f;
cam.Pitch(r);
camLookAt = new Vector3(cam.Direction.x, cam.Direction.y, cam.Direction.z);
cam.NearClipDistance = 1;
cam.FarClipDistance = 1000000;
mRoot.AutoCreatedWindow.AddViewport(cam);
mgr.AmbientLight = new ColourValue(1, 1, 1);
//Load The Terrain
//mgr.SetWorldGeometry("terrain.cfg");
//All Physics Models Created Here
Vector3 size = new Vector3(100f, 1.0f, 100.0f);
SceneNode node = mgr.RootSceneNode.CreateChildSceneNode();
Entity ent = mgr.CreateEntity( "floorobj", "box.mesh" );
node.AttachObject( ent );
node.SetScale( size );
Collision col = new MogreNewt.CollisionPrimitives.Box( mWorld, size );
Body floorbody = new Body(mWorld, col);
floorbody.attachToNode(node);
floorbody.setPositionOrientation( new Vector3(0,-5,0), Quaternion.IDENTITY );
col.Dispose();
// CYLINDER BODY
// cylinder with a radius of 0.5, height of 1.3
size = new Vector3( 1.3f, 0.5f, 0.5f );
node = mgr.RootSceneNode.CreateChildSceneNode();
ent = mgr.CreateEntity("cylinder_body", "cylinder.mesh" );
node.AttachObject( ent );
node.SetScale( size );
// rigid body.
col = new MogreNewt.CollisionPrimitives.Cylinder( mWorld, 0.5f, 1.3f );
Body bod = new Body( mWorld, col );
bod.attachToNode( node );
// initial position
bod.setPositionOrientation( new Vector3(-2,3,2), Quaternion.IDENTITY );
col.Dispose();
float mass = 10.0f;
Vector3 inertia = MomentOfInertia.CalcCylinderSolid( mass, 0.5f, 1.3f );
bod.setMassMatrix( mass, inertia );
bod.IsGravityEnabled = true;
//Set Fog
ColourValue fadeColour = new ColourValue(0.9f, 0.9f, 0.9f);
mgr.SetFog(FogMode.FOG_EXP, fadeColour, 0.0001f);
mgr.SetSkyDome(true, "Examples/CloudySky", 5, 8, 500, true);
}
It compiles but then all of a sudden I get a File Not Found Exception! out of nowhere!
I have tried everything I could and I found out that the 1 line of code that actually made the exception happen was this like:
Collision col = new MogreNewt.CollisionPrimitives.Box( mWorld, size );
Is there anything that I'm doing wrong to get that random exception? ANY help is needed and appreciated.
Thank you for your support of a n00b like me.


