remove ModelBatch.test(...)
This commit is contained in:
parent
6ba38ee167
commit
1a12a6923a
@ -78,31 +78,6 @@ void ModelBatch::draw(const model::Model& model) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelBatch::test(glm::vec3 pos, glm::vec3 size) {
|
|
||||||
glm::vec3 gpos = combined * glm::vec4(pos, 1.0f);
|
|
||||||
light_t light = chunks->getLight(gpos.x, gpos.y, gpos.z);
|
|
||||||
glm::vec4 lights (
|
|
||||||
Lightmap::extract(light, 0) / 15.0f,
|
|
||||||
Lightmap::extract(light, 1) / 15.0f,
|
|
||||||
Lightmap::extract(light, 2) / 15.0f,
|
|
||||||
Lightmap::extract(light, 3) / 15.0f
|
|
||||||
);
|
|
||||||
|
|
||||||
float time = static_cast<float>(Window::time());
|
|
||||||
pushMatrix(glm::translate(glm::mat4(1.0f), pos));
|
|
||||||
pushMatrix(glm::rotate(glm::mat4(1.0f), glm::sin(time*7*0.1f), glm::vec3(0,1,0)));
|
|
||||||
pushMatrix(glm::rotate(glm::mat4(1.0f), glm::sin(time*11*0.1f), glm::vec3(1,0,0)));
|
|
||||||
pushMatrix(glm::rotate(glm::mat4(1.0f), glm::sin(time*17*0.1f), glm::vec3(0,0,1)));
|
|
||||||
pushMatrix(glm::translate(glm::mat4(1.0f), glm::vec3(0, glm::sin(time*2), 0)));
|
|
||||||
box({}, size, lights);
|
|
||||||
box({1.5f,0,0}, size*0.5f, lights);
|
|
||||||
popMatrix();
|
|
||||||
popMatrix();
|
|
||||||
popMatrix();
|
|
||||||
popMatrix();
|
|
||||||
popMatrix();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ModelBatch::box(glm::vec3 pos, glm::vec3 size, glm::vec4 lights) {
|
void ModelBatch::box(glm::vec3 pos, glm::vec3 size, glm::vec4 lights) {
|
||||||
if (index + 36 < capacity*VERTEX_SIZE) {
|
if (index + 36 < capacity*VERTEX_SIZE) {
|
||||||
flush();
|
flush();
|
||||||
|
|||||||
@ -81,7 +81,6 @@ public:
|
|||||||
|
|
||||||
void draw(const model::Model& model);
|
void draw(const model::Model& model);
|
||||||
|
|
||||||
void test(glm::vec3 pos, glm::vec3 size);
|
|
||||||
void flush();
|
void flush();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -197,13 +197,19 @@ void WorldRenderer::renderLevel(
|
|||||||
model::Model model {};
|
model::Model model {};
|
||||||
auto& mesh = model.addMesh("gui/warning");
|
auto& mesh = model.addMesh("gui/warning");
|
||||||
mesh.addBox({}, glm::vec3(1));
|
mesh.addBox({}, glm::vec3(1));
|
||||||
|
mesh.addBox({}, glm::vec3(2));
|
||||||
|
|
||||||
|
auto& mesh2 = model.addMesh("gui/error");
|
||||||
|
mesh2.addBox({}, glm::vec3(1.25f));
|
||||||
|
mesh2.addBox({}, glm::vec3(3.25f));
|
||||||
|
|
||||||
assets->getTexture("gui/menubg")->bind();
|
assets->getTexture("gui/menubg")->bind();
|
||||||
shader->uniformMatrix("u_model", glm::mat4(1.0f));
|
shader->uniformMatrix("u_model", glm::mat4(1.0f));
|
||||||
//modelBatch->test(glm::vec3(0, 88, 0), glm::vec3(1.0f));
|
|
||||||
modelBatch->pushMatrix(glm::translate(glm::mat4(1.0f), glm::vec3(0, 88, 0)));
|
modelBatch->pushMatrix(glm::translate(glm::mat4(1.0f), glm::vec3(0, 88, 0)));
|
||||||
|
modelBatch->pushMatrix(glm::rotate(glm::mat4(1.0f), static_cast<float>(Window::time()), glm::vec3(1, 0, 0)));
|
||||||
modelBatch->draw(model);
|
modelBatch->draw(model);
|
||||||
modelBatch->popMatrix();
|
modelBatch->popMatrix();
|
||||||
|
modelBatch->popMatrix();
|
||||||
|
|
||||||
skybox->unbind();
|
skybox->unbind();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user