ClippingHelper .java

net.minecraft.client.renderer.culling.ClippingHelper (class): members: clippingMatrix, frustum, modelviewMatrix, isBoxInFrustum, projectionMatrix.

net.minecraft.client.renderer.cullingclass33 linesclient1.5 KB

API Surface (1)

boolean isBoxInFrustum(double p_78553_1_, double p_78553_3_, double p_78553_5_, double p_78553_7_, double p_78553_9_, double p_78553_11_)

Fields & Constants (4)

frustum
projectionMatrix
modelviewMatrix
clippingMatrix

Full Source

ClippingHelper.java33 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.renderer.culling;
2
3
public class ClippingHelper
4
{
5
    public float[][] frustum = new float[6][4];
6
    public float[] projectionMatrix = new float[16];
7
    public float[] modelviewMatrix = new float[16];
8
    public float[] clippingMatrix = new float[16];
9
10
    private double dot(float[] p_178624_1_, double p_178624_2_, double p_178624_4_, double p_178624_6_)
11
    {
12
        return (double)p_178624_1_[0] * p_178624_2_ + (double)p_178624_1_[1] * p_178624_4_ + (double)p_178624_1_[2] * p_178624_6_ + (double)p_178624_1_[3];
13
    }
14
15
    /**
16
     * Returns true if the box is inside all 6 clipping planes, otherwise returns false.
17
     */
18
    public boolean isBoxInFrustum(double p_78553_1_, double p_78553_3_, double p_78553_5_, double p_78553_7_, double p_78553_9_, double p_78553_11_)
19
    {
20
        for (int i = 0; i < 6; ++i)
21
        {
22
            float[] afloat = this.frustum[i];
23
24
            if (this.dot(afloat, p_78553_1_, p_78553_3_, p_78553_5_) <= 0.0D && this.dot(afloat, p_78553_7_, p_78553_3_, p_78553_5_) <= 0.0D && this.dot(afloat, p_78553_1_, p_78553_9_, p_78553_5_) <= 0.0D && this.dot(afloat, p_78553_7_, p_78553_9_, p_78553_5_) <= 0.0D && this.dot(afloat, p_78553_1_, p_78553_3_, p_78553_11_) <= 0.0D && this.dot(afloat, p_78553_7_, p_78553_3_, p_78553_11_) <= 0.0D && this.dot(afloat, p_78553_1_, p_78553_9_, p_78553_11_) <= 0.0D && this.dot(afloat, p_78553_7_, p_78553_9_, p_78553_11_) <= 0.0D)
25
            {
26
                return false;
27
            }
28
        }
29
30
        return true;
31
    }
32
}
33

Deobfuscated MCP 1.8.9 source of ClippingHelper from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/renderer/culling/ClippingHelper.java), stored verbatim.