Skip to content

Commit 7c9446a

Browse files
authored
Merge pull request #21 from vincentfretin/teleport-on-generated-ground
rotate the geometry instead of mesh to work with teleport component
2 parents 0b1cf25 + db6a77e commit 7c9446a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,14 @@ AFRAME.registerComponent('environment', {
163163
// create ground
164164
this.groundMaterial = null;
165165
this.ground = document.createElement('a-entity');
166-
this.ground.setAttribute('rotation', '-90 0 0');
167166
this.ground.classList.add('environmentGround');
168167
this.groundCanvas = null;
169168
this.groundTexture = null;
170169
this.groundMaterial = null;
171170
this.groundGeometry = null;
172171

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

175175
this.gridCanvas = null;
176176
this.gridTexture = null;
@@ -529,10 +529,11 @@ AFRAME.registerComponent('environment', {
529529

530530
this.groundGeometry.verticesNeedUpdate = true;
531531
this.groundGeometry.normalsNeedUpdate = true;
532+
this.groundGeometry.rotateX(- Math.PI / 2)
532533
}
533534

534535
// apply Y scale. There's no need to recalculate the geometry for this. Just change scale
535-
this.ground.setAttribute('scale', {z: this.data.groundYScale});
536+
this.ground.setAttribute('scale', {y: this.data.groundYScale});
536537

537538
// update ground, playarea and grid textures.
538539
var groundResolution = 2048;

0 commit comments

Comments
 (0)