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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     1
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     2
tuio.setConnector({
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     3
	_failmsg: "Unable to initialize npTuioClient plugin.",
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     4
	_id: "__tuiojs_connector_npTuioClient",
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     5
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     6
	start: function() {
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     7
		var el = document.getElementById(this._id);
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     8
		if (el == undefined) {
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
     9
			var el = document.createElement('object');
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    10
			el.setAttribute('id', this._id);
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    11
			el.setAttribute('type', 'application/x-tuio');
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    12
			el.appendChild(document.createTextNode(this._failmsg));
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    13
			document.body.appendChild(el);
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    14
		}
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    15
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    16
		// TODO: check if the plugin can be loaded. 
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    17
		//       if so, hide the plugin (display:none).
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    18
	},
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    19
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    20
	stop: function() {
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    21
		var el = document.getElementById(this._id);
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    22
		if (el != undefined) {
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    23
			document.body.removeChild(el);
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    24
		}
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    25
	}
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    26
});
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    27
26
858e90c7cbaa Front IDILL :
bastiena
parents: 25
diff changeset
    28
function tuio_callback(type, sid, fid, x, y, z, angle)  {
858e90c7cbaa Front IDILL :
bastiena
parents: 25
diff changeset
    29
	tuio.callback(type, sid, fid, x, y, z, angle);
25
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    30
}
a7b0e40bcab0 Front IDILL :
bastiena
parents:
diff changeset
    31