gpu: correctly set model height on non-model renderables

This was incorrect before, but I think is only used for determining if a renderable is occluded, and doesn't change any behaviors I can see
This commit is contained in:
Adam
2020-12-29 18:21:25 -05:00
parent 14ada669f5
commit 5c5e71681a

View File

@@ -1449,6 +1449,12 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
Model model = renderable instanceof Model ? (Model) renderable : renderable.getModel();
if (model != null)
{
// Apply height to renderable from the model
if (model != renderable)
{
renderable.setModelHeight(model.getModelHeight());
}
model.calculateBoundsCylinder();
if (!isVisible(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash))
@@ -1512,7 +1518,10 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
if (model != null)
{
// Apply height to renderable from the model
model.setModelHeight(model.getModelHeight());
if (model != renderable)
{
renderable.setModelHeight(model.getModelHeight());
}
model.calculateBoundsCylinder();