RigidBody settings for golf ball style bouncing

Columbo
Posts: 3
Joined: Sat Jul 11, 2009 8:08 am

RigidBody settings for golf ball style bouncing

Post by Columbo »

I'm a bit of a noob with bullet, so apologies if this is a bit of a dumb question. Also, big thanks to all Bullet contributors - it's a great project and a huge help for indie developers like myself.

I'm having a little trouble getting my grenades to behave as I would like when they collide with my terrain. I've been playing around with m_restitution on the terrain and the rigid body to control the amount of bounce, and using angular damping to stop my sphere rolling forever, but I'm still not able to get the behaviour I'm after.

My problem is that the collision response seems to be too sensitive to the slope. For instance, when I hit an up-slope, my grenade often ends up bouncing back the way it came, when the slope breaks left or right, the direction of travel changes dramatically. What I'm after is something more like real-world golf-ball behaviour where on a drive shot, the ball reacts to the slope, but usually still ends up travelling in broadly the same direction after the bounce.

I'm no physics expert, but I guess the reason for the difference is that Bullet is modeling rigid bodies, whereas in golf the terrain is soft and deforms as the ball hits it which results in the ball maintaining more of its original direction.

Anyway, my question is - is there some setting in Bullet that can make my grenades less sensitive to the normal of the triangles it's hitting? If not, is there some way of overriding the collision response? Or maybe there's some other good workaround that someone could suggest?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: RigidBody settings for golf ball style bouncing

Post by Erwin Coumans »

Can you try to enable 'splitImpulse' and see if it improves your behaviour?

Code: Select all

discreteDynamicsWorld->getSolverInfo().m_splitImpulse = true;
Hope this helps,
Erwin
Columbo
Posts: 3
Joined: Sat Jul 11, 2009 8:08 am

Re: RigidBody settings for golf ball style bouncing

Post by Columbo »

Thanks for the reply. Split impulse didn't make an awful lot of difference, I'm afraid.

To describe what I'm after in different terms : For gameplay reasons, I want my grenades to bounce off the ground more predictably - the current behaviour is that bounce direction is something like a reflection of the initial direction by the triangle normal - when playing, this makes it hard to know where the thrown grenade will end up because my terrain is very uneven. What I'd like is to be able to hack it so it behaves more like the normal is pointing straight up. i.e. I'd like to be able ignore the undulation of the ground to a certain extent.

I think I'll do the grenade physics as a series of line-of-sight tests instead and handle collisions and bounces myself (unless someone replies with an easy solution using rigid bodies).

Thanks.
AlexSilverman
Posts: 141
Joined: Mon Jul 02, 2007 5:12 pm

Re: RigidBody settings for golf ball style bouncing

Post by AlexSilverman »

You could override the contact manifold collision normal by writing your own ContactAddedCallback and setting gContactAddedCallback to point to it. There's an example of this in the Multimaterial demo (and several others, but I can't remember which offhand so search for "gContactAddedCallback" if you'd like more). In any case, it's a fairly straightforward process that gives you the control you seem to be looking for.

- Alex
Ileana30
Posts: 1
Joined: Mon May 30, 2011 7:52 am

Re: RigidBody settings for golf ball style bouncing

Post by Ileana30 »

Golf balls are waterproof, or at least water resistant. They are designed this way because the manufacturer knows, you will face the moisture in the course. Playing on a wet field, while a shoe or other footwear will result in the feet are soaked in no time. This can cause pain, blisters, and simple poverty. It may not be too obvious, but the shoes will also help maintain correct posture at set-up of his shots. The mechanics of a good swing requires the body to move weight from one foot to another, and do it smoothly. Shoes that help transition the outputs of weight transfer without the feet slide to the left or right.


Golf Platzreife
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm

Re: RigidBody settings for golf ball style bouncing

Post by dphil »

lol, good old spam.
Sylvia01
Posts: 1
Joined: Wed Jun 01, 2011 7:27 am

Post by Sylvia01 »

Bounce (bounce bounce sole angle) the angle of the club is unique compared to the level / horizontal, or the amount of the advance guard of the club is higher than the proportion of the sole of the club which is the lowest (usually used in reference to iron wedges in particular, and measured in degrees) Example: Many sand wedges have a large collar and a significant jump. "

Golfreisen