Merge pull request #6539 from devLotto/issue-6510

gpu: limit interaction distance from camera
This commit is contained in:
Adam
2018-11-18 09:58:01 -05:00
committed by GitHub

View File

@@ -20,6 +20,7 @@ public abstract class ClickboxMixin implements RSClient
private static final int MAX_ENTITES_AT_MOUSE = 1000;
private static final int CLICKBOX_CLOSE = 50;
private static final int CLICKBOX_FAR = 3500;
private static final int OBJECT_INTERACTION_FAR = 35; // Max distance, in tiles, from camera
@Inject
private static final int[] rl$modelViewportXs = new int[4700];
@@ -45,6 +46,11 @@ public abstract class ClickboxMixin implements RSClient
return;
}
if (Math.sqrt(_x * _x + _z * _z) > OBJECT_INTERACTION_FAR * Perspective.LOCAL_TILE_SIZE)
{
return;
}
// only need a boundingbox check?
if (model.isClickable())
{