From 8163cd22993d684b52951395c6d007e6cc467a27 Mon Sep 17 00:00:00 2001 From: Daan Vanden Bosch Date: Fri, 12 Jul 2019 23:55:37 +0200 Subject: [PATCH] Fixed bug in texture application and tweaked quest renderer camera settings. --- src/rendering/QuestRenderer.ts | 2 +- src/rendering/models.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rendering/QuestRenderer.ts b/src/rendering/QuestRenderer.ts index c29c3f18..d86dbb80 100644 --- a/src/rendering/QuestRenderer.ts +++ b/src/rendering/QuestRenderer.ts @@ -60,7 +60,7 @@ export class QuestRenderer extends Renderer { private selected_data?: PickEntityResult; constructor() { - super(new PerspectiveCamera(75, 1, 0.1, 5000)); + super(new PerspectiveCamera(60, 1, 10, 10000)); this.dom_element.addEventListener("mousedown", this.on_mouse_down); this.dom_element.addEventListener("mouseup", this.on_mouse_up); diff --git a/src/rendering/models.ts b/src/rendering/models.ts index e7883641..74ed5b7b 100644 --- a/src/rendering/models.ts +++ b/src/rendering/models.ts @@ -273,14 +273,15 @@ class Object3DCreator { } const last_group = this.groups[this.groups.length - 1]; + const mat_idx = mesh.texture_id == null ? 0 : mesh.texture_id + 1; - if (last_group && last_group.mat_idx === mesh.texture_id) { + if (last_group && last_group.mat_idx === mat_idx) { last_group.count += this.indices.length - start_index_count; } else { this.groups.push({ start: start_index_count, count: this.indices.length - start_index_count, - mat_idx: mesh.texture_id == null ? 0 : mesh.texture_id + 1, + mat_idx, }); } }