From 22c8d131425f777532c92cd6e33535fe4a086288 Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Sun, 1 Oct 2017 20:25:43 +0200 Subject: [PATCH 1/2] rotate the geometry instead of mesh so we have a valid intersect face normal for the teleport component --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 30a639ff..3665bf97 100644 --- a/index.js +++ b/index.js @@ -163,7 +163,6 @@ AFRAME.registerComponent('environment', { // create ground this.groundMaterial = null; this.ground = document.createElement('a-entity'); - this.ground.setAttribute('rotation', '-90 0 0'); this.ground.classList.add('environmentGround'); this.groundCanvas = null; this.groundTexture = null; @@ -529,10 +528,11 @@ AFRAME.registerComponent('environment', { this.groundGeometry.verticesNeedUpdate = true; this.groundGeometry.normalsNeedUpdate = true; + this.groundGeometry.rotateX(- Math.PI / 2) } // apply Y scale. There's no need to recalculate the geometry for this. Just change scale - this.ground.setAttribute('scale', {z: this.data.groundYScale}); + this.ground.setAttribute('scale', {y: this.data.groundYScale}); // update ground, playarea and grid textures. var groundResolution = 2048; From db6a77e706d99e2ebe9c51fe3317fb79fc456a59 Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Sun, 1 Oct 2017 20:59:46 +0200 Subject: [PATCH 2/2] add environmentDressing class to dressing mesh --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 3665bf97..190732f0 100644 --- a/index.js +++ b/index.js @@ -170,6 +170,7 @@ AFRAME.registerComponent('environment', { this.groundGeometry = null; this.dressing = document.createElement('a-entity'); + this.dressing.classList.add('environmentDressing') this.gridCanvas = null; this.gridTexture = null;