Add new APIs to the vector system

This commit is contained in:
Aria 2023-02-14 08:46:52 -07:00
parent 8bfa308ba5
commit f911d4e9d2
7 changed files with 138 additions and 2 deletions

View file

@ -0,0 +1,24 @@
package dev.zontreck.libzontreck.vectors;
public class ChunkPos {
public boolean isSubArea;
public Points subclaim;
public ChunkPos(Vector2 chunkPos)
{
isSubArea=false;
Vector3 min = new Vector3(chunkPos.x, -70, chunkPos.y);
subclaim = new Points(min, min.add(new Vector3(15, 300, 15)));
}
public ChunkPos(Vector3 point1, Vector3 point2)
{
isSubArea=true;
subclaim = new Points(point1, point2);
}
public boolean isWithin(Vector3 point)
{
return point.inside(subclaim.Point1, subclaim.Point2);
}
}