Space Friction

Irrisor, I know you went through the whole complicated aspect of having adjustment thrusters on your ships in your game but I'm thinking friction is the way I'm going to go right now.  If I get hit by something and start spinning I want that spinning to gradually move toward 0.  I would like this for all forces on the ships in my game.  Is a controller the best way to go still like I did when I wrote the rotational physics for jME-Physics1 or is there a better way (or already implemented way) to do this now?

Like in jME Physics 1 you can use the update callbacks. Apply forces or reduce velocities in each physics step (not each update).

I'll give that a shot, thanks.

Also, do you see the usefulness of an arbitrary friction system (you can specify rotational, directional, etc frictions) like this in jME-Physics or should I keep it to myself? :wink:

sure, might be really useful - we could probably combine this with the groups (proposed by me for collisions in another thread)

Good idea.  It will probably be after the first combat demo is released of GB before I'm going to start needing the groups so I'm probably not going to be messing much directly with that for a while.

Just in case it helps you, I

The FrictionController is optional.  You can take it or leave it but for those that want to use it can.  It's pretty general purpose though, so I can imagine it can be useful in many circumstances.

@jjmontes: well it's not 'wrong' but it has different effects with different frame rates. So I can't recommend it. If you'd do it per step (not per update) with fixed step size (as in current ODE impl) it would not depend on the frame rate any more.

Thanks irrisor.

I'm more or less aware of the framerate problem. It is in fact being nearly impossible for me to balance physics aplying updates per frame, instead of per physics update.

However in my first tests I didn

You need a high number of physics steps to provide accurate enough simulation. So step size of 0.01 and below (more steps per second) are usually needed. For fast moving objects you'll even need 0.001 or below, as ODE does not account for movement in the collision checks…

So, if I

I believe Bullet is supposed to handle that but that's because I believe it doesn't deal in steps at all…

I would suggest for bullets to not use physics collisions at all but rather project a ray and determine collisions for the given time updates.

:frowning: I

Using (physics-)rays or long (phyiscs-)capsules for bullets should be fine. And performance should be fine too, as soon as we support collision groups (ODE's collision spaces)… not sure when this would be the case, though…

collision groups is on the horizon for me to implement if nobody gets around to it before I do.  I am going to have a need for it, but I don't think I will necessarily need it until after the combat demo is released.