Today I started by adding a few simple but useful functionalities to the engine:
- a command to enable/disable fps logging
- a log function to easily print a glm::vec3
Then I tried once again to figure out why the jitter is happening, and I'm starting to think that there is not a real way to fix it, so I improvised: I added a threshold speed, under which a contact is rendered null. This solves the problem, but it is difficult to determine. For instance, with a gravity of 50g, the treshold should be around 20 m/s, which is clearly not ideal, especially if a real contact is happening.
But still, a better solution than yesterday, I'll continue to research new ways.
After that I implemented the Rod class, which generates collisions when two particles strive away from their predefined distance. This is achieved by setting to zero the separating velocity, and just resolving the interpenetration.
In the gif you can see a chain of cables on the left and a chain of rods on the right. It is quite difficult to see from the gif, but the cables stretch a bit, and allow particles to get closer, while the rods mostly maintain their distance. I say mostly because with this chained disposition the resolver algorithm is often in difficulty, and the resolution behaves in unexpected ways.

Nessun commento:
Posta un commento