Farseer Physics question.

Lets say I have a scene like this:

The red rectangle and blue rectangle are different bodies with different properties. So if one weighed more than the other while falling it should rotate to where whatever rectangle weighed more would hit the ground. However for this instance lets assume the both have the same physical properties so when falling they dont rotate. Since they’re different bodies it’ll end up like this(assuming they ignore collision with each other):

when I want it to turn out like this:

how would I do this? I’m a bit confused with physics and the library in general. I think it might have something to due with joints possibly. Anyways help greatly appreciated!
Thank you :).

If you want the two bodies to stick together use the WeldJoint.

To get them to rotate when falling you need to implement an Air friction controller and/or a buoyancy controller. Farseer has a buoyancy controller for water, with the right settings that might work for air. Otherwise I wouldn’t expect to see a rotation there. No matter what the difference in mass is, both bodies are accelerated down at the same speed.
[Feather & Hammer Drop on Moon] https://www.youtube.com/watch?v=5C5_dOEyAfk

1 Like

It’s simpler to create a single body and add 2 rectangular fixtures to it.
In that case you can’t have different properties (restitution,etc) per fixture. You can only adjust the center of mass to simulate differences in mass.

1 Like

Thank you so much! And the rotation thing, I would of never thought that would happen(the feather and the hammer) atleast until I took physics but thats a couple of years away. Again thank you :).

Alright, so I’m finally actually implementing this. In order to add the one bodies fixtures to another bodies
could I just do something like

foreach fixture in body2 add into body1.fixturelist

remove body2 from world

Do you see any problems with this? I know I can just test this myself and I’m sorry if I’m annoying you but Its easier to know that someone educated in this field feels it will work in every situation rather than me just guessing. Again sorry if this is an annoyance.

Never done anything like that, you have to try it ourself.
Reuse of fixture object might not work so i would try cloning the fixtures instead, or creating new one from it’s Vertces.

Replying for people wanting to do this in the future:

So I first tried doing weld joints, which SEEMED like it worked but… It really didnt, for insert reason here it was making the other transform’s position be exactly where the first transform is and didn’t change the size for me and I had no control over the offset of both shapes. So I decided to look through the Farseer Physics examples(I know I should of done this, but back when I was trying to create a texture to polygon, the samples didn’t help so this wasn’t my first place to go; it should have been) Looking at sample 3, which shows exactly the type of physic simulation I want, Fixturefactory actually has a method to attach a rectangle/circle etc, and now I got the simulation I was searching for :smile: