1 package com.irtimaled.bbor.common.models;
3 import com.irtimaled.bbor.client.ClientRenderer;
4 import com.irtimaled.bbor.client.RenderCulling;
5 import com.irtimaled.bbor.client.renderers.AbstractRenderer;
6 import com.irtimaled.bbor.common.BoundingBoxType;
8 public abstract class AbstractBoundingBox {
9 private final BoundingBoxType type;
11 protected AbstractBoundingBox(BoundingBoxType type) {
15 public abstract Boolean intersectsBounds(int minX, int minZ, int maxX, int maxZ);
17 public BoundingBoxType getType() {
21 public double getDistance(double x, double y, double z) {
22 double dX = getDistanceX(x);
23 double dY = getDistanceY(y);
24 double dZ = getDistanceZ(z);
25 return dX * dX + dY * dY + dZ * dZ;
28 protected abstract double getDistanceX(double x);
30 protected abstract double getDistanceY(double y);
32 protected abstract double getDistanceZ(double z);
34 public AbstractRenderer<?> getRenderer() {
35 return ClientRenderer.getRenderer(this.getClass());
38 public boolean isVisibleCulling() {
39 RenderCulling.incrementCulling();