ViewFrustum.java 文件源码

java
阅读 14 收藏 0 点赞 0 评论 0

项目:BaseClient 作者:
protected RenderChunk getRenderChunk(BlockPos pos)
{
    int i = MathHelper.bucketInt(pos.getX(), 16);
    int j = MathHelper.bucketInt(pos.getY(), 16);
    int k = MathHelper.bucketInt(pos.getZ(), 16);

    if (j >= 0 && j < this.countChunksY)
    {
        i = i % this.countChunksX;

        if (i < 0)
        {
            i += this.countChunksX;
        }

        k = k % this.countChunksZ;

        if (k < 0)
        {
            k += this.countChunksZ;
        }

        int l = (k * this.countChunksY + j) * this.countChunksX + i;
        return this.renderChunks[l];
    }
    else
    {
        return null;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号