Skip to content

Commit

Permalink
Merge pull request supermedium#21 from vincentfretin/teleport-on-gene…
Browse files Browse the repository at this point in the history
…rated-ground

rotate the geometry instead of mesh to work with teleport component
  • Loading branch information
feiss committed Oct 4, 2017
2 parents d7ea02f + 5d665fc commit 97d2267
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ 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;
this.groundMaterial = null;
this.groundGeometry = null;

this.dressing = document.createElement('a-entity');
this.dressing.classList.add('environmentDressing')

this.gridCanvas = null;
this.gridTexture = null;
Expand Down Expand Up @@ -529,10 +529,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;
Expand Down

0 comments on commit 97d2267

Please sign in to comment.