Physics: Circle in a Circle

Simple concept, complicated execution (I think).

I want to have a circle inside of another circle that spins around. The small (inner) circle should be affected by gravity but the big (outer) circle should be spinning. Like a ball in a wheel.

Any ideas on how to start this? Thanks.  :smiley:

See picture for reference (kinda):

pic1.gif

Hi @sirnemo,

So this is like a “tumbler” where the outer circle spins around, and the inner circle bounces around inside it? The execution will be a bit complex, but not impossible. Since you can’t “carve out holes” in Box2D physics bodies, you’ll need to construct the outer circle from several separate bodies. This gets inherently complex because you can’t have any concave bends in any one part, so you’ll need to do the best you can by constructing a large ring from many pieces.

Once you do that, the other part is straightforward enough… just put the smaller circle inside, start rotating the outer ring, and you’re done. :slight_smile:

Hope this helps,

Brent

That’s what I feared I might have to do, haha. Thanks!  :slight_smile:

I believe that spritehelper includes a physics tool to create the shapes more easily:

http://www.gamedevhelper.com/spritehelper/

Not sure if it’s automatic or if you set points manually (I think you can do both).

PhysicsEditor definitely helps with this… in fact, to trace a “doughnut” I think you’ll really benefit from a helper tool. Doing it manually is (again) “possible” but will be time-consuming.

http://www.codeandweb.com/physicseditor

Have fun!

Brent

Version 2.0 of SpriteHelper now called Animo Sprites will be a better suit

http://www.gamedevhelper.com/animo-sprites/

It supports creating holes really easy.

Oh wow, I’ll have to try these out. Thanks!

Hi @sirnemo,

So this is like a “tumbler” where the outer circle spins around, and the inner circle bounces around inside it? The execution will be a bit complex, but not impossible. Since you can’t “carve out holes” in Box2D physics bodies, you’ll need to construct the outer circle from several separate bodies. This gets inherently complex because you can’t have any concave bends in any one part, so you’ll need to do the best you can by constructing a large ring from many pieces.

Once you do that, the other part is straightforward enough… just put the smaller circle inside, start rotating the outer ring, and you’re done. :slight_smile:

Hope this helps,

Brent

That’s what I feared I might have to do, haha. Thanks!  :slight_smile:

I believe that spritehelper includes a physics tool to create the shapes more easily:

http://www.gamedevhelper.com/spritehelper/

Not sure if it’s automatic or if you set points manually (I think you can do both).

PhysicsEditor definitely helps with this… in fact, to trace a “doughnut” I think you’ll really benefit from a helper tool. Doing it manually is (again) “possible” but will be time-consuming.

http://www.codeandweb.com/physicseditor

Have fun!

Brent

Version 2.0 of SpriteHelper now called Animo Sprites will be a better suit

http://www.gamedevhelper.com/animo-sprites/

It supports creating holes really easy.

Oh wow, I’ll have to try these out. Thanks!