Mogrenewt and Vehicle class

OwwZ

05-04-2014 22:48:01

Hi,

Is the Vehicle class implemented in the latest mogrenewt builds? it seems like it's not available and in the mogrenewt source it is "hidden" behind "#ifdef INCLUDE_VEHICLE".
I tried to compile with it and I get tons of errors, so I guess it's hidden for a reason, but I still noticed an example that is using it as if it's implemented:
https://svn.code.sf.net/p/mogre/code/tr ... leVehicle/

If it's not implemented, are there any known alternatives that were created?

Thanks

Beauty

15-04-2014 23:42:16

Hi OwwZ,

welcome to our Mogre community. :D

Possibly the Vehicle class was implemented in an older version of the MogreNewt wrapper.
One day the wrapper was updated from Newton 1 to Newton 2. Maybe there were problems with wrapping this function (or it was removed from Newton??).

Yes, you could try to re-add it by modification of the sources.
The compilation is a little bit tricky if you don't have all needed files on the correct places.
Here I wrote some information about: viewtopic.php?p=100289#p100289

I hope this helps you.

OwwZ

23-04-2014 05:27:16

Thank you Beauty for responding, and for welcoming me.

I managed to compile it with the Vehicle class disabled, (I also added the HeightFieldCollision feature posted here 2 years ago by cyberjunk because I needed it to be compiled against newton 2.35 and Mogre 1.7.4+new terrain build and I would gladly post it in here if I knew how - I couldn't find such compiled builds and I think it can help others that don't know how to compile mogrenewt AKA me about a week ago :wink:).


Sadly if I understand what I read in the Newton documentations/forums correctly, they dropped the Vehicles support with Newton 2 (in fact most of the Newton functions that are being used by the Vehicle class in Mogrenewt are omitted in the Newton 2 source code). I guess it's possible to do it in other ways, but I couldn't find any explanation or even a hint/lead about what those ways are.

After several... umm... unusual attempts made out of pure desperation (getting the Vehicle class to work in mogrenewt 2 by using the relevant Newton 1 functions for the Vehicle class from the Newton 1 lib, or using both Mogrenewt 1 and 2 at the same time in one world) I tried to create my own C# Vehicle class as part of my project code that uses mogrenewt 2.

I got something that has independent wheels and can go forward/reverse over a terrain in somewhat reasonable way, but I have almost no knowledge about physics so I wouldn't even know where to begin in order to make it turn properly in a way that will act even remotely close to a vehicle.

I assumed that creating a "simple" (not necessarily super-realistic, something that goes forward/back and can turn) vehicle or something similar would be quite a common need among game developers, I got to admit that I'm very surprised regarding how little information I found about this subject in the Ogre/Mogre/Newton "area" (all I could find is how to do it with the old Newton version that supported the Vehicle class), or maybe I'm just not looking hard enough?

Beauty

24-04-2014 23:26:57

I managed to compile it
Nice to hear that you were successful.

I also added the HeightFieldCollision feature
This is interesting. Some years ago I missed this feature.

I would gladly post it in here if I knew how
This would be nice. Aside the binaries you should publish the updated code.
You can upload it to your private BitBucket account and then create a pull request to the official repository.
If you don't have a BitBucket account yet, just create it. It's very easy. Then create a new repository and tell the wizard point to the official repository.

compiled against newton 2.35
The latest binary version of Newton 2 seems to be 2.36.
Changelog: Minor buf fixes on ray cast and in capsule and cone shapes. Also last public realease of core 200.
If you are interested, look here: http://code.google.com/p/newton-dynamics/downloads/list

Sadly [...] they dropped the Vehicles support with Newton 2 [...].
I guess it's possible to do it in other ways, but I couldn't find any explanation or even a hint/lead about what those ways are.

Did you look to the forum of the Newton community?
When I had problems and requests, I got good support.
If you don't find useful information there, don't be afraid to create a new topic.
By the way: The Newton author (Julio Jerez) published the Newton source code. So in general it could be possible to (re-)add missing features.
It would be interesting, why the vehicle class was removed. Perhaps there are discussions about in the forum.
The Newton forum you find here: http://newtondynamics.com/forum/index.php

I tried to create my own C# Vehicle class as part of my project code [...] but I have almost no knowledge about physics
Nice idea, but it's not easy to create a vehicle dynamics model. I created a simple model for an underwater vehicle with the application Matlab/Simulink. A team mate created a more complex model for an off-the-road vehicle, which tooks several weeks for a realistic looking behaviour.
I think this sub forum (with only a few active members) is no good place for asking for this topic.
My suggestions: Search in (or ask in) the Newton forum and a game developer forums. Possibly you get links to related open source projects. (I suppose you already searched by Google.)