ODE car sample

Sorry for comments in russian, but if needed, i can try to translate it

panda3d.org.ru/load/0-0-0-10-20


New version with fake moving forward:

panda3d.org.ru/load/0-0-0-14-20

Neat example, thanks for sharing!

Nice! I’ll look into the code when I’ve got more time. I’ve been trying to do an ODE car.

hi ninth,

yes indeed a great sample, it motivated me to work on it and i have been able to improve stability with faster speeds. i have put together a updated version (which is worse commented) but gives some hints how to add roads etc.

download it here: http://public.nouser.org/~rspoerri/Development/python/panda3d/projects/ode_car/10_ODE_car_stable.tar.bz2

btw: it would be great if you’d translate the comments.

It’s really more stable! :slight_smile:
I didn’t know about FiniteRotation routine )
But why you use sphere geometry, instead of cyllinder? With sphere it behaves strange, when i release acceleration and try to turn. IMHO, with cyllinder it more realistic.

And about translation - ok, but i do not think that it is necessary to you )))

New version :slight_smile:

panda3d.org.ru/load/0-0-0-14-20

I try to use fake method for moving the car forward. Now it like a jet engine.
I apply force directly to a body of the car, and it look more stable and realistic (especially on the high speed), in spite of the fact that it false.
Moving backward remains former.
Some cosmetic changes are made.
The track is added.

And i made double comments - in Russian and in English

Hi,

Thanks for the code. Using this snippet, I am now trying to make a game of my own, but I have been facing a problem.

I really can’t find the line, by which I could change the direction of the car and make it straight. The screenshot of the game is attached with the comment.

Could someone please help me? Thanks

Try to set Quaternion or Matrix to the car.body.
For example:

        q = Quat()
        q.setHpr(Vec3(30, 0, 0))
        self.car.body.setQuaternion(q)