Yes, I have tried settings the platforms and the ball to be bullets at the same time.pekka wrote:The Box2D manual isn't explicit about the issue, but it contains this highly suggestive sentence:
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
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.
Re: Keeping bodies from going through other bodies
Re: Keeping bodies from going through other bodies
I'm not sure. It's kind of weird, because my little hack of your game doesn't display the behavior -- rotating the platforms fast enough will still make balls fly off in the right direction.
Just as a note, though, it would be wise to do the speed check before ever setting the motion, cap it, then update it once and be done with it.
Code: Select all
if platform_active[a]==1 and love.mouse.isDown("l") then --rotate platforms
platform[a]:setAngularVelocity(math.rad(((mousex-mousex_previous)+(mousey-mousey_previous))/3)/love.timer.getDelta())
else
platform[a]:setAngularVelocity(0)
end
--limit platform rotation speed
local rotspeedlimit=platform_size[a]/300
if rotspeedlimit<1 then rotspeedlimit=1 end
if platform[a]:getAngularVelocity()>math.rad(300/rotspeedlimit) then platform[a]:setAngularVelocity(math.rad(300/rotspeedlimit)) end
if platform[a]:getAngularVelocity()<math.rad(-300/rotspeedlimit) then platform[a]:setAngularVelocity(math.rad(-300/rotspeedlimit)) end
Who is online
Users browsing this forum: No registered users and 87 guests