summaryrefslogtreecommitdiffstats
path: root/test/samples/uscxml/test-scenegraph.scxml
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-01-10 22:42:42 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-01-10 22:42:42 (GMT)
commit7aa7095d17a180d663cd9647c31d99d97c1dca4f (patch)
tree460bc3a67f0adc3199bec9f22ee15a102263eb4c /test/samples/uscxml/test-scenegraph.scxml
parentda1032ffbff229ce2ca9a83d47522ff45c90ba23 (diff)
downloaduscxml-7aa7095d17a180d663cd9647c31d99d97c1dca4f.zip
uscxml-7aa7095d17a180d663cd9647c31d99d97c1dca4f.tar.gz
uscxml-7aa7095d17a180d663cd9647c31d99d97c1dca4f.tar.bz2
Major changes - see details
- Dynamic SceneGraph ML - V8 DOM for ecmascript datamodel - New heartbeat invoker - Fixed various bugs
Diffstat (limited to 'test/samples/uscxml/test-scenegraph.scxml')
-rw-r--r--test/samples/uscxml/test-scenegraph.scxml45
1 files changed, 35 insertions, 10 deletions
diff --git a/test/samples/uscxml/test-scenegraph.scxml b/test/samples/uscxml/test-scenegraph.scxml
index 25e13ed..0efcd6d 100644
--- a/test/samples/uscxml/test-scenegraph.scxml
+++ b/test/samples/uscxml/test-scenegraph.scxml
@@ -1,5 +1,16 @@
-<scxml datamodel="ecmascript" initial="start" binding="late" xmlns:scenegraph="http://uscxml.tk.informatik.tu-darmstadt.de/scenegraph.xsd">
+<scxml datamodel="ecmascript" initial="start" binding="late"
+ xmlns="http://www.w3.org/2005/07/scxml"
+ xmlns:scenegraph="http://uscxml.tk.informatik.tu-darmstadt.de/scenegraph.xsd">
+ <datamodel>
+ <data id="pitch">0</data>
+ <data id="yaw">0</data>
+ <data id="roll">0</data>
+ </datamodel>
<state id="start">
+ <invoke type="heartbeat">
+ <param name="interval" expr="'10ms'" />
+ <param name="eventname" expr="'heartbeat.20ms'" />
+ </invoke>
<invoke type="scenegraph">
<content>
<scenegraph:display x="10%" y="10 %" width="50 % " height=" 50 % ">
@@ -10,13 +21,8 @@
</scenegraph:translation>
</scenegraph:scale>
</scenegraph:viewport>
- <scenegraph:viewport x="50%" y="0" width="50%" height="50%" id="scene2">
- <scenegraph:translation x="0" y="0" z="0">
- <scenegraph:node src="http://cs.iupui.edu/~aharris/mm/vrml4/house.wrl" />
- </scenegraph:translation>
- </scenegraph:viewport>
<scenegraph:viewport x="0" y="50%" width="50%" height="50%" id="scene3">
- <scenegraph:rotation pitch="100deg" roll="3.15149rad" yaw="10deg">
+ <scenegraph:rotation id="treeRotation" pitch="100deg" roll="3.15149rad" yaw="10deg">
<scenegraph:node src="http://cs.iupui.edu/~aharris/webDesign/vrml/tree.wrl" />
</scenegraph:rotation>
</scenegraph:viewport>
@@ -25,17 +31,36 @@
<scenegraph:node src="scenegraph/HARD_MP_VAL_000.wrl" />
</scenegraph:translation>
</scenegraph:viewport>
+ <scenegraph:viewport x="50%" y="0" width="50%" height="50%" id="scene2">
+ <scenegraph:translation x="0" y="0" z="0">
+ <scenegraph:node src="http://cs.iupui.edu/~aharris/mm/vrml4/house.wrl" />
+ </scenegraph:translation>
+ </scenegraph:viewport>
</scenegraph:display>
- <!-- scenegraph:display x="20%" y="20 %" width="50 % " height=" 50 % ">
- <scenegraph:viewport x="0" y="0" width="50%" height="50%" id="scene1">
+ <scenegraph:display x="20%" y="20 %" width="50 % " height=" 50 % ">
+ <scenegraph:viewport x="0" y="0" width="100%" height="100%" id="scene1">
<scenegraph:translation x="0" y="0" z="0">
<scenegraph:node src="scenegraph/HARD_MP_VAL_000.wrl" />
</scenegraph:translation>
</scenegraph:viewport>
- </scenegraph:display -->
+ </scenegraph:display>
</content>
</invoke>
+ <state id="animate">
+ <onentry>
+ <script>
+ var nodeSet = document.evaluate("//scenegraph:rotation[@id='treeRotation']").asNodeSet();
+ nodeSet[0].setAttribute("pitch", "pitch" + pitch + "deg");
+ nodeSet[0].setAttribute("roll", "roll" + roll + "deg");
+ nodeSet[0].setAttribute("yaw", "yaw" + yaw + "deg");
+ pitch += 0.5;
+ roll += 0.3;
+ yaw += 0.1;
+ </script>
+ </onentry>
+ <transition event="heartbeat.20ms" target="animate" />
+ </state>
</state>
<final id="final">
<onentry>