I'm having a bit of a problem wrapping my head around windings. I'm using the Ruby bindings. I have a rectangle with x, y, width, height, where 0,0 is top-left. I am using this:
mass = 5.0
vertices = [CP::Vec2.new(0,0), CP::Vec2.new(0, height, CP::Vec2.new(width, height), CP::Vec2.new(width, 0)]
body = CP::Body.new(mass, CP::moment_for_poly(mass, vertices, CP::Vec2.new(0, 0)))
shape = CP::Shape::Poly.new(body, vertices, CP::Vec2.new(0,0))
body.p = CP::Vec2.new(x,y)
is this right? I ask, because I have a floor as well, and sometimes when the object is bouncing off the floor it rotates (which is fine) but then falls through (not so fine). If I set a line width on the floor to 100 or so I can see that the object is not falling all the way through, just down a bit. It does not fall more than this initial bit. Odd.