bouncing balls
i am messing with some physics junk, and i have a ball bouncing around in a box (with gravity and mass). Over time, the ball''s bounce gets smaller and smaller like in real life.
But my question is, how do you determine of a ball will bounce or just roll down an incline?
Right now it is just bouncing and bouncing until it reaches a standstill and sits there on the incline (when it should be rolling down it).
--------------------------------------------------------------If it sounds like a good idea, do it. It is much harder to get permission than it is to apologize.
There is no bouncing/rolling state transition. Rolling should be present anytime the ball hits a wall, if there is friction. Even if the ball bounces, it should gain some angular momentum.
If your ball is standing still on an incline, you have a big problem with the way you are handling bounce; the variation of linear momentum (ie.: speed * mass) when you hit a wall should be in the direction of the normal to the plane.
v'' = v - Normal * DotProduct(v, Normal) * k
if the normal is normalized. It''s just a quick approximation and doesn''t have that much grounding in real physics, but it should at least allow balls to go down slopes, although you''ll have to do additional work to get them rolling. Ask again if you need more information.
Cédric
If your ball is standing still on an incline, you have a big problem with the way you are handling bounce; the variation of linear momentum (ie.: speed * mass) when you hit a wall should be in the direction of the normal to the plane.
v'' = v - Normal * DotProduct(v, Normal) * k
if the normal is normalized. It''s just a quick approximation and doesn''t have that much grounding in real physics, but it should at least allow balls to go down slopes, although you''ll have to do additional work to get them rolling. Ask again if you need more information.
Cédric
what is v1, v, and k?
--------------------------------------------------------------If it sounds like a good idea, do it. It is much harder to get permission than it is to apologize.
HOLY CRAPMAGIC!!! it works!!! thank you!!!
as you can tell i am very happy.
btw you can ignore my last post as i figured out it is quite obvious what those variables are.
as you can tell i am very happy.
btw you can ignore my last post as i figured out it is quite obvious what those variables are.
--------------------------------------------------------------If it sounds like a good idea, do it. It is much harder to get permission than it is to apologize.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement