Page 1 of 1

Hinge2Vehicle Demo (with source code)

Posted: Sun Jan 31, 2010 9:19 am
by Flix
WHAT'S THIS?

This is a demo about vehicles without raycasting.


IMPLEMENTATION NOTES:

I used a btHinge2Constraint for the wheels, but I disabled the (vertical) suspension spring, because I couldn't find a good setting for it, and I replaced it with a vertical translational motor.
Thus now the suspension model is extremely simple, and raycast vehicles outperform this kind of vehicles easily.

Despite of this, I released this demo because:
1) There was no demo about it.
2) It can still be very useful for modelling very simple vehicles (e.g. toy vehicles).
3) Some particular kind of vehicles (such as trains) can probably be done better with this approach.
4) I've added a bunch of wheel collision shapes that can be used for other purposes too (e.g. in raycast vehicles with convex cast or just as collision shapes for wheel collision detection).


KEYS:

CAMERA:
-------
HOME - change camera view
PAGE_UP / PAGE_DOWN - change camera distance

VEHICLES:
---------
END - change vehicle
ARROW KEYS - drive vehicle

GLOBAL INPUT SPEED:
--------------------
F1 / F2 - decrease / increase input speed to adjust it for your PC power.

All keys must be pressed while the openGL window has focus.


PROBLEM:

The debug drawer doesn't seem to display (at least) one of my wheel collision shapes in a decent way.
No matter, I'm going to post a raytrace pic to show it better soon...


Hope you like it and find it useful.

Re: Hinge2Vehicle Demo (with source code)

Posted: Sun Jan 31, 2010 9:25 am
by Flix
Here is a pic of the demo in action:
HingeVehiclesDemo.JPG
And this is a raytrace screenshot of the most complex wheel collision shape included in the demo (I named it btWheelShape AFAIR), added to show it better:
wheelShape2.JPG