    001package net.minecraft.client.renderer.culling;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005
    006@SideOnly(Side.CLIENT)
    007public class ClippingHelper
    008{
    009    public float[][] frustum = new float[16][16];
    010    public float[] projectionMatrix = new float[16];
    011    public float[] modelviewMatrix = new float[16];
    012    public float[] clippingMatrix = new float[16];
    013
    014    /**
    015     * Returns true if the box is inside all 6 clipping planes, otherwise returns false.
    016     */
    017    public boolean isBoxInFrustum(double par1, double par3, double par5, double par7, double par9, double par11)
    018    {
    019        for (int i = 0; i < 6; ++i)
    020        {
    021            if ((double)this.frustum[i][0] * par1 + (double)this.frustum[i][1] * par3 + (double)this.frustum[i][2] * par5 + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * par7 + (double)this.frustum[i][1] * par3 + (double)this.frustum[i][2] * par5 + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * par1 + (double)this.frustum[i][1] * par9 + (double)this.frustum[i][2] * par5 + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * par7 + (double)this.frustum[i][1] * par9 + (double)this.frustum[i][2] * par5 + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * par1 + (double)this.frustum[i][1] * par3 + (double)this.frustum[i][2] * par11 + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * par7 + (double)this.frustum[i][1] * par3 + (double)this.frustum[i][2] * par11 + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * par1 + (double)this.frustum[i][1] * par9 + (double)this.frustum[i][2] * par11 + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * par7 + (double)this.frustum[i][1] * par9 + (double)this.frustum[i][2] * par11 + (double)this.frustum[i][3] <= 0.0D)
    022            {
    023                return false;
    024            }
    025        }
    026
    027        return true;
    028    }
    029}