I've added a hinge part in the game. Same procedure: modeled with #FreeCAD, then textured in #Blender, and integrated in the game with the #Godot editor. This works great! At least for prototyping.

#GameDev

The #Jolt physics engine handles it quite reasonably! This is still a subject with a lot of uncertainty for me, to see if it will work with multiple joints in complex machines.

For now, it wasn't intentional, but apparently I've created a trailer pull back simulator. It's as painful to drive as in real life 😅 You can't look 360° so you have to rotate in the other direction each time the trailer goes on the other side, and of course the trailer itself is hard to control...

#GameDev #Godot

Now about a much more problematic case: when I have two hinges, rotated 90° from each other, the #physics engine behaves incorrectly. They get unhinged, have difficulty to catch up, this even drags the whole vehicle to a stop. And I also have cases where things completely explode 😬

Found the reason for this physics explosion! It's caused by "continuous collision detection", when two bodies are kept close to one another by a joint, and both are moving together at high speed. I suppose at some point it detects collisions that should not exist and it conflicts with the joint constraints.

I can't disable collision between bodies on both side of the joint since it's important they can collide (depending on what the player builds).

#GameDev #JoltPhysics

So I guess I'll have to leave CCD off. I enabled it on some parts to avoid parts falling through the ground when they arrive too fast.

This fixes only part of the issues though. The issue with joints getting slightly unhinged in some situations remains (but it's arguably a less serious issue).

Well, I knew from the start that taming physics would be a challenge 😅