# MogreNewt Problems

puso1990

08-03-2012 22:17:14

I have real problems with MogreNewt and Mogre. I seen allot of stuff around MogreNewt on web, but everything is old. I use Mogre 1.7.1 and MogreNewt 2.25.

But it's kinda new I guess, so from that Basics and Vehicle samples, the following lines don't work for example:
``` // For the debug lines if (inputKeyboard.IsKeyDown(MOIS.KeyCode.KC_F3)) { MogreNewt.Debugger.Instance.ShowLines(m_World); } else { MogreNewt.Debugger.Instance.HideLines(); }```

Because MogreNewt.Debugger doesn't contain a definition for Instance.
Nowhere will you find ShowLines and HideLines functions.

Another example:
```Body MakeSimpleBox(Vector3 size, Vector3 pos, Quaternion orient) { // base mass on the size of the object. float mass = size.x * size.y * size.z * 2.5f; // calculate the inertia based on box formula and mass Vector3 inertia = MogreNewt.MomentOfInertia.CalcBoxSolid(mass, size); Entity box1; SceneNode box1node; box1 = sceneMgr.CreateEntity("Entity" + (mEntityCount++), "box.mesh"); box1node = sceneMgr.RootSceneNode.CreateChildSceneNode(); box1node.AttachObject(box1); box1node.SetScale(size); box1.NormaliseNormals = true; MogreNewt.Collision col = new MogreNewt.CollisionPrimitives.Box(m_World, size); MogreNewt.Body bod = new MogreNewt.Body(m_World, col); col.Dispose(); bod.AttachToNode(box1node); bod.SetMassMatrix(mass, inertia); bod.IsGravityEnabled = true; box1.SetMaterialName("Examples/10PointBlock"); bod.SetPositionOrientation(pos, orient); return bod; }```

MomentOfInertia doesn't exist too.
AttachToNode() is different: AttachNode();

Please tell me, what versions are these, cause I can't work with MogreNewt 2.25. These libraries have no documentation, but you can at least learn from samples, but I can't cause they don't work on this version.

Please help, cause it's really frustrating and after 30 hours of strugling without a break, I'm really exhausted.

Thanks for your help, you have no idea how much it means to me.
Cheers, puso1990

GantZ

11-03-2012 13:59:00

Hi,

for the debugger, you have to use the property DebuggerInstance of your newton world, after initializing the debugger for example :

``` World m_World = new World(); m_World.DebuggerInstance.Init(sceneMgr); //here scene manager is a reference to your current mogre scene manager m_World.DebuggerInstance.ShowDebugInformation(); ```

moment of inertia is not needed anymore, you calculate your inertia this way :

``` MogreNewt.Collision col = new MogreNewt.CollisionPrimitives.Box(m_World, size); col.CalculateInertialMatrix(out inertia, out offset); inertia = inertia * mass; ```

Beauty

16-03-2012 12:28:34

Hi puso1990,
welcome to the Mogre world. It's always nice to see new faces

Some prebuild binaries for Mogre 1.7.3 and MogreNewt 2.33 you find here. (I call them "Cygon builds".)

Currently user Zarifus improves the MogreBuilder tool.
It's planned to add support for MogreNewt wrapping.

The problem: Zarifus doen't know much about MogreNewt.
GantZ, would you like to help him?
Just give basic information (where to find the latest sources, build instructions, etc.).

Here is the topic of the MogreBuilder:
viewtopic.php?f=8&t=29272

puso1990

21-03-2012 16:31:18

Thanks man, I'll try this soon