Shape/Body that will move but not be affected by gravity?
Posted: Wed Dec 31, 2014 12:14 am
Hello, I am working on a project using Chipmunk, Gosu, and Ruby. I am trying to create a body that will not be affected by gravity / other outside forces, but will move with a set velocity and rebound off of objects realisticly. Something like the image in the attached file.
First I tried making the ball a static body, but that just resulted in the ball staying stationary when created no matter what forces were applied to it (Duh.)
Then I tried using. However, I was not able to find this method in the bindings, and could not use it.
Next I tried to add the balls with real bodies, but with elasticities in the 50s. once the balls were able to hit multiple sides of the box, their velocity increased exponentially, and they skyrocketed out of the area.
Here is my (Broken) Ball Class
Thanks.
First I tried making the ball a static body, but that just resulted in the ball staying stationary when created no matter what forces were applied to it (Duh.)
Then I tried using
Code: Select all
CP::Space.rehash_static()
Next I tried to add the balls with real bodies, but with elasticities in the 50s. once the balls were able to hit multiple sides of the box, their velocity increased exponentially, and they skyrocketed out of the area.
Here is my (Broken) Ball Class
Thanks.