| playerDelta = ( playerDelta - dot( playerDelta, wallNormal ) * wallNormal ) * ( 1.0f - minT );
|
Would fix the problem I think (I can't test it because of the changes in day 51).
Another solution would be to set minT = remainingT at the start of each iteration remainingT -= minT at the end of each iteration and multiply the deltaX by minT in the test wall function.
1
2
3
4
5
6
7
8
9
10
11
12
13
14 | bool32 testWall( real32* minT ) {
...
real32 resultT = ( wallX - relativeX ) / ( deltaX * ( *minT ) );
...
}
...
real32 remainingT = 1.0f;
for ( iterations ){
real32 minT = remainingT;
for ( tiles ) {
testWall( &minT )
}
remainingT -= minT;
}
|