    001package net.minecraft.client.renderer.culling;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import net.minecraft.util.AxisAlignedBB;
    006
    007@SideOnly(Side.CLIENT)
    008public class Frustrum implements ICamera
    009{
    010    private ClippingHelper clippingHelper = ClippingHelperImpl.getInstance();
    011    private double xPosition;
    012    private double yPosition;
    013    private double zPosition;
    014
    015    public void setPosition(double par1, double par3, double par5)
    016    {
    017        this.xPosition = par1;
    018        this.yPosition = par3;
    019        this.zPosition = par5;
    020    }
    021
    022    /**
    023     * Calls the clipping helper. Returns true if the box is inside all 6 clipping planes, otherwise returns false.
    024     */
    025    public boolean isBoxInFrustum(double par1, double par3, double par5, double par7, double par9, double par11)
    026    {
    027        return this.clippingHelper.isBoxInFrustum(par1 - this.xPosition, par3 - this.yPosition, par5 - this.zPosition, par7 - this.xPosition, par9 - this.yPosition, par11 - this.zPosition);
    028    }
    029
    030    /**
    031     * Returns true if the bounding box is inside all 6 clipping planes, otherwise returns false.
    032     */
    033    public boolean isBoundingBoxInFrustum(AxisAlignedBB par1AxisAlignedBB)
    034    {
    035        return this.isBoxInFrustum(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ, par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ);
    036    }
    037}