ViewUtil.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.math.vector.Vector2d;
import java.awt.Graphics2D;
public class ViewUtil {
public static final int INSIDE = 0;
public static final int LEFT = 1;
public static final int RIGHT = 2;
public static final int BOTTOM = 4;
public static final int TOP = 8;
private ViewUtil() {
throw new UnsupportedOperationException();
}
{
;
(x < -) {
code |= ;
} (x > ) {
code |= ;
}
(y < -) {
code |= ;
} (y > ) {
code |= ;
}
code;
}
{
computeOutCode(x0, y0);
computeOutCode(x1, y1);
;
() {
((outcode0 | outcode1) == ) {
accept = ;
;
}
((outcode0 & outcode1) != ) {
;
}
outcode0 != ? outcode0 : outcode1;
x;
y;
((outcodeOut & ) != ) {
x = x0 + (x1 - x0) * ( - y0) / (y1 - y0);
y = ;
} ((outcodeOut & ) != ) {
x = x0 + (x1 - x0) * (- - y0) / (y1 - y0);
y = -;
} ((outcodeOut & ) != ) {
y = y0 + (y1 - y0) * ( - x0) / (x1 - x0);
x = ;
} ((outcodeOut & ) != ) {
y = y0 + (y1 - y0) * (- - x0) / (x1 - x0);
x = -;
} {
x = ;
y = ;
}
(outcodeOut == outcode0) {
x0 = x;
y0 = y;
outcode0 = computeOutCode(x, y);
} {
x1 = x;
y1 = y;
outcode1 = computeOutCode(x, y);
}
}
(accept) {
(x0, y0);
(x1, y1);
}
}
}