Do not render behind the skydome.
This commit is contained in:
parent
ac48ab8cc0
commit
79223b4c02
@ -22,7 +22,7 @@ void Application::init()
|
||||
}
|
||||
|
||||
void Application::initLevel() {
|
||||
this->level = Level(levelXmlPath, farPlane);
|
||||
this->level = Level(levelXmlPath);
|
||||
level.getPhysics()->init(geometryPath);
|
||||
// Don't change this!
|
||||
ignoredMouseUpdates = 0;
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "loader.hh"
|
||||
#include <string>
|
||||
|
||||
Level::Level(std::string xmlFilePath, float farPlane){
|
||||
Level::Level(std::string xmlFilePath) {
|
||||
// default value
|
||||
skydomeSize = 50.0f;
|
||||
physics = Physics();
|
||||
@ -55,10 +55,10 @@ void Level::render(ACGL::OpenGL::SharedShaderProgram shader, bool lightingPass,
|
||||
glm::mat4* viewProjectionMatrix, std::vector<glm::mat4>* shadowVPs) {
|
||||
int renderDistance = 0;
|
||||
if ((int)farPlane % chunkSize == 0) {
|
||||
renderDistance = farPlane/chunkSize;
|
||||
renderDistance = (int)skydomeSize/chunkSize;
|
||||
}
|
||||
else {
|
||||
renderDistance = (farPlane/chunkSize) + 1;
|
||||
renderDistance = ((int)skydomeSize/chunkSize) + 1;
|
||||
}
|
||||
int xPosition = ((int)cameraCenter->getPosition().x + (terrain.getHeightmapWidth()/2))/chunkSize;
|
||||
int zPosition = ((int)cameraCenter->getPosition().z + (terrain.getHeightmapHeight()/2))/chunkSize;
|
||||
|
@ -23,7 +23,7 @@ extern "C" {
|
||||
|
||||
class Level {
|
||||
public:
|
||||
Level(std::string xmlFilePath, float farPlane);
|
||||
Level(std::string xmlFilePath);
|
||||
Level();
|
||||
~Level();
|
||||
void load();
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <ACGL/OpenGL/Objects/VertexArrayObject.hh>
|
||||
using namespace tinyxml2;
|
||||
|
||||
const int chunkSize = 50;
|
||||
const int chunkSize = 30;
|
||||
|
||||
Loader::Loader() {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user