Wheel Suspension by JointComponent

I am trying to organize a simple suspension system. After searching various resources, I came to a decision - to use a non-public joint component - Request for Comments: Physics Joint Component. Also looked at PlayCanvas 3D HTML5 Game Engine, but it seemed to me that too complex logic is used there for my case.

But using joint, I get not quite the expected result, namely Linear Limits and Linear Spring params do not affect anything, and therefore the suspension works as a rough fixation of the wheel in position, instead of the expected effect. Did I miss something?

https://playcanvas.com/project/1228577/overview/wheel-suspension

You have a typo in the script attribute, so your values are not used:

``````liniarMotionX/Y/Z
``````

Must be:

``````linearMotionX/Y/Z
``````
1 Like

Oops, thanks)

Now I will continue to play with the parameters to get the desired behavior.

1 Like

Encountered a new problem – strange behavior with a seeming “stuck” at the extreme point.

My spring should push to the opposite extreme point, which usually happens, but sometimes as you can see from the video – it freezes in the bent position for a while (sometimes it does not spring until the impact is made again). Tried different damping settings and rigibodies mass. Any ideas how to fix this?

There are multitude of ways to simulate a vehicle and usually the process is a pain in the butt, because you have to tweak so many params. From what I’ve seen, your limits are not right. The lower limit should be “spring rest length - half spring length” and the upper one is “spring rest length + half spring length”. So, both X and Y of the limitY should be at least “spring rest length” both.

You could try moving the wheel and joint into the inside the vehicle and push out the wheel by adjusting the limitY.

Now I checked your theory, but the behavior has not changed, except that the wheels are initially not in the right position for me (then they are pulled out, but the occasional stucking during impact remains).

From what I can see, the limits do not behave as you say, but as normal displacement limits (as in the case without spring). And the point relative to which the spring works is set relatively between these limits using linearEquilibriumY (which I have set to elongation).

It seems that there is no velocity stop at the extreme points of the limits, so the wheel continues to “fly” in the direction of its limit, giving the effect of sticking. Now I’m thinking how best to handle it. Is there any effective way?

From what I tested recently - can assume that this is a bug on the ammo.js (Bullet Physics) side.

Judging by the thread below, it is related to calculation precision. But the thread is old, is it still relevant? I will try to find out and would appreciate the help.

https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=4746