Skip to content

Commit

Permalink
Restitution slider.
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeto committed Jun 29, 2014
1 parent 958e91f commit 27cb5a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.html
Expand Up @@ -35,6 +35,11 @@ <h1>WebGL Particle Physics</h1>
<input class="wind" type="range" step="0.1"
min="-4" max="4" value="0"/>
</div>
<div class="slider">
<label>Restitution:</label>
<input class="restitution" type="range" step="0.05"
min="0" max="1.5" value="0.25"/>
</div>
</div>
<div class="obstacles">
<label>Obstacles:</label>
Expand Down
3 changes: 3 additions & 0 deletions js/controller.js
Expand Up @@ -67,6 +67,9 @@ function Controller(particles) {
$('.controls .particles .wind').on('input', function() {
_this.particles.wind[0] = Number($(this).val());
});
$('.controls .particles .restitution').on('input', function() {
_this.particles.restitution = Number($(this).val());
});
$('.controls .obstacles .color').on('change', function(event) {
var value = $(event.target).val();
_this.particles.obstacleColor = Controller.parseColor(value);
Expand Down

0 comments on commit 27cb5a1

Please sign in to comment.