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

Send visuals data on visuals channel...

parent 66d6b154
......@@ -3,7 +3,7 @@ defmodule Grains.Mixfile do
def project do
[app: :grains,
version: "0.0.43",
version: "0.0.44",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
......
......@@ -20,7 +20,7 @@ defmodule Grains.AccelerationChannel do
z: z
} )
Grains.Endpoint.broadcast "visual", "acceleration", %{user: uuid, force: z}
Grains.Endpoint.broadcast "visuals", "acceleration", %{user: uuid, force: z}
{:reply, :ok, socket}
......
......@@ -28,7 +28,7 @@ defmodule Grains.OrientationChannel do
}
)
Grains.Endpoint.broadcast "visual", "velocity", %{user: uuid, dx: pitch, dy: roll}
Grains.Endpoint.broadcast "visuals", "velocity", %{user: uuid, dx: pitch, dy: roll}
# Grains.Endpoint.broadcast("osc", "orientation", %{user: socket.assigns.user_uuid,
# pitch: pitch,
......
......@@ -226,11 +226,6 @@ let PresenceSketch = {
s.createCanvas(PresenceSketch.width, PresenceSketch.height);
s.background(150, 60, 70);
// Add an initial set of boids into the system
// for (var i = 0; i < 2; i++) {
// PresenceSketch.boids["foo" + i] = new Boid(s, Math.random() * PresenceSketch.width,
// Math.random() * PresenceSketch.height);
// }
};
s.draw = function() {
......@@ -263,53 +258,9 @@ let PresenceSketch = {
}
// if (userList) {
// userList.innerHTML = Presence.list(presences, listBy)
// .map(presence => `
// <li>
// <b>${presence.user}</b>
// <br><small>online since ${presence.onlineAt}</small>
// </li>
// `)
// .join("");
// }
// socket.connect();
// let room = socket.channel("presence:lobby", {});
// console.log(room);
// room.on("presence_state", state => {
// console.log("presence_state");
// PresenceSketch.presences = Presence.syncState(PresenceSketch.presences, state);
// PresenceSketch.render_sketch(PresenceSketch.presences);
// });
// room.on("presence_diff", diff => {
// console.log("presence_diff");
// PresenceSketch.presences = Presence.syncDiff(PresenceSketch.presences, diff);
// PresenceSketch.render_sketch(PresenceSketch.presences);
// });
// console.log("joining presence sketch");
// room.join().receive("ok", resp => {
// console.log("presencesketch joined");
// })
// .receive("error", reason => console.log("presence join failed", reason));
new p5(this.sketch, domId);
}
}
......
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