Keeping bodies from going through other bodies
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Keeping bodies from going through other bodies
So I've got a platform rotating based on the change in mouse position. And a ball. Yes it's Tilt. And if I rotate the platform fast enough, the ball will go right through the platform. Even if I'm using CCD. Or if I increase the thickness of the platform. Anything I can do besides limiting the speed of the platform?
- Jasoco
- Inner party member
- Posts: 3725
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Keeping bodies from going through other bodies
A) Are you rotating the platform by setting its angle manually? Or by setting its impulse or whatever? Because if it's the former, there's your problem.
B) Have you tried setting the ball as a bullet?
B) Have you tried setting the ball as a bullet?
Re: Keeping bodies from going through other bodies
A. I'm using setAngularVelocity.Jasoco wrote:A) Are you rotating the platform by setting its angle manually? Or by setting its impulse or whatever? Because if it's the former, there's your problem.
B) Have you tried setting the ball as a bullet?
B. Yes. Didn't help.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Keeping bodies from going through other bodies
Have you tried updating the physics world with fixed (small) timesteps?
Re: Keeping bodies from going through other bodies
Wouldn't that make the physics run at different speeds on different computers?bartbes wrote:Have you tried updating the physics world with fixed (small) timesteps?
Re: Keeping bodies from going through other bodies
No, just divide the delta time, or make a timer where you put delta time to 0 and when the timer is over it goes back to the original delta time.Tesselode wrote: Wouldn't that make the physics run at different speeds on different computers?
Re: Keeping bodies from going through other bodies
That didn't work. Any other ideas?
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Keeping bodies from going through other bodies
I'd say you've reached the point where you must upload what you've got.
When I write def I mean function.
Re: Keeping bodies from going through other bodies
Well, I think I've pretty much worked around it now, but when I release Tilt r9, you can take out the code for limiting the platform rotation speed and see what I mean.
Re: Keeping bodies from going through other bodies
The Box2D manual isn't explicit about the issue, but it contains this highly suggestive sentence:
Did you try setting your platform to be a "bullet" too? If not, it is worth a try.
Reference: http://www.box2d.org/manual.html
I take this to mean that it is possible for the fast moving non-bullet platform to skip over the small bullet body, since Box2D doesn't use CCD when it processes the platform's movement. I don't know what goes on for certain, since this hasn't come up for me. And I am not intimately familiar with Box2D source code...Box2D performs continuous collision sequentially, so bullets may miss fast moving bodies.
Did you try setting your platform to be a "bullet" too? If not, it is worth a try.
Reference: http://www.box2d.org/manual.html
Who is online
Users browsing this forum: Google [Bot] and 231 guests