Jump to content
  • Advertisement
Sign in to follow this  
luca-deltodesco

Pivot Joint, Singular mass matrix.

This topic is 3073 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have come across a problem in my physics engine which stems from using a Pivot style joint on an object which has infinite mass, but non infinite inertia (a trick that can be used everywhere else in the engine with no problem to model an object that is pinned perfectly to a static point in the world about it's origin rather than using a constraint) with a static reference object which is used for mouse control in this instance.

The problem is that the effective mass matrix which is required in the mathematics for the joint is singular in this case.

The mass matrix is calculated as:


with m,I being mass,moment and x,y being the anchor point for the object in the joint.

which, when m1,I1,m2 are all zero, is singular and means that the pivot joint in this case either does nothing (as my mathematics deals with inverting a singular matrix by converting it to the zero matrix) or explodes when numerical inaccuracies means it is instead very near singular.

Any suggestions on how best to deal with this so that i can have the pivot style joints that rely on this mass matrix function in the given case as expected without having to simply have it as a special case where you aren't allowed to use the joint type?

Share this post


Link to post
Share on other sites
Advertisement
If I understand correctly you want an object pinned with infinite mass to be able to rotate around a joint. You'd have to use a different mass for this calculation than the actual infinite mass. If you're already adjusting it so it has non-infinite moment of inertia, I would suggest using the mass you used to calculate the moment of inertia. For a while I used a moment of inertia multiplier in my physics engine so I would have more control over how fast things rotated, but I don't think that would work if your mass is literally infinity. I don't see any way to get around a special case when dealing with anything infinite.

Share this post


Link to post
Share on other sites
Thankyou, that does seem to do the job as far as I can tell. I was already doing the same thing throughout most of the engine, but the cached value for imass must also be set to 0 when an object is stopped from moving, so i've had to add a second value for imass which is never modified to use for the effected constraints :P

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!