mirror of
https://git.coom.tech/drummyfish/raycastlib.git
synced 2024-11-21 20:29:59 +01:00
Fix texture coords
This commit is contained in:
parent
aa88bdaa3e
commit
f186330cf2
1 changed files with 8 additions and 4 deletions
12
raycastlib.h
12
raycastlib.h
|
@ -501,22 +501,26 @@ void castRayMultiHit(Ray ray, ArrayFunction arrayFunc, ArrayFunction typeFunc,
|
||||||
if (no.y > 0)
|
if (no.y > 0)
|
||||||
{
|
{
|
||||||
h.direction = 0;
|
h.direction = 0;
|
||||||
h.textureCoord = co.x;
|
h.textureCoord = constraints.computeTextureCoords ?
|
||||||
|
wrap(currentPos.x,UNITS_PER_SQUARE) : 0;
|
||||||
}
|
}
|
||||||
else if (no.x > 0)
|
else if (no.x > 0)
|
||||||
{
|
{
|
||||||
h.direction = 1;
|
h.direction = 1;
|
||||||
h.textureCoord = co.y;
|
h.textureCoord = constraints.computeTextureCoords ?
|
||||||
|
wrap(UNITS_PER_SQUARE - currentPos.y,UNITS_PER_SQUARE) : 0;
|
||||||
}
|
}
|
||||||
else if (no.y < 0)
|
else if (no.y < 0)
|
||||||
{
|
{
|
||||||
h.direction = 2;
|
h.direction = 2;
|
||||||
h.textureCoord = co.x;
|
h.textureCoord = constraints.computeTextureCoords ?
|
||||||
|
wrap(UNITS_PER_SQUARE - currentPos.x,UNITS_PER_SQUARE) : 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
h.direction = 3;
|
h.direction = 3;
|
||||||
h.textureCoord = co.y;
|
h.textureCoord = constraints.computeTextureCoords ?
|
||||||
|
wrap(currentPos.y,UNITS_PER_SQUARE) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
hitResults[*hitResultsLen] = h;
|
hitResults[*hitResultsLen] = h;
|
||||||
|
|
Loading…
Reference in a new issue