if (dbgobj == true, %1);
if(hotspot[%1] AND hotspot[%1_blend],
if(%2 == prev,
dec(hotspot[%1].framenr, 1, 1, get(hotspot[%1].framecount));
,
%2 AND %2 GE 1,
if(%2 LE hotspot[%1].framecount , set(hotspot[%1].framenr, %2));
,
inc(hotspot[%1].framenr, 1, get(hotspot[%1].framecount), 1);
);
wait(LOAD);
set(hotspot[%1].tweening, true);
tween(hotspot[%1].alpha|hotspot[%1_blend].alpha, 1.0|0.0, 0.01, easeInCubic,
txtreplace(hotspot[%1_blend].url, hotspot[%1].frameurl, '%%f', get(hotspot[%1].framenr));
wait(LOAD);
callwhen(hotspot[%1_blend].loaded ,
tween(hotspot[%1_blend].alpha, 1.0, calc(hotspot[%1].rotateinterval * 0.95), easeInCubic,
set(hotspot[%1].url, get(hotspot[%1_blend].url));
wait(LOAD);
callwhen(hotspot[%1].loaded,
tween(hotspot[%1].alpha|hotspot[%1_blend].alpha, 1|0, 0.01, easeInCubic,
set(hotspot[%1].visible, true);
set(hotspot[%1_blend].visible, false);
set(hotspot[%1].tweening, false);
dbg_obj(trace( %0,'(', %1 %2,') framenr=', get(hotspot[%1].framenr) ,' stopframenr=',get(hotspot[%1].stopframenr) ,' [%1_blend].url=',hotspot[%1_blend].url ,' tick=', calc(timertick BOR 0)); );
wait(BLEND);
);
);
);
);
);
,
warning( %0,'(', %1 %2,') No hotspot %1 or ', %1_blend] ,' available! tick=', calc(timertick BOR 0));
);
if(hotspot[%1] AND hotspot[%1_blend],
if(%2 == start,
set(hotspot[%1].rotating,true);
callwhen(!hotspot[%1].tweening AND hotspot[%1].loaded,
if(autorotate.isrotating, autorotate.interrupt());
stopdelayedcall(obj360_rotate_delayed);
obj360_next(%1, %3);
if(hotspot[%1].stoponeround AND hotspot[%1].stopframenr == hotspot[%1].framenr ,
obj360_rotate(%1, stop);
,
delayedcall(obj360_rotate_delayed, get(hotspot[%1].rotateinterval), if(hotspot[%1].rotating, obj360_rotate(%1, %2, %3)) );
);
);
,
set(hotspot[%1].rotating,false);
set(hotspot[%1].stopframenr, get(hotspot[%1].framenr));
stopdelayedcall(obj360_rotate_delayed);
);
,
warning( %0,'(', %1 %2,') No hotspot[', %1 ,'] or ', %1_blend ,' available! tick=', calc(timertick BOR 0));
);
txtsplit(%1, '|', myhotspots);
for(set(i,0), i LT myhotspots.count, inc(i),
calc(curhs, myhotspots[get(i)].value);
if(hotspot[get(curhs)] ,
set(hotspot[get(curhs)].rotating,false);
set(hotspot[get(curhs)].stopframenr, get(hotspot[get(curhs)].framenr));
stopdelayedcall(obj360_rotate_delayed);
);
);
if(hsstr ,
copy(local.hs, get(hsstr));
debugvar(hs.name);
if(direction == prev,
dec(hs.framenr, 1, 1, get(hs.framecount));
,
direction AND direction GE 1,
if(direction LE hs.framecount , set(hs.framenr, get(direction)));
,
inc(hs.framenr, 1, get(hs.framecount), 1);
);
calc(local.hfname, hs.name + '_blend');
if(hs.ishotspot ,
if(hotspot[get(hfname)] ,
copy(local.hf, hotspot[get(hfname)]);
debugvar(hf.name);
set(hs.tweening, true);
tween(hs.alpha|hf.alpha, 1.0|0.0, 0.1, easeInCubic,
txtreplace(hf.url, hs.frameurl, '%%f', get(hs.framenr));
debugvar(hf.url);
callwhen(hf.loaded ,
tween(hf.alpha, 1.0, calc(hs.rotateinterval * 0.7), easeInCubic,
set(hs.url, get(hf.url));
callwhen(hs.loaded,
tween(hs.alpha|hf.alpha, 1|0, 0.01, easeInCubic,
set(hs.tweening, false);
if(dbgobj,
trace( %0,'(', %1 %2,') name=', hs.name ,' hs.framenr=',hs.framenr ,' hs.url=',hs.url ,' tick=', calc(timertick BOR 0));
);
);
);
);
);
);
,
warning( %0,'(', %1 %2,') No ', hfname ,' available. tick=', calc(timertick BOR 0));
);
,
warning( %0,'(', %1 %2,') By now only hotspots supported. No ', hsstr ,' tick=', calc(timertick BOR 0));
);
,
warning( %0,'(', %1 %2,') No ', %1 ,' available! tick=', calc(timertick BOR 0));
);
if(hs ,
if(startstop == start,
set(hs.rotating,true);
callwhen(!hs.tweening AND hs.loaded,
if(autorotate.isrotating, autorotate.interrupt());
stopdelayedcall(obj360_rotate_delayed);
obj360_next(get(hs), get(direction));
if(hs.stoponeround AND hs.stopframenr == hs.framenr ,
obj360_rotate(get(hs), 'stop');
,
delayedcall(obj360_rotate_delayed, get(hs.rotateinterval), if(hs.rotating, obj360_rotate(get(hs), 'start', get(direction))) );
);
);
,
set(hs.rotating,false);
set(hs.stopframenr, get(hs.framenr));
stopdelayedcall(obj360_rotate_delayed);
delete(obj360_rotate_delayed)
);
,
warning( %0,'(', %1 %2,') No hotspot[', hs ,'] available! tick=', calc(timertick BOR 0));
);
div(hfov,%1,57.295779);
div(yaw,%2,-57.295779);
div(pitch,%3,57.295779);
div(roll,%4,-57.295779);
mul(hfov,0.5);Math.tan(hfov);mul(width,hfov,1000);set(height,'prop');
Math.cos(ch,yaw);Math.sin(sh,yaw);
Math.cos(ca,pitch);Math.sin(sa,pitch);
Math.cos(cb,roll);Math.sin(sb,roll);
mul(m0,ca,ch);
mul(tmp,cb,sa);mul(tmp,ch);mul(tmp2,sb,sh);add(m3,tmp,tmp2);
mul(m4,cb,ca);
mul(tmp,cb,sa);mul(tmp,sh);mul(tmp2,sb,ch);sub(m5n,tmp,tmp2);mul(m5n,-1);
mul(tmp,sb,sa);mul(tmp,ch);mul(tmp2,cb,sh);sub(m6n,tmp,tmp2);mul(m6n,-1);
Math.atan2(yaw,m6n,m0);
Math.atan2(roll,m5n,m4);
Math.asin(pitch,m3);
mul(ath,yaw,57.295779);
mul(atv,pitch,57.295779);
mul(rotate,roll,57.295779);