front_idill/extern/fajran-tuiojs/connector/npTuioClient/tuiojs.npTuioClient.js
author bastiena
Fri, 06 Apr 2012 18:36:40 +0200
changeset 26 858e90c7cbaa
parent 25 a7b0e40bcab0
child 27 6c08d4d7219e
permissions -rw-r--r--
Front IDILL : JS TUIO module modified to receive 3D Points


tuio.setConnector({
	_failmsg: "Unable to initialize npTuioClient plugin.",
	_id: "__tuiojs_connector_npTuioClient",

	start: function() {
		var el = document.getElementById(this._id);
		if (el == undefined) {
			var el = document.createElement('object');
			el.setAttribute('id', this._id);
			el.setAttribute('type', 'application/x-tuio');
			el.appendChild(document.createTextNode(this._failmsg));
			document.body.appendChild(el);
		}

		// TODO: check if the plugin can be loaded. 
		//       if so, hide the plugin (display:none).
	},

	stop: function() {
		var el = document.getElementById(this._id);
		if (el != undefined) {
			document.body.removeChild(el);
		}
	}
});

function tuio_callback(type, sid, fid, x, y, z, angle)  {
	tuio.callback(type, sid, fid, x, y, z, angle);
}