So I've just ended watching episode 48 and I think what it was causing the assertion on line 165/166 on handmade_tile.cpp:
1 2 | Assert(*TileRel > -0.5f*TileMap->TileSideInMeters); Assert(*TileRel < 0.5f*TileMap->TileSideInMeters); |
was that after the collision detection code, when updating the new player position, I think Casey forgot to assign the recanonicalized position to the entity position.
So at line 451 on handmade.cpp:
1 2 | Entity->P = NewPlayerP; NewPlayerP = RecanonicalizePosition(TileMap, NewPlayerP); |
should be:
1 | Entity->P = RecanonicalizePosition(TileMap, NewPlayerP); |
I know floating point math is problematic but in this case that could be causing the assertion and that 0.0001f epsilon is not needed?
Cheers!