Companion

Properties

Link copied to clipboard
const val BLOCK_OVERLAP_INCREASE: Float = 5.0E-4f

A base scale to prevent z-fighting between the block and item display when the player is right next to a block.

Link copied to clipboard

The problem with making the item display too large is that the block break overlay will be obscured by the item display. This issue is mainly only prevalent when close to the block, so the farther away they are from the block the more we can increase the scale to prevent z-fighting without worrying about the block break overlay being obscured.

Link copied to clipboard
const val MAX_SCALE_INCREASE: Float = 0.1f

The maximum scale increase to prevent the item display from becoming too large at long distances.

Link copied to clipboard

Calculate scale increase so that at EXPECTED_REACH_DISTANCE, the scale increase is double BLOCK_OVERLAP_SCALE

Link copied to clipboard

If the difference between the new scale increase and the last scale increase sent to the viewer is less than 1/10th of the base BLOCK_OVERLAP_SCALE, we don't send a packet to avoid unnecessary packet spam.