You are not logged in.

rouillip

Beginner

  • "rouillip" started this thread

Posts: 39

Location: Paris

Occupation: developer

  • Send private message

1

Sunday, December 8th 2013, 11:15am

Plugin compass. Various action upon the playing scene

I use the compass plugin and want to have various action upon the playing scene (i have four scenes in my .xml)
I try
<plugin name="compass" devices="html5"
url="plugins/compass.js"
enabled="true"
keep="true"
onavailability="copy(view.hlookat, heading);
if (get(xml.scene)=='scene_hall_130826_1218', sub(view.hlookat,60));
if (get(xml.scene)=='scene_galerienord_130826_1013', sub(view.hlookat,60));
if (get(xml.scene)=='scene_galeriezenithale_130826_1456', add(view.hlookat,180));
if (get(xml.scene)=='scene_escalier_130826_1633', sub(view.hlookat,90));
if (get(xml.scene)=='scene_jardin_130826_1127', add(view.hlookat,90));"
onchange="copy(view.hlookat, heading);
if (get(xml.scene)=='scene_hall_130826_1218', sub(view.hlookat,60));
if (get(xml.scene)=='scene_galerienord_130826_1013', sub(view.hlookat,60));
if (get(xml.scene)=='scene_galeriezenithale_130826_1456', add(view.hlookat,180));
if (get(xml.scene)=='scene_escalier_130826_1633', sub(view.hlookat,90));
if (get(xml.scene)=='scene_jardin_130826_1127', add(view.hlookat,90));"
/>
but this seems not working, and nothing is added or removed to hlookat !

Where am i wrong ?

Without testing the scene name the hlookat is incremented. I suppose my test to get the scene name is not working

Thanks for your help

2

Monday, December 9th 2013, 9:09am

Hi,

the get(##) is wrong there, try without it - e.g:

not:
if ( get( xml.scene ) == 'scene_hall_130826_1218', ...

just:
if ( xml.scene == 'scene_hall_130826_1218', ...

Best regards,
Klaus