diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/FrustumData.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.Client/FrustumData.h')
| -rw-r--r-- | Minecraft.Client/FrustumData.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Minecraft.Client/FrustumData.h b/Minecraft.Client/FrustumData.h new file mode 100644 index 00000000..7285f145 --- /dev/null +++ b/Minecraft.Client/FrustumData.h @@ -0,0 +1,35 @@ +#pragma once +#include "..\Minecraft.World\AABB.h" + +class FrustumData +{ +public: + //enum FrustumSide + static const int RIGHT = 0; // The RIGHT side of the frustum + static const int LEFT = 1; // The LEFT side of the frustum + static const int BOTTOM = 2; // The BOTTOM side of the frustum + static const int TOP = 3; // The TOP side of the frustum + static const int BACK = 4; // The BACK side of the frustum + static const int FRONT = 5; // The FRONT side of the frustum + + // Like above, instead of saying a number for the ABC and D of the plane, we + // want to be more descriptive. + static const int A = 0; // The X value of the plane's normal + static const int B = 1; // The Y value of the plane's normal + static const int C = 2; // The Z value of the plane's normal + static const int D = 3; // The distance the plane is from the origin + + float** m_Frustum; + floatArray proj; + floatArray modl; + floatArray clip; + + FrustumData(); + ~FrustumData(); + + bool pointInFrustum(float x, float y, float z); + bool sphereInFrustum(float x, float y, float z, float radius); + bool cubeFullyInFrustum(double x1, double y1, double z1, double x2, double y2, double z2); + bool cubeInFrustum(double x1, double y1, double z1, double x2, double y2, double z2); + bool isVisible(AABB *aabb); +};
\ No newline at end of file |
