Update on progress
When constraint based model for simulating suspension of the tank failed (miserably in some areas and wasn't flexible enough in others), I started looking for other algorithm. Sweep based model with shaped colliders was rather obvious and works quite well.
This model is very similar to doing a raytrace for each wheel for calculating suspension. The core difference is that instead of using a ray or sphere trace for all wheels, front and back wheels use shaped collider which approximates contact of the track with the ground:

Some of you seen this previously - the same shaped collider was used in constraint based model. While this model is better for functional behavior of the tank, it lacks proper articulation of the track. Tracks have to be "glued" to wheels and can penetrate some of the obstacles. In typical game scenario this isn't a big problem and such artifact can be hidden by landscape and other geometry.
I've decided to give a try to a more complex model, where track would approximate behavior of the real one. There are quite a few implementations, including simulating track as a connected chain of rigid bodies - real deal. I might give a try at some point but not now.
Just to make it clear, the algorithm that I want to describe is not final and not planned to be used for more than a few tanks at the same time. We are not looking only at visual behavior of the track either, we want it to have an effect on tank's mobility too. Tanks are capable of driving over large obstacle not only because of powerful engine but the fact that road wheels never have to "attack" obstacle in a sharp angle. For comparison with the wheeled vehicle:

With enough traction, wheeled vehicle can in fact drive over an obstacle higher than radius of the wheel, but it's problematic to achieve with substantial horizontal acceleration. In case of tracked vehicle, track itself provides a slope for the wheel and this way even smaller roadwheel can overcome much taller obstacle.
So what we need to do, is imitate how track would be placed on the ground and obstacles and then roll wheels over the track. To do this we need to find position for some key points of the track, for hypothetical tracked vehicle we could do something like this:

Blue points are fixed, green points are "main" points and aligned with road-wheels, orange points are "middle" points and placed between main points or fixed points.
When constraint based model for simulating suspension of the tank failed (miserably in some areas and wasn't flexible enough in others), I started looking for other algorithm. Sweep based model with shaped colliders was rather obvious and works quite well.
This model is very similar to doing a raytrace for each wheel for calculating suspension. The core difference is that instead of using a ray or sphere trace for all wheels, front and back wheels use shaped collider which approximates contact of the track with the ground:
Some of you seen this previously - the same shaped collider was used in constraint based model. While this model is better for functional behavior of the tank, it lacks proper articulation of the track. Tracks have to be "glued" to wheels and can penetrate some of the obstacles. In typical game scenario this isn't a big problem and such artifact can be hidden by landscape and other geometry.
I've decided to give a try to a more complex model, where track would approximate behavior of the real one. There are quite a few implementations, including simulating track as a connected chain of rigid bodies - real deal. I might give a try at some point but not now.
Just to make it clear, the algorithm that I want to describe is not final and not planned to be used for more than a few tanks at the same time. We are not looking only at visual behavior of the track either, we want it to have an effect on tank's mobility too. Tanks are capable of driving over large obstacle not only because of powerful engine but the fact that road wheels never have to "attack" obstacle in a sharp angle. For comparison with the wheeled vehicle:
With enough traction, wheeled vehicle can in fact drive over an obstacle higher than radius of the wheel, but it's problematic to achieve with substantial horizontal acceleration. In case of tracked vehicle, track itself provides a slope for the wheel and this way even smaller roadwheel can overcome much taller obstacle.
So what we need to do, is imitate how track would be placed on the ground and obstacles and then roll wheels over the track. To do this we need to find position for some key points of the track, for hypothetical tracked vehicle we could do something like this:
Blue points are fixed, green points are "main" points and aligned with road-wheels, orange points are "middle" points and placed between main points or fixed points.
Comment