You are not logged in.

globule22

Trainee

  • "globule22" started this thread

Posts: 57

Location: Rennes, France

  • Send private message

1

Sunday, November 24th 2013, 9:56am

Stop lookto with code

Hi,

I have a project with a javascript wrapper for krpano api.
With my JS wrapper, i can call an action written in the config.xml. It is a sequence of lookto for explaining 360 interaction to user before starting the tour.

Source code

1
2
3
4
5
6
7
8
9
<action name="help-drag">
		oninterrupt('reset-help');
		wait(1);
		lookto(40,0,120,linear(20));
		lookto(17.5,0,120,linear(20));
		lookto(17.5,-17.5,120,linear(20));
		lookto(17.5,20,120,linear(20));
		lookto(0,0,120,linear(30));
	</action>


The user can stop this sequence by closing the overlay, but i want to stop the action sequence too.

It seems that calling the other action named 'reset-help' which has this code :

Source code

1
2
3
4
5
<action name="reset-help">
		showlog(true);
		stopall();
		breakall();
	</action>


doesn't arrive directly, but after the first lookto sequence.

It seems that the oninterrupt does work just for user interaction and not code blocking stuff.

Any advice for my feature ?

2

Tuesday, November 26th 2013, 5:01pm

Hi,

right - oninterrupt works only for user-interactions, when calling from Javascript during blocking, the actions from the call will be put into a queue of actions and executed when the current blocking actions were done...

A way to work around this, might be using non-blocking lookto calls and some custom user blocking (e.g. big invisible layer on top).

A non-blocking lookto call can be stopped by calling again a non-blocking lookto with the current view coordinates - e.g.

Source code

1
lookto(get(view.hlookat),get(view.vlookat),get(view.fov),true,true);


Best regards,
Klaus

globule22

Trainee

  • "globule22" started this thread

Posts: 57

Location: Rennes, France

  • Send private message

3

Saturday, December 7th 2013, 2:30am

Thanks,

It helps making a cleanest code to handle that stuff.