Physics blocking user

Hey Guys,
Sorry in Advance but I can’t provide a proper test case currently, since everything became so complex that I am just hoping you have pointers at what to check first.

The problem is: I migrated from the “regular” approach to an entity system. Since I did that, I discovered that bug, so it might be related to the way I am handling the Controls, probably something related to the order I do things?

What happens is that the floor the characters are working on is a quad technically, which means it is triangulated. Now due to triangulation, you have that diagonal edge going through the floor, which is then also part of the collision shape (for the world, it’s really 1:1, mesh accurate).

When you now cross that diagonal edge or I think any edge of the floor, your character stops (BCC’s walkDirection is (0f, 0f, 0f)) or is thrown into the air if you are fast enough.

The world itself isn’t entity based yet so I only changed the way BetterCharacterControls are created and handled. I really wonder where that Vector3f.ZERO Walk Direction comes from?

I don’t think that my system is setting this because the system actually doesn’t know about the collision shapes or anything, so it seems the BCC is (for some reason) setting that WalkDirection to Zero.

Did anyone experience something comparable or has a clue at what to look at?

It sounds like there is something like a step. If your character capsule is slow it will stop at the step (vector is zero) if it is two fast it will jump in the air because of it’s round edge. My guess why it is happening: Bullet calculates the new position based on the speed and the gravity only for the character. In a next step the character position will be compared to the floor triangle and pushed in the right position because the character is sunken in the floor. This happens always. And usually works fine but maybe in the case where you cross a triangle edge there could be some rounding errors and the new triangle is assumed to be a bit higher than the last. Then you will be either pushed back and stop or in the air to resolve the issue. There you have your step and the reason why you are flying. This is the only explanation I can think of. I will investigate it the next week (it would be a nice test for my own character controller).

I could now solve my problem. Fortunately it showed some flaws in my code.

What was happening is that I unfortunately added some logic-control of the pre-entity area.
This control was responsible for setting the walkDirection to zero when the character isn’t on the ground.
The intention was that characters stop walking when they fly through the air.

Now for some reason that corner indeed makes the capsule loose ground for a few millimetres.
Is there a way to solve that while keeping the mesh collission instead of relying on boxes or something like that? (Which would be better for the roads, but that would require manual collision shape drawing)