mirror of
https://git.coom.tech/drummyfish/raycastlib.git
synced 2024-12-24 01:36:19 +01:00
Fix offset bug
This commit is contained in:
parent
4ed686ea81
commit
f58e9035da
1 changed files with 3 additions and 4 deletions
|
@ -225,10 +225,9 @@ void castRaySquare(Ray localRay, Vector2D *nextCellOffset,
|
|||
{\
|
||||
nextCellOffset->c1 = n;\
|
||||
collisionPointOffset->c1 = criticalLine.start.c1 - localRay.start.c1;\
|
||||
collisionPointOffset->c2 = clamp(\
|
||||
(collisionPointOffset->c1 * localRay.direction.c2) /\
|
||||
(localRay.direction.c1 == 0 ? 1 : localRay.direction.c1),\
|
||||
0,UNITS_PER_SQUARE - 1);\
|
||||
collisionPointOffset->c2 = \
|
||||
(((int32_t) collisionPointOffset->c1) * localRay.direction.c2) /\
|
||||
((localRay.direction.c1 == 0) ? 1 : localRay.direction.c1);\
|
||||
}
|
||||
|
||||
#define helper2(n1,n2,c)\
|
||||
|
|
Loading…
Reference in a new issue