Hello Norbo, I came across a little teaser with weldjoint in my tanky project.
I got box entity, atop tank hull, which is a compound body, joined together by a weld joint.
Red arrow points to that box. When simulation begins box start to wabble with increasing rate, throwing around whole tank as a result.
Box mass is 1, compound body mass is 20.
I also added collision rule no broad phase for the box and tank hull.
At the same time I have another entity - cylinder, atop convexhull (tank turret) - Purple arrow. These are joined by weld too and it works as expected - cylinder firmly sits on the turret, no oddities observed.
Both welds created with a default constructor, which takes two entities as parameters.
What I'm possibly doing wrong here?
Thanks,
S.
SOLVED WeldJoint problem
-
- Posts: 49
- Joined: Mon Oct 08, 2012 4:57 pm
SOLVED WeldJoint problem
Last edited by sergiusz308 on Thu Feb 13, 2014 10:43 pm, edited 1 time in total.
Re: WeldJoint problem
By default, the WeldJoint creates an anchor for the ball socket joint at the midpoint between the two connected objects' positions. In this case, that midpoint will be quite distant from the tiny box relative to the box's inertia tensor. In effect, the box is on the end of a very long pole.
Moving the anchor closer to the box or just to the box's position should stabilize it. (Really, the WeldJoint should take an anchor in the constructor. The automatic guess causes this sort of issue more often than not.)
However...
Moving the anchor closer to the box or just to the box's position should stabilize it. (Really, the WeldJoint should take an anchor in the constructor. The automatic guess causes this sort of issue more often than not.)
However...
Oscillating enough to make the whole tank move significantly is pretty odd. Usually, getting that large of an oscillation would require some combination of long time step duration, low iteration count, or over-rigid constraints with a hard simulation.When simulation begins box start to wabble with increasing rate, throwing around whole tank as a result.
Box mass is 1, compound body mass is 20.
-
- Posts: 49
- Joined: Mon Oct 08, 2012 4:57 pm
Re: WeldJoint problem
Thanks, case solved.