mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
feat: models loading
This commit is contained in:
parent
d54b6b2e58
commit
ea0add3017
8 changed files with 43 additions and 13 deletions
|
|
@ -50,7 +50,7 @@ ModelBatch::ModelBatch(size_t capacity, Assets* assets, Chunks* chunks)
|
|||
ModelBatch::~ModelBatch() {
|
||||
}
|
||||
|
||||
void ModelBatch::draw(const model::Model& model) {
|
||||
void ModelBatch::draw(const model::Model* model) {
|
||||
glm::vec3 gpos = combined * glm::vec4(glm::vec3(), 1.0f);
|
||||
light_t light = chunks->getLight(gpos.x, gpos.y, gpos.z);
|
||||
glm::vec4 lights (
|
||||
|
|
@ -59,7 +59,7 @@ void ModelBatch::draw(const model::Model& model) {
|
|||
Lightmap::extract(light, 2) / 15.0f,
|
||||
Lightmap::extract(light, 3) / 15.0f
|
||||
);
|
||||
for (const auto& mesh : model.meshes) {
|
||||
for (const auto& mesh : model->meshes) {
|
||||
auto texture = assets->get<Texture>(mesh.texture);
|
||||
if (texture) {
|
||||
texture->bind();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue