Ball bouncing like crazy sometimes
Posted: Mon Aug 22, 2011 12:30 am
Hello Chipmunk community,
I recently picked up this library, and I'm liking it.
I also picked up the C++ wrapper, but it was very far out of date. I had to make many modifications to make it work with the latest version of chipmunk physics.
I was impressed to see that I could quickly apply forces to a ball in a space, but problems started happening when I created a square shaped frame of static segments around my game's screen boundaries.
I created a free floating ball, whose movement is affected by gravity and some impulses sent by pressing the arrow keys. Sometimes, when this ball bounces on a segment, it makes a healthy bounce. Other times, instead of bouncing from a segment normally, the ball will, on contact with the segment, suddenly be sent flying outside of the play area. Due to the insane speed, it goes right through my walls and goes faaaaar away.
Does somebody know what could be causing this issue? Could it be a problem with the C++ wrapper, am I forgetting to set a default value? I tried playing with mass and elasticity with no luck.
As for the updates to the C++ wrapper I had to implement, I would be glad to upload them somewhere and share them with the community, but I want to be sure that it's not causing any issues.
Thank you in advance!
Nicolas
ps: If somebody wants to work with me on updating and cleaning up the C++ wrapper, feel free to contact me at nicolasg@uvic.ca
I recently picked up this library, and I'm liking it.
I also picked up the C++ wrapper, but it was very far out of date. I had to make many modifications to make it work with the latest version of chipmunk physics.
I was impressed to see that I could quickly apply forces to a ball in a space, but problems started happening when I created a square shaped frame of static segments around my game's screen boundaries.
I created a free floating ball, whose movement is affected by gravity and some impulses sent by pressing the arrow keys. Sometimes, when this ball bounces on a segment, it makes a healthy bounce. Other times, instead of bouncing from a segment normally, the ball will, on contact with the segment, suddenly be sent flying outside of the play area. Due to the insane speed, it goes right through my walls and goes faaaaar away.
Does somebody know what could be causing this issue? Could it be a problem with the C++ wrapper, am I forgetting to set a default value? I tried playing with mass and elasticity with no luck.
As for the updates to the C++ wrapper I had to implement, I would be glad to upload them somewhere and share them with the community, but I want to be sure that it's not causing any issues.
Thank you in advance!
Nicolas
ps: If somebody wants to work with me on updating and cleaning up the C++ wrapper, feel free to contact me at nicolasg@uvic.ca