mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-21 07:23:31 +00:00
the whole game
This commit is contained in:
39
src/client/renderer/culling/FrustumCuller.h
Executable file
39
src/client/renderer/culling/FrustumCuller.h
Executable file
@@ -0,0 +1,39 @@
|
||||
#ifndef NET_MINECRAFT_CLIENT_RENDERER_CULLING__FrustumCuller_H__
|
||||
#define NET_MINECRAFT_CLIENT_RENDERER_CULLING__FrustumCuller_H__
|
||||
|
||||
//package net.minecraft.client.renderer.culling;
|
||||
|
||||
#include "FrustumData.h"
|
||||
#include "Frustum.h"
|
||||
|
||||
class FrustumCuller: public Culler {
|
||||
|
||||
private:
|
||||
FrustumData frustum;
|
||||
float xOff, yOff, zOff;
|
||||
|
||||
public:
|
||||
FrustumCuller() {
|
||||
frustum = Frustum::getFrustum();
|
||||
}
|
||||
|
||||
void prepare(float xOff, float yOff, float zOff) {
|
||||
this->xOff = xOff;
|
||||
this->yOff = yOff;
|
||||
this->zOff = zOff;
|
||||
}
|
||||
|
||||
bool cubeFullyInFrustum(float x0, float y0, float z0, float x1, float y1, float z1) {
|
||||
return frustum.cubeFullyInFrustum(x0 - xOff, y0 - yOff, z0 - zOff, x1 - xOff, y1 - yOff, z1 - zOff);
|
||||
}
|
||||
|
||||
bool cubeInFrustum(float x0, float y0, float z0, float x1, float y1, float z1) {
|
||||
return frustum.cubeInFrustum(x0 - xOff, y0 - yOff, z0 - zOff, x1 - xOff, y1 - yOff, z1 - zOff);
|
||||
}
|
||||
|
||||
bool isVisible(const AABB& bb) {
|
||||
return cubeInFrustum(bb.x0, bb.y0, bb.z0, bb.x1, bb.y1, bb.z1);
|
||||
}
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_CLIENT_RENDERER_CULLING__FrustumCuller_H__*/
|
||||
Reference in New Issue
Block a user