Search in sources :

Example 6 with Point

use of com.irtimaled.bbor.client.models.Point in project BoundingBoxOutlineReloaded by irtimaled.

the class CustomLineProvider method remove.

public static boolean remove(Point min, Point max) {
    DimensionId dimensionId = Player.getDimensionId();
    int cacheKey = getHashKey(min, max);
    return getCache(dimensionId).remove(cacheKey) != null;
}
Also used : DimensionId(com.irtimaled.bbor.common.models.DimensionId) Point(com.irtimaled.bbor.client.models.Point)

Example 7 with Point

use of com.irtimaled.bbor.client.models.Point in project BoundingBoxOutlineReloaded by irtimaled.

the class CustomLineProvider method add.

public static void add(Point minPoint, Point maxPoint, Double width) {
    DimensionId dimensionId = Player.getDimensionId();
    int cacheKey = getHashKey(minPoint, maxPoint);
    BoundingBoxLine line = BoundingBoxLine.from(minPoint, maxPoint, width, BoundingBoxType.Custom);
    getCache(dimensionId).put(cacheKey, line);
}
Also used : BoundingBoxLine(com.irtimaled.bbor.client.models.BoundingBoxLine) DimensionId(com.irtimaled.bbor.common.models.DimensionId) Point(com.irtimaled.bbor.client.models.Point)

Example 8 with Point

use of com.irtimaled.bbor.client.models.Point in project BoundingBoxOutlineReloaded by irtimaled.

the class AbstractRenderer method renderLineSphere.

private void renderLineSphere(Point center, double radius, Color color) {
    RenderHelper.lineWidth2();
    double offset = ((radius - (int) radius) == 0) ? center.getY() - (int) center.getY() : 0;
    int dyStep = radius < 64 ? 1 : MathHelper.floor(radius / 32);
    for (double dy = offset - radius; dy <= radius + 1; dy += dyStep) {
        double circleRadius = Math.sqrt((radius * radius) - (dy * dy));
        if (circleRadius == 0)
            circleRadius = Math.sqrt(2) / 2;
        renderCircle(center, circleRadius, color, dy + 0.001F);
    }
}
Also used : Point(com.irtimaled.bbor.client.models.Point)

Example 9 with Point

use of com.irtimaled.bbor.client.models.Point in project BoundingBoxOutlineReloaded by irtimaled.

the class CustomSphereProvider method add.

public static void add(Point center, double radius) {
    DimensionId dimensionId = Player.getDimensionId();
    int cacheKey = center.hashCode();
    BoundingBoxSphere sphere = new BoundingBoxSphere(center, radius, BoundingBoxType.Custom);
    getCache(dimensionId).put(cacheKey, sphere);
}
Also used : DimensionId(com.irtimaled.bbor.common.models.DimensionId) Point(com.irtimaled.bbor.client.models.Point) BoundingBoxSphere(com.irtimaled.bbor.client.models.BoundingBoxSphere)

Example 10 with Point

use of com.irtimaled.bbor.client.models.Point in project BoundingBoxOutlineReloaded by irtimaled.

the class CustomSphereProvider method remove.

public static boolean remove(Point center) {
    DimensionId dimensionId = Player.getDimensionId();
    int cacheKey = center.hashCode();
    return getCache(dimensionId).remove(cacheKey) != null;
}
Also used : DimensionId(com.irtimaled.bbor.common.models.DimensionId) Point(com.irtimaled.bbor.client.models.Point)

Aggregations

Point (com.irtimaled.bbor.client.models.Point)12 DimensionId (com.irtimaled.bbor.common.models.DimensionId)4 BoundingBoxLine (com.irtimaled.bbor.client.models.BoundingBoxLine)1 BoundingBoxSphere (com.irtimaled.bbor.client.models.BoundingBoxSphere)1 BlockState (net.minecraft.block.BlockState)1 BlockPos (net.minecraft.util.math.BlockPos)1 World (net.minecraft.world.World)1