Commit a5c0e727 authored by Jens-Christian Fischer's avatar Jens-Christian Fischer
Browse files

Tune acceleration threshold

parent 1250b919
......@@ -3,7 +3,7 @@ defmodule Grains.Mixfile do
def project do
[app: :grains,
version: "0.0.50",
version: "0.0.51",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
......
......@@ -7,7 +7,7 @@ let AccelerationPanel = {
sliders: {},
slider_titles: ["z"],
old_values: [0,0,0],
old_values: [0],
init(socket, domId) {
......@@ -36,7 +36,7 @@ let AccelerationPanel = {
console.log("adding acceleration");
this.orientation = new Interface.Accelerometer({
onvaluechange: function(_x, _y,z) {
that.sliders['z'].setValue(z);
that.sliders['z'].setValue(z);
that.send_value([z]);
}
......
......@@ -16,12 +16,10 @@ function Boid(p, x, y) {
this.maxforce = 0.05; // Maximum steering force
};
Boid.prototype.set_velocity = function(dx, dy) {
this.velocity = this.p.createVector(dx, dy);
};
Boid.prototype.set_acceleration = function(z) {
this.radius = 32;
if (Math.abs(z) > 0.5) {
this.radius = 32;
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment