Cache Joints

Topics: Developer Forum, User Forum
Jun 29, 2010 at 8:02 AM

Hi all. In my project (FP3.0) I constantly attach and detach stuff in the gameworld. As expected I use different joint types (mainly revolute and distance), these joints are created at the game initialization, so I can add and remove them from the World when needed. So each time I need to attach something, I get a joint, set its bodies and local anchors, and then use World.Add(Joint).

The problem is when I try to use a Weld Joint. Weldjoints in FP3.0 don't allow to modify the bodies and local anchors in gametime. You can only set them in the constructor, so every time I need to fix something with a weld joint, I need to create a new one instead of using a cached one, which I guess is not very performant. Is there a workaround for this? Does anyone have an idea on how could I solve this?


Jun 30, 2010 at 5:51 AM
You could just modify the WeldJoint class to have what the other Joint classes do. After you're done, you could submit it as a patch. I went ahead and started writing the JointFactory class which was empty last time I grabbed a copy of svn.
Jun 30, 2010 at 6:57 AM

That's also an option, but I wanted to know also if there was a reason on why currently the Weld Joint can't be modified.

BTW, is it only me or there are not any formatting buttons here in the post form?