Do not render behind the skydome.

This commit is contained in:
Faerbit 2015-03-17 19:10:23 +01:00
parent ac48ab8cc0
commit 79223b4c02
4 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -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;

View File

@ -23,7 +23,7 @@ extern "C" {
class Level {
public:
Level(std::string xmlFilePath, float farPlane);
Level(std::string xmlFilePath);
Level();
~Level();
void load();

View File

@ -2,7 +2,7 @@
#include <ACGL/OpenGL/Objects/VertexArrayObject.hh>
using namespace tinyxml2;
const int chunkSize = 50;
const int chunkSize = 30;
Loader::Loader() {
}