Skip to content

Commit 0ed311e

Browse files
committed
improved comment
1 parent bd097dc commit 0ed311e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main/java/dev/zwazel/internal/game/map/MapDefinition.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@ public record MapDefinition(long width, long depth, SimplifiedRGB floorColor,
1414
public final static float TILE_SIZE = 1f;
1515

1616
/**
17-
* Returns the closest tile to the given world position.
17+
* Returns the Coordinates of the closest tile to the given world position in the map grid.
18+
* The closest tile is the tile whose center is closest to the given world position.
19+
* The y coordinate of the world position must be positive.
20+
* If the y coordinate of the world position is negative, an IllegalArgumentException is thrown.
21+
* The y coordinate of the returned Vec3 is the height of the tile.
22+
* The returned Vec3 is in grid coordinates, not world coordinates.
23+
* The given Vec3 must be in world coordinates, not grid coordinates.
1824
*
1925
* @param worldPos the world position
20-
* @return the closest tile to the world position, as a Vec3. The y in this case is always 0.
26+
* @return the closest tile to the world position, as a Vec3.
2127
*/
2228
public Vec3 getClosestTileFromWorld(@NonNull Vec3 worldPos) {
2329
if (worldPos.getY() < 0) {

0 commit comments

Comments
 (0)