Hinge2Vehicle Demo (with source code)

Show what you made with Bullet Physics SDK: Games, Demos, Integrations with a graphics engine, modeler or any other application
Post Reply
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Hinge2Vehicle Demo (with source code)

Post 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.
Attachments
Hinge2VehicleDemo.7z
(249.03 KiB) Downloaded 1311 times
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: Hinge2Vehicle Demo (with source code)

Post by Flix »

Here is a pic of the demo in action:
HingeVehiclesDemo.JPG
HingeVehiclesDemo.JPG (16.68 KiB) Viewed 10984 times
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
wheelShape2.JPG (9.63 KiB) Viewed 10984 times
Post Reply