tightening up the physics

Topics: Developer Forum, Project Management Forum, User Forum
Jun 10, 2010 at 6:40 PM
I want to tighten up the elasticity of FP so that when I drag bodies around in the physics simulator they will follow the mouse more closely, or preferably without any elasticity whatsoever. I read somewhere in a previous discussion that I can control this to some degree with BiasFactor but I've tried changing that around and it doesn't have the effect I want. Can anyone help me?
Developer
Jun 11, 2010 at 3:51 PM

Setting the LinearVelocity is the best method. I created a sample a while back using this method. Here is the code http://www.mediafire.com/?yu2ztjlty2u Let me know if this helps you.

Jun 11, 2010 at 5:14 PM
Wow, thanks for the quick reply Matt. I've downloaded your example, and if I run into any roadblocks I'll be back with more questions.
Jun 12, 2010 at 8:04 AM

Rather than tweak the springiness of that spring (the mouse click creates a fixed linear spring), you could modify it to try creating some type of joint instead (like a revolute joint).  I think this would probably be easier in the end and provide what you are looking for.

Developer
Jun 12, 2010 at 1:35 PM

Directly modifying the linear velocity to match the mouse is quite easy. Finding the angular velocity would be somewhat harder, but not impossible. Just remember if you want correct collision response then only modify the velocity's ever the position.

 

Jun 14, 2010 at 6:33 PM
Jerky wrote:

Rather than tweak the springiness of that spring (the mouse click creates a fixed linear spring), you could modify it to try creating some type of joint instead (like a revolute joint).  I think this would probably be easier in the end and provide what you are looking for.

I understand what you are saying but a revolute joint requires two bodies and I just have the one body that I'm trying to manipulate. Is there a way to create a body at each mouse click?
Jun 15, 2010 at 5:23 PM
Just bumping to see if anyone has any ideas about connecting a revolute joint to mouse position on click...
Jun 16, 2010 at 6:12 AM

You could tie the creation of a body to the click of the mouse if you want, then have it track the mouse movement, and then dispose of it as soon as you've unclicked.  mattbettcher's idea may end up making more sense in the end though, just because its not messy.  I haven't played around enough with the new FP (it's been a year since I last used it), so there could be other ideas out there.