Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sat Jul 11, 2009 8:43 am 
Offline

Joined: Sat Jul 11, 2009 8:08 am
Posts: 3
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?


Top
 Profile  
 
PostPosted: Mon Jul 13, 2009 9:54 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
Can you try to enable 'splitImpulse' and see if it improves your behaviour?

Code:
discreteDynamicsWorld->getSolverInfo().m_splitImpulse = true;


Hope this helps,
Erwin


Top
 Profile  
 
PostPosted: Thu Jul 16, 2009 7:49 am 
Offline

Joined: Sat Jul 11, 2009 8:08 am
Posts: 3
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.


Top
 Profile  
 
PostPosted: Thu Jul 16, 2009 7:59 pm 
Offline

Joined: Mon Jul 02, 2007 5:12 pm
Posts: 145
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


Top
 Profile  
 
PostPosted: Mon May 30, 2011 7:54 am 
Offline

Joined: Mon May 30, 2011 7:52 am
Posts: 1
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


Top
 Profile  
 
PostPosted: Mon May 30, 2011 4:11 pm 
Offline
User avatar

Joined: Tue Jun 29, 2010 10:27 pm
Posts: 237
lol, good old spam.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 01, 2011 7:30 am 
Offline

Joined: Wed Jun 01, 2011 7:27 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group