Springy joints?

Jul 21, 2011 at 1:13 PM
Edited Jul 21, 2011 at 1:43 PM

I created a revoluate joint but it runs very loosely (i.e. like a rope). Any chance I can make it springy? Basically after being pushed in any given direction it will spring back to a pre-defined rotation like a spring would?

Also just owndering, is there any quick way of creating ropes? Like a function I can pass in a list of Vector2's into and get a rope out of it?

Jul 21, 2011 at 8:13 PM

First of all, ropes are considered 'paths', take a look at the documentation for paths and you'll probably find what you're looking for, including an example. http://farseerphysics.codeplex.com/documentation

 

I'm not quite sure what you mean by the first part. A revolute joint is used for one object revolving in connection with another (or fixed angle uses a world coordinate). What you seem to be describing is linear movement. Stuff like ropes and pushing in a direction. Do you mean rotating in a direction? In which case you may want to consider an fixed angle joint instead if you need it for just one body or for multiple you can use multiple joints like a revolute and a fixed angle working in tandum. It would help if you could give a small description of what you're doing. It can be tricky to give general advice, and I'm not the best qualified with farseer.

 

Hey, at least I reply, right? :P

Jul 23, 2011 at 7:23 AM

Haha, I should have made myself more clear. The type of effect I'm going for is like those saloon doors that existed during the wild west, basically these things: http://www.newwest.net/images/thumbnails_feature/GB--Dave_Ayers.jpg

You walk through them but then they go back to where they were before through a spring or something...

Jul 25, 2011 at 4:57 AM

You might keep am eye on my recent post: http://farseerphysics.codeplex.com/discussions/266407

Jul 25, 2011 at 12:23 PM

I see what you're trying to do now!

You might want to try combining a fixed revolute joint placed at the wall end of the door (which will act like the hinge) and a fixed angle joint (that will try and make the doors maintain a set angle). Using the joint softness and bias factor on the fixed angle joint you can get it to act springy (I think, I do something similar but with moving bodies).

I'm not sure if this is possible with just a revolute joint. I would have thought so but I'm not sure how much the motor attributes are used to correct the angle of the body.