Help with a revolute joint chain config
Posted: Mon Jun 11, 2012 9:45 pm
Hi,
I'm trying to setup the joints for the "hydraulic suspension" on a vehicle in our game. In the image below, i'm showing basically what I'm trying out as a first pass. There is a high-res render model inside the cubes that I'm showing in the image. The boxes are the actual BEPU collision entities. The cyan circles are where I am placing the joints (identical config for each of the three legs).
So there's basically two hinge joints per leg, for which i'm using the RevoluteJoint in BEPU. All of the entities are collision grouped such that they do not register inter-collisions, so I'm good on that front. While I almost get the look I want, unfortunately there is a bit of constant jiggle in the joints and fiddling with the joint settings I couldn't really eliminate it. As hydraulic pistons usually work, the idea is that there'd be high damping on these joints and also be relatively stiff at the same time.
It looks like the main problem I'm getting with the jiggle is that the lower leg (and possibly to a degree the upper leg) has a tendency to move side-to-side even though the hinge joint is supposed to have that axis removed from the rotation degree of freedom. When the vehicle settles on the ground, since the whole body is resting on these legs, the slight jiggly rotation is pretty apparent. I realize that joints try to maintain their requested transforms by applying impulses, so removing all of the unwanted rotation might be tough, but I was expecting that I could get it to look better. After all, what I'm trying to achieve should be a fairly standard thing for physics engines.
On a side note, I guess I should also add that, I can't reliably get the object to completely settle on the ground. There always seems to be a constant bounce in the springs, almost like the time step isn't small enough type of a deal. If I set the dampen coefficient too high in the servo motor to be high, then the joint rotates away from the goal and cannot get back and if i set it lower, then it starts bouncing...
So, I'm wondering if there is a relatively easy way for me to completely lock down or severely dampen the side-to-side movement of the legs as well as the overall bounciness. I wouldn't be surprised if I'm perhaps missing an obvious setting in the joint.... or perhaps I might need to add another limit solver on top of the revolute joint to further constrict the movement.
As I write this, I'm also going thru the BEPU demos to see if there's anything in there that might be of help to me.
Any help would be very much appreciated.
Thanks
I'm trying to setup the joints for the "hydraulic suspension" on a vehicle in our game. In the image below, i'm showing basically what I'm trying out as a first pass. There is a high-res render model inside the cubes that I'm showing in the image. The boxes are the actual BEPU collision entities. The cyan circles are where I am placing the joints (identical config for each of the three legs).
So there's basically two hinge joints per leg, for which i'm using the RevoluteJoint in BEPU. All of the entities are collision grouped such that they do not register inter-collisions, so I'm good on that front. While I almost get the look I want, unfortunately there is a bit of constant jiggle in the joints and fiddling with the joint settings I couldn't really eliminate it. As hydraulic pistons usually work, the idea is that there'd be high damping on these joints and also be relatively stiff at the same time.
It looks like the main problem I'm getting with the jiggle is that the lower leg (and possibly to a degree the upper leg) has a tendency to move side-to-side even though the hinge joint is supposed to have that axis removed from the rotation degree of freedom. When the vehicle settles on the ground, since the whole body is resting on these legs, the slight jiggly rotation is pretty apparent. I realize that joints try to maintain their requested transforms by applying impulses, so removing all of the unwanted rotation might be tough, but I was expecting that I could get it to look better. After all, what I'm trying to achieve should be a fairly standard thing for physics engines.
On a side note, I guess I should also add that, I can't reliably get the object to completely settle on the ground. There always seems to be a constant bounce in the springs, almost like the time step isn't small enough type of a deal. If I set the dampen coefficient too high in the servo motor to be high, then the joint rotates away from the goal and cannot get back and if i set it lower, then it starts bouncing...
So, I'm wondering if there is a relatively easy way for me to completely lock down or severely dampen the side-to-side movement of the legs as well as the overall bounciness. I wouldn't be surprised if I'm perhaps missing an obvious setting in the joint.... or perhaps I might need to add another limit solver on top of the revolute joint to further constrict the movement.
As I write this, I'm also going thru the BEPU demos to see if there's anything in there that might be of help to me.
Any help would be very much appreciated.
Thanks