var X3DJSON = {}; X3DJSON.DECLnode_nodeA_MoveBall = function() { ecmascript: this.set_cycle = function (value) { this.old = this.translation; this.translation = Browser.stringToArray('SFVec3f',[Math.random()*100-50, Math.random()*100-50, Math.random()*100-50]); this.keyValue = Browser.stringToArray('MFVec3f',[this.old, this.translation]); // Browser.println(this.translation); }; this.translation = [50,50,0]; this.set_translation = function (value) { if (value) this.translation = (value.indexOf(",") >= 0 ? value.split(",") : value); }; this.translation_changed = function () { return this.translation; }; this.old = [0,0,0]; this.set_old = function (value) { if (value) this.old = (value.indexOf(",") >= 0 ? value.split(",") : value); }; this.old_changed = function () { return this.old; }; this.cycle = undefined; this.cycle_changed = function () { return this.cycle; }; this.keyValue = []; this.set_keyValue = function (value) { if (value) this.keyValue = (value.indexOf(",") >= 0 ? value.split(",") : value); }; this.keyValue_changed = function () { return this.keyValue; }; }; X3DJSON.Object_DECLnode_nodeA_MoveBall = new X3DJSON.DECLnode_nodeA_MoveBall(); if (typeof X3DJSON.Object_DECLnode_nodeA_MoveBall.initialize === "function") X3DJSON.Object_DECLnode_nodeA_MoveBall.initialize(); X3DJSON.DECLnode_nodeB_MoveBall = function() { ecmascript: this.set_cycle = function (value) { this.old = this.translation; this.translation = Browser.stringToArray('SFVec3f',[Math.random()*100-50, Math.random()*100-50, Math.random()*100-50]); this.keyValue = Browser.stringToArray('MFVec3f',[this.old, this.translation]); // Browser.println(this.translation); }; this.translation = [50,50,0]; this.set_translation = function (value) { if (value) this.translation = (value.indexOf(",") >= 0 ? value.split(",") : value); }; this.translation_changed = function () { return this.translation; }; this.old = [0,0,0]; this.set_old = function (value) { if (value) this.old = (value.indexOf(",") >= 0 ? value.split(",") : value); }; this.old_changed = function () { return this.old; }; this.cycle = undefined; this.cycle_changed = function () { return this.cycle; }; this.keyValue = []; this.set_keyValue = function (value) { if (value) this.keyValue = (value.indexOf(",") >= 0 ? value.split(",") : value); }; this.keyValue_changed = function () { return this.keyValue; }; }; X3DJSON.Object_DECLnode_nodeB_MoveBall = new X3DJSON.DECLnode_nodeB_MoveBall(); if (typeof X3DJSON.Object_DECLnode_nodeB_MoveBall.initialize === "function") X3DJSON.Object_DECLnode_nodeB_MoveBall.initialize(); X3DJSON.DECLcylinder_linkA_MoveCylinder = function() { ecmascript: this.set_endA = function (value) { if (typeof this.spine === "undefined") { this.spine = Browser.stringToArray('MFVec3f',[value, value]); } else { this.spine = Browser.stringToArray('MFVec3f',[value, this.spine[1]]); } } ; this.set_endB = function (value) { if (typeof this.spine === "undefined") { this.spine = Browser.stringToArray('MFVec3f',[value, value]); } else { this.spine = Browser.stringToArray('MFVec3f',[this.spine[0], value]); } } ; this.set_spine = function (value) { this.spine = value; }; this.spine = [[0,-50,0],[0,0,0],[0,50,0]]; this.spine_changed = function () { return this.spine; }; this.endA = undefined; this.endA_changed = function () { return this.endA; }; this.endB = undefined; this.endB_changed = function () { return this.endB; }; }; X3DJSON.Object_DECLcylinder_linkA_MoveCylinder = new X3DJSON.DECLcylinder_linkA_MoveCylinder(); if (typeof X3DJSON.Object_DECLcylinder_linkA_MoveCylinder.initialize === "function") X3DJSON.Object_DECLcylinder_linkA_MoveCylinder.initialize(); // This is the route code. Put it in a loop if (!$("[DEF=DECLnode_nodeA_nodeClock], [USE=DECLnode_nodeA_nodeClock]")) console.error("undefined DECLnode_nodeA_nodeClock"); X3DJSON.Object_DECLnode_nodeA_MoveBall.set_cycle($("[DEF=DECLnode_nodeA_nodeClock], [USE=DECLnode_nodeA_nodeClock]").attr("cycleTime")); if (!$("[DEF=DECLnode_nodeA_NodePosition], [USE=DECLnode_nodeA_NodePosition]")) console.error("undefined DECLnode_nodeA_NodePosition"); if (!$("[DEF=DECLnode_nodeA_nodeClock], [USE=DECLnode_nodeA_nodeClock]")) console.error("undefined DECLnode_nodeA_nodeClock"); $("[DEF=DECLnode_nodeA_NodePosition], [USE=DECLnode_nodeA_NodePosition]").attr("fraction",$("[DEF=DECLnode_nodeA_nodeClock], [USE=DECLnode_nodeA_nodeClock]").attr("fraction")); if (!$("[DEF=DECLnode_nodeA_NodePosition], [USE=DECLnode_nodeA_NodePosition]")) console.error("undefined DECLnode_nodeA_NodePosition"); $("[DEF=DECLnode_nodeA_NodePosition], [USE=DECLnode_nodeA_NodePosition]").attr("keyValue",typeof X3DJSON.Object_DECLnode_nodeA_MoveBall.keyValue_changed === "function" ? X3DJSON.Object_DECLnode_nodeA_MoveBall.keyValue_changed() : X3DJSON.Object_DECLnode_nodeA_MoveBall.keyValue_changed); if (!$("[DEF=DECLnode_nodeA_transform], [USE=DECLnode_nodeA_transform]")) console.error("undefined DECLnode_nodeA_transform"); if (!$("[DEF=DECLnode_nodeA_NodePosition], [USE=DECLnode_nodeA_NodePosition]")) console.error("undefined DECLnode_nodeA_NodePosition"); $("[DEF=DECLnode_nodeA_transform], [USE=DECLnode_nodeA_transform]").attr("translation",$("[DEF=DECLnode_nodeA_NodePosition], [USE=DECLnode_nodeA_NodePosition]").attr("value")); if (!$("[DEF=DECLnode_nodeB_nodeClock], [USE=DECLnode_nodeB_nodeClock]")) console.error("undefined DECLnode_nodeB_nodeClock"); X3DJSON.Object_DECLnode_nodeB_MoveBall.set_cycle($("[DEF=DECLnode_nodeB_nodeClock], [USE=DECLnode_nodeB_nodeClock]").attr("cycleTime")); if (!$("[DEF=DECLnode_nodeB_NodePosition], [USE=DECLnode_nodeB_NodePosition]")) console.error("undefined DECLnode_nodeB_NodePosition"); if (!$("[DEF=DECLnode_nodeB_nodeClock], [USE=DECLnode_nodeB_nodeClock]")) console.error("undefined DECLnode_nodeB_nodeClock"); $("[DEF=DECLnode_nodeB_NodePosition], [USE=DECLnode_nodeB_NodePosition]").attr("fraction",$("[DEF=DECLnode_nodeB_nodeClock], [USE=DECLnode_nodeB_nodeClock]").attr("fraction")); if (!$("[DEF=DECLnode_nodeB_NodePosition], [USE=DECLnode_nodeB_NodePosition]")) console.error("undefined DECLnode_nodeB_NodePosition"); $("[DEF=DECLnode_nodeB_NodePosition], [USE=DECLnode_nodeB_NodePosition]").attr("keyValue",typeof X3DJSON.Object_DECLnode_nodeB_MoveBall.keyValue_changed === "function" ? X3DJSON.Object_DECLnode_nodeB_MoveBall.keyValue_changed() : X3DJSON.Object_DECLnode_nodeB_MoveBall.keyValue_changed); if (!$("[DEF=DECLnode_nodeB_transform], [USE=DECLnode_nodeB_transform]")) console.error("undefined DECLnode_nodeB_transform"); if (!$("[DEF=DECLnode_nodeB_NodePosition], [USE=DECLnode_nodeB_NodePosition]")) console.error("undefined DECLnode_nodeB_NodePosition"); $("[DEF=DECLnode_nodeB_transform], [USE=DECLnode_nodeB_transform]").attr("translation",$("[DEF=DECLnode_nodeB_NodePosition], [USE=DECLnode_nodeB_NodePosition]").attr("value")); if (!$("[DEF=DECLcylinder_linkA_extrusion], [USE=DECLcylinder_linkA_extrusion]")) console.error("undefined DECLcylinder_linkA_extrusion"); $("[DEF=DECLcylinder_linkA_extrusion], [USE=DECLcylinder_linkA_extrusion]").attr("spine",typeof X3DJSON.Object_DECLcylinder_linkA_MoveCylinder.spine_changed === "function" ? X3DJSON.Object_DECLcylinder_linkA_MoveCylinder.spine_changed() : X3DJSON.Object_DECLcylinder_linkA_MoveCylinder.spine_changed); if (!$("[DEF=DECLnode_nodeA_transform], [USE=DECLnode_nodeA_transform]")) console.error("undefined DECLnode_nodeA_transform"); X3DJSON.Object_DECLcylinder_linkA_MoveCylinder.set_endA($("[DEF=DECLnode_nodeA_transform], [USE=DECLnode_nodeA_transform]").attr("translation")); if (!$("[DEF=DECLnode_nodeB_transform], [USE=DECLnode_nodeB_transform]")) console.error("undefined DECLnode_nodeB_transform"); X3DJSON.Object_DECLcylinder_linkA_MoveCylinder.set_endB($("[DEF=DECLnode_nodeB_transform], [USE=DECLnode_nodeB_transform]").attr("translation"));