Perspective: fix clickbox for type 11 objects

This commit is contained in:
Max Weber
2022-05-07 19:56:59 -06:00
committed by Adam
parent 0500f94830
commit 28f45cedb5

View File

@@ -719,19 +719,13 @@ public class Perspective
private static SimplePolygon calculateAABB(Client client, Model m, int jauOrient, int x, int y, int z)
{
int ex = m.getExtremeX();
if (ex == -1)
{
// dynamic models don't get stored when they render where this normally happens
m.calculateBoundsCylinder();
m.calculateExtreme(0);
ex = m.getExtremeX();
}
m.calculateExtreme(jauOrient);
int x1 = m.getCenterX();
int y1 = m.getCenterZ();
int z1 = m.getCenterY();
int ex = m.getExtremeX();
int ey = m.getExtremeZ();
int ez = m.getExtremeY();
@@ -759,7 +753,7 @@ public class Perspective
int[] x2d = new int[8];
int[] y2d = new int[8];
modelToCanvas(client, 8, x, y, z, jauOrient, xa, ya, za, x2d, y2d);
modelToCanvasCpu(client, 8, x, y, z, 0, xa, ya, za, x2d, y2d);
return Jarvis.convexHull(x2d, y2d);
}
@@ -770,7 +764,7 @@ public class Perspective
int[] y2d = new int[m.getVerticesCount()];
final int[] faceColors3 = m.getFaceColors3();
Perspective.modelToCanvas(client,
Perspective.modelToCanvasCpu(client,
m.getVerticesCount(),
x, y, z,
jauOrient,