Perspective: fix clickbox for type 11 objects
This commit is contained in:
@@ -719,19 +719,13 @@ public class Perspective
|
|||||||
|
|
||||||
private static SimplePolygon calculateAABB(Client client, Model m, int jauOrient, int x, int y, int z)
|
private static SimplePolygon calculateAABB(Client client, Model m, int jauOrient, int x, int y, int z)
|
||||||
{
|
{
|
||||||
int ex = m.getExtremeX();
|
m.calculateExtreme(jauOrient);
|
||||||
if (ex == -1)
|
|
||||||
{
|
|
||||||
// dynamic models don't get stored when they render where this normally happens
|
|
||||||
m.calculateBoundsCylinder();
|
|
||||||
m.calculateExtreme(0);
|
|
||||||
ex = m.getExtremeX();
|
|
||||||
}
|
|
||||||
|
|
||||||
int x1 = m.getCenterX();
|
int x1 = m.getCenterX();
|
||||||
int y1 = m.getCenterZ();
|
int y1 = m.getCenterZ();
|
||||||
int z1 = m.getCenterY();
|
int z1 = m.getCenterY();
|
||||||
|
|
||||||
|
int ex = m.getExtremeX();
|
||||||
int ey = m.getExtremeZ();
|
int ey = m.getExtremeZ();
|
||||||
int ez = m.getExtremeY();
|
int ez = m.getExtremeY();
|
||||||
|
|
||||||
@@ -759,7 +753,7 @@ public class Perspective
|
|||||||
int[] x2d = new int[8];
|
int[] x2d = new int[8];
|
||||||
int[] y2d = 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);
|
return Jarvis.convexHull(x2d, y2d);
|
||||||
}
|
}
|
||||||
@@ -770,7 +764,7 @@ public class Perspective
|
|||||||
int[] y2d = new int[m.getVerticesCount()];
|
int[] y2d = new int[m.getVerticesCount()];
|
||||||
final int[] faceColors3 = m.getFaceColors3();
|
final int[] faceColors3 = m.getFaceColors3();
|
||||||
|
|
||||||
Perspective.modelToCanvas(client,
|
Perspective.modelToCanvasCpu(client,
|
||||||
m.getVerticesCount(),
|
m.getVerticesCount(),
|
||||||
x, y, z,
|
x, y, z,
|
||||||
jauOrient,
|
jauOrient,
|
||||||
|
|||||||
Reference in New Issue
Block a user