Pārlūkot izejas kodu

fix: TUIO source

bdestombes 3 gadi atpakaļ
vecāks
revīzija
8b896691d3
2 mainītis faili ar 6 papildinājumiem un 3 dzēšanām
  1. 3 3
      emitter/backend/server.js
  2. 3 0
      emitter/frontend/index.html

+ 3 - 3
emitter/backend/server.js

@@ -29,7 +29,7 @@ app.post('/json', function (req, res) {
 
 		const aliveMessage = [ '/tuio/2Dcur', 'alive' ].concat(alive);
 		oscBundle = new Bundle(
-			[ '/tuio/2Dcur', 'source', 'tangibles@127.0.0.1' ],
+			[ '/tuio/2Dcur', 'source', `tangibles${req.body.section.toString()}@127.0.0.1` ],
 			aliveMessage,
 			[ '/tuio/2Dcur', 'fseq', fseq ],
 			[
@@ -43,7 +43,7 @@ app.post('/json', function (req, res) {
 			alive.splice(index, 1);
 			if (alive.length === 0) {
 				oscBundle = new Bundle(
-					[ '/tuio/2Dcur', 'source', 'tangibles@127.0.0.1' ],
+					[ '/tuio/2Dcur', 'source', `tangibles${req.body.section.toString()}@127.0.0.1` ],
 					[ '/tuio/2Dcur', 'alive' ],
 					[ '/tuio/2Dcur', 'fseq', fseq ]
 				);
@@ -69,7 +69,7 @@ app.post('/json', function (req, res) {
 			});
 
 			oscBundle = new Bundle(
-				[ '/tuio/2Dcur', 'source', 'tangibles@127.0.0.1' ],
+				[ '/tuio/2Dcur', 'source', `tangibles${req.body.section.toString()}@127.0.0.1` ],
 				aliveMessage,
 				[ '/tuio/2Dcur', 'fseq', fseq ]
 			);

+ 3 - 0
emitter/frontend/index.html

@@ -87,6 +87,7 @@
 					body: JSON.stringify({
 						event: 'touchstart',
 						debug,
+						section,
 						screenW: $(document).width(),
 						screenH: $(document).height(),
 						changedTouches: touches
@@ -128,6 +129,7 @@
 					body: JSON.stringify({
 						event: 'touchmove',
 						debug,
+						section,
 						screenW: $(document).width(),
 						screenH: $(document).height(),
 						changedTouches: touches
@@ -170,6 +172,7 @@
 					body: JSON.stringify({
 						event: 'touchend',
 						debug,
+						section,
 						screenW: $(document).width(),
 						screenH: $(document).height(),
 						changedTouches: touches