Vehicle Physics problem

I’ve been experimenting with the vehicle physics. In the latest bullet physics examples, the package contained one 4x4 car example. My problem is that I want the body to be less “bouncy” on the wheels. Is it possible to change this as a parameter? I haven’t seen anything in the py code that I can change, but then again I’m pretty newby with this bullet physics. I appreciate all responses. Thanks…

I haven’t played around with it either, but it has dynamic settings the same as any object, so you can adjust those. There are also dyn settings in the materials section of the object where you can set restitution. Maybe the script overrides those settings, I don’t know.

You can change the stiffness and roll influence at the bottom of the script.


#Some experiment with hinge constraints.

#Don't use such vehicle, use the Ray Cast Vehicle !

#some spheres are 'dynamic' only, no rotation
#this can be used for very basic character control


#Bullet Hinge Constraint


import PhysicsConstraints
import GameLogic

cont = GameLogic.getCurrentController()
scene = GameLogic.getCurrentScene()
#print dir(scene)

owner = cont.getOwner()

root = scene.getObjectList()[ "OB" + owner.root ]
#print dir(root)

point2point = 1
hinge = 2
#constraintType = point2point
constraintType = hinge

oid= owner.getPhysicsId()
rid = root.getPhysicsId()
pivotInAx=owner.pivotX
pivotInAy=owner.pivotY
pivotInAz=owner.pivotZ
axisInAx=0
axisInAy=0
axisInAz=-1


PhysicsConstraints.createConstraint(oid,rid,constraintType,pivotInAx,pivotInAy,pivotInAz,axisInAx,axisInAy,axisInAz)

I’m not quite sure where, but “bottom of the script” would be the above line. Not exactly sure on what to edit, but I’ve played with the numbers and the result was really horrifying.

I played with it once and when the car started moving it would flip out. i just wanted to make it faster…

If you’re interested in making it go faster just apply more torque on the Motion Actuator for each wheel.

thats what i did…i put to much:o

Hi there.

I must say that by going into the vehicle scripts and just playing around with the variables is not going to be succesful until one understands the physics of a vehicle setup.

We have been going through all the documentation we can find, and this is a really useful resource on the subject. I strongly recommend this approach to anyone trying out this topic.

The Physics of Racing Series
This collection of articles written by Brian Beckman, Ph.D. explains the physics of racing in great detail. Brian’s has extensive experience with the creation of computer game physics engines. Starting with the basics of how cars handle, these articles also explain how computer models relate to real world vehicle dynamics

http://www.strictlybmw.com/resources/phors.htm

:slight_smile:

I learn my way through programing by what my CNA instructor told me about Novell administration. “Screw with it until you fix it.” I guess I’d call that pure “reverse-engineering.” :smiley:

I though you were using the other vehicle script. I’ve been messing around with it, and have made some modifications.

The new script has these features.

  1. steering that doesn’t fight itself.

  2. speedometer in MPH or KPH

  3. coast to stop. (sorta, it will still slide down a hill)

  4. max top speed, forward and reverse.

  5. show physics shell (just check the TRUE in the properties)

http://img176.imageshack.us/img176/7042/sc1ga3.th.jpg

http://img172.imageshack.us/img172/5736/sc2pm1.th.jpg

Here is the .blend file:
http://www.savefile.com/files/218114

The vehicle model is from oto’s vehicle demo.
[email protected]

That’s neat, thanks for sharing that!

I still try to “get” these things, but reverse-engineering is playing off. Not a very efficient way to learn, but it works. Of course I wouldn’t recommend it for these complex situations.