Skip to content

Commit b21296f

Browse files
committed
bumped to aframe 0.8. Adjusted playArea value ranges. Stick very low ground to y=0
1 parent 9066f24 commit b21296f

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

dist/aframe-environment-component.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
fog: {type:'float', default: 0, min: 0, max: 1},
7474

7575
flatShading: {default: false},
76-
playArea: {type: 'float', default: 1, min: 1, max: 100},
76+
playArea: {type: 'float', default: 1, min: 0.5, max: 10},
7777

7878
ground: {default: 'hills', oneOf:['none', 'flat', 'hills', 'canyon', 'spikes', 'noise']},
7979
groundYScale: {type: 'float', default: 3, min: 0, max: 50},
@@ -561,6 +561,7 @@
561561
xx = Math.max(0, Math.min(1, (Math.abs(xx) - (pa - 0.9)) * (1 / pa) ));
562562
yy = Math.max(0, Math.min(1, (Math.abs(yy) - (pa - 0.9)) * (1 / pa) ));
563563
h *= xx > yy ? xx : yy;
564+
if (h < 0.01) h = 0; // stick to the floor
564565

565566
// set height
566567
verts[i].z = h;

dist/aframe-environment-component.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>A-Frame Environment Component</title>
66
<meta name="description" content="A-Frame Environment Component">
77
<meta name="author" content="Diego F. Goberna">
8-
<script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script>
8+
<script src="https://aframe.io/releases/0.8.0/aframe.min.js"></script>
99
<script src="dist/aframe-environment-component.min.js"></script>
1010
<link href="https://fonts.googleapis.com/css?family=Voces" rel="stylesheet">
1111

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ AFRAME.registerComponent('environment', {
2727
fog: {type:'float', default: 0, min: 0, max: 1},
2828

2929
flatShading: {default: false},
30-
playArea: {type: 'float', default: 1, min: 1, max: 100},
30+
playArea: {type: 'float', default: 1, min: 0.5, max: 10},
3131

3232
ground: {default: 'hills', oneOf:['none', 'flat', 'hills', 'canyon', 'spikes', 'noise']},
3333
groundYScale: {type: 'float', default: 3, min: 0, max: 50},
@@ -515,6 +515,7 @@ AFRAME.registerComponent('environment', {
515515
xx = Math.max(0, Math.min(1, (Math.abs(xx) - (pa - 0.9)) * (1 / pa) ));
516516
yy = Math.max(0, Math.min(1, (Math.abs(yy) - (pa - 0.9)) * (1 / pa) ));
517517
h *= xx > yy ? xx : yy;
518+
if (h < 0.01) h = 0; // stick to the floor
518519

519520
// set height
520521
verts[i].z = h;

tests/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
<title>Tests</title>
66
<meta name="description" content="A-Frame Environment Component">
77
<meta name="author" content="Diego F. Goberna">
8-
<script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script>
8+
<script src="https://aframe.io/releases/0.8.0/aframe.min.js"></script>
99
<script src="../dist/aframe-environment-component.min.js"></script>
10+
<!--<script src="../index.js"></script>-->
1011
<link href="https://fonts.googleapis.com/css?family=Voces" rel="stylesheet">
1112

1213
<style>
@@ -44,7 +45,7 @@
4445
width: 40rem;
4546
}
4647
a-scene {
47-
height: 400px;
48+
height: 800px;
4849
width: calc (100px - 20px);
4950
background: #ccc;
5051
}

0 commit comments

Comments
 (0)