Fixed issue with NJ meshes.

This commit is contained in:
Daan Vanden Bosch 2020-02-01 19:46:57 +01:00
parent 928bdfc12a
commit 8e54ac90fd
4 changed files with 3 additions and 22 deletions

View File

@ -111,9 +111,9 @@ export abstract class GfxRenderer implements Renderer {
case Projection.Perspective:
if (evt.deltaY < 0) {
this.camera.pan(0, 0, -5);
this.camera.pan(0, 0, -2);
} else {
this.camera.pan(0, 0, 5);
this.camera.pan(0, 0, 2);
}
break;
}

View File

@ -149,7 +149,7 @@ class MeshCreator {
this.builder.vertex(vertex.position, normal);
if (index >= 2) {
if (i >= 2) {
if (i % 2 === (mesh.clockwise_winding ? 1 : 0)) {
this.builder.triangle(index - 2, index - 1, index);
} else {

View File

@ -29,7 +29,6 @@ export class WebglRenderer extends GfxRenderer {
this.gfx = new WebglGfx(gl);
gl.enable(gl.DEPTH_TEST);
// gl.enable(gl.CULL_FACE);
gl.clearColor(0.1, 0.1, 0.1, 1);
this.shader_programs = [];

View File

@ -246,24 +246,6 @@ export class ModelStore extends Store {
body,
);
// nj_object.children[0].children[0].children[0].clear_children();
// nj_object.children[0].children[0].children[1].clear_children();
// nj_object.children[0].children[0].children[2].clear_children();
// nj_object.children[0].children[0].children[3].clear_children();
// nj_object.children[0].children[0].children[4].clear_children();
// nj_object.children[0].children[0].children[5].children[0].children[0].clear_children();
// nj_object.children[0].children[0].children[5].children[0].children[1].clear_children();
// nj_object.children[0].children[0].children[5].children[0].children[2].clear_children();
// nj_object.children[0].children[0].children[5].children[0].children[3].children[0].clear_children();
// const model = nj_object.children[0].children[0].children[5].children[0].children[3]
// .children[0].model!;
// model.meshes.splice(0, 1);
// model.meshes.splice(1);
// console.log(
// nj_object.children[0].children[0].children[5].children[0].children[3].children[0]
// .model,
// );
this._current_nj_object.val = nj_object;
} catch (e) {
logger.error(`Couldn't load model for ${character_class.name}.`);