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