Scene.extends="Image"
Scene.Class<<
  .centerX={$$.width/2}
  .centerY={$$.height/2}
  .buffer=clear
  .mode=_ROTATE
  .enabled={$$.mode!=_NONE}
  .inch=0.03937
  .cm=0.1
  .largeFormat=false
  .distance=0
  .view="View.$"
  .dirty=true
  .textureDirty=false
  .textureIsDirty={$$.antialias?($$.dirty=true):($$.textureDirty=true)}
  .minFPS=5
  .antialias=true
  .aaPower=8
  .pauseAntialias={$$.display->press|$$.display->key!=""}
  .mipmap=true
  .drawWireFrame=false
  .fillWireFrame=""
  .illustrationMode=false
  .illustrationThickness=1
  .illustrationThreshold=15
  .illustrationLineColor=black
  .illustrationFillColor=white
  .sphericalNormalEffect=0
  .thetaStep={360/$$.width}
  .phiStep={180/$$.height}
  .cursor={#m=$$.mode;#m==_ROTATE?_ARROW:#m==_MOVE?_MOVE:#m==_MEASURE?_CROSSHAIR:""}
  .runtime=""
  .loaded=false
  .skipNextInit=false
  .unloadRuntimes=true
  .stable=true
  .javaScene=""
  .hideObjects=[]
  .play={$$.mode=_ROTATE;@("$$.script_"~#arg)->play()}
  .playStartSlow={$$.mode=_ROTATE;@("$$.script_"~#arg)->playSlow()}
  .playInstantly={$$.mode=_ROTATE;@("$$.script_"~#arg)->playInstantly()}
  .jumpToTime={$$.mode=_ROTATE;@("$$.script_"~#script)->jumpCurrent(^time=#time)}
  .testPreconditions={@("$$.script_"~#arg)->testPreconditions()}
  .shadow="Shadow.Shadow_$"
  .effWidth={#c=$$.centerX;#w=$$.width-#c;2*(#w<#c?#w:#c)}
  .effHeight={#c=$$.centerY;#h=$$.height-#c;2*(#h<#c?#h:#c)}
  .effAspect={$$.effWidth/$$.effHeight}
  .aspWidth={#a=$$.effWidth;(#v=$$.view->aspect)<(#w=$$.effAspect)?(#a*#v/#w):#a}
  .aspHeight={#a=$$.effHeight;(#v=$$.view->aspect)>(#w=$$.effAspect)?(#a*#w/#v):#a}
  .floorReflectionColor=Meson.defaultFloorReflectionColor
  .floorReflectionFadeIn=0
  .floorReflectionFadeOut=0.3
  .selfShadowFlags=Meson.defaultSelfShadowFlags
  .new={
    Scene.newScene("$$");
    SceneState.$.host="Meson";
    Ticker.$_render.exec={Scene.render($$.javaScene)};
    Ticker.$_render.order=15;
    Anim.$_view.enabled={$$.mode!=_NONE};
    Anim.$_view.attr=["View.$.x","View.$.y","View.$.z","View.$.cx","View.$.cy","View.$.phi","View.$.dist","View.$.scale"];
    Anim.$_view.goal={[View.$.desiredX,View.$.desiredY,View.$.desiredZ,View.$.desiredCx,View.$.desiredCy,View.$.desiredPhi,View.$.desiredDist,View.$.desiredScale]};
    Anim.$_view.smooth={View.$.smooth};
    Anim.$_viewT.enabled={Anim.$_view.enabled};
    Anim.$_viewT.attr=["View.$.theta"];
    Anim.$_viewT.goal={[View.$.desiredTheta]};
    Anim.$_viewT.smooth={View.$.smooth};
    Anim.$_viewT.modulus={Area.$.press?0:360};
    Area.$.image="Scene.$";
    Area.$.defaultPick=true;
    Trigger.$_meas.test={$$.mode==_MEASURE};
    Trigger.$_meas.exec={$$.distance=0};
    Trigger.$_click.test={$$.enabled&$$.mode!=_NONE&Area.$.press};
    Trigger.$_click.exec={$$.pressX=$$.dragX=$$.mouseX;$$.pressY=$$.dragY=$$.mouseY;$$.distance=0};
    Ticker.$_mouse.order={Trigger.$_click.test?1:-1};
    Ticker.$_mouse.exec={
      #mx=$$.mouseX;#my=$$.mouseY;
      $$.mode==_MEASURE?(#d=Scene.measure(^scene="Scene.$",^x0=$$.pressX,^y0=$$.pressY,^x1=#mx,^y1=#my);#d>=0?
         ($$.dragX=#mx;$$.dragY=#my;$$.distance=#d):$$.distance==0?($$.pressX=$$.dragX=#mx;$$.pressY=$$.dragY=#my)):
      (#dx=$$.pressX-#mx;#dy=$$.pressY-#my;$$.pressX=#mx;$$.pressY=#my;
       $$.mode==_ROTATE?(View.$.desiredTheta=View.$.desiredTheta+#dx*$$.thetaStep;View.$.setDesiredPhi(View.$.desiredPhi+#dy*$$.phiStep)):
       $$.mode==_MOVE?(View.$.desiredCx=View.$.desiredCx-#dx/$$.aspWidth;View.$.desiredCy=View.$.desiredCy-#dy/$$.aspHeight))
    };
  }
>>
View.extends=""
View.Class<<
  .locked=false
  .theta=0
  .desiredTheta=0
  .phi=0
  .desiredPhi=0
  .psi=0
  .cx=0.5
  .desiredCx=0.5
  .cy=0.5
  .desiredCy=0.5
  .scale=2
  .desiredScale=2
  .fov={(2/Meson.degToRad)*Meson.atan(0.5/$$.scale)}
  .desiredFov={(2/Meson.degToRad)*Meson.atan(0.5/$$.desiredScale)}
  .dist=100
  .desiredDist=100
  .aspect=1
  .x=0
  .desiredX=0
  .y=0
  .desiredY=0
  .z=0
  .desiredZ=0
  .snap={
    $$.theta=$$.desiredTheta;$$.phi=$$.desiredPhi;$$.cx=$$.desiredCx;$$.cy=$$.desiredCy;
    $$.scale=$$.desiredScale;$$.dist=$$.desiredDist;$$.x=$$.desiredX;$$.y=$$.desiredY;$$.z=$$.desiredZ;
  }
  .minPhi=-90
  .maxPhi=90
  .setDesiredPhi={#n=$$.minPhi;$$.desiredPhi=(#arg<#n?#n:(#n=$$.maxPhi;#arg>#n?#n:#arg))}
  .minFOV=28
  .maxFOV=28
  .setDesiredFov={
     #n=$$.minFOV;#d=(#arg<#n?#n:(#n=$$.maxFOV;#arg>#n?#n:#arg));
     #s=$$.desiredScale;
     #d=($$.desiredScale=0.5/Meson.tan(#d*0.5*Meson.degToRad))/#s;
     $$.desiredCx=0.5+($$.desiredCx-0.5)*#d;$$.desiredCy=0.5+($$.desiredCy-0.5)*#d
  }
  .smooth={allPlayingScripts!=[]?0.15:Meson.frameRate<7?0:0.05}
>>
SceneState.extends=""
Texture.extends="Image"
Texture.Class<<
  .depth=16
  .blur=false
  .mipmap=true
  .parent=""
  .absVisible=true
  .deferLoad=true
  .fromScene=false
  .scenes=[]
  .addScene={$$.scenes=$$.scenes++#arg}
  .repaint={$$.dirtyBits=_SELF;foreach(^elem="i";^in=$$.scenes;^do={#i->textureIsDirty()})}
  .dynamic=false
>>
MaterialTextureMapping.extends=""
MaterialTextureMapping.Class.texture="Texture.$"
Shadow.extends="Texture"
Shadow.Class<<
  .depth=32
  .buffer=clear
  .width=24
  .height=24
  .below=0.1
  .alpha=0.75
  .fixed=true
  .deferLoad=false
>>
HotSpot.extends=""
HotSpot.Class<<
  .parent=""
  .x=0
  .y=0
  .z=0
  .radius=0
  .visible=false
  .mouseHover=false
  .display={$$.parent->display}
  .hover={$$.mouseHover}
  .press={$$.hover&$$.display->press}
>>
SceneRT.extends="GenericPeer"
SceneRT.Class<<
  .javaClass="com.kaon.master.runtime.SceneRuntime"
  .initScripts={$$.callMethod(^method="initScripts";^types=["[Lcom.kaon.master.runtime.ScriptRuntime;","com.kaon.master.runtime.ScriptRuntime"];^args=#arg)}
  .initObjects={$$.callMethod(^method="initObjects";^types=["[Lcom.kaon.master.runtime.ObjectRuntime;","[Lcom.kaon.master.runtime.MaterialRuntime;"];^args=#arg)}
  .initLights={$$.callMethod(^method="initLights";^types=["[Lcom.kaon.master.runtime.LightRuntime;"];^args=#arg)}
  .setPosition={$$.callMethod(^method="setPosition";^types=["float","float","float"];^args=#arg)}
  .setOrientation={$$.callMethod(^method="setOrientation";^types=["float","float","float"];^args=#arg)}
  .setPivot={$$.callMethod(^method="setPivot";^types=["float","float","float"];^args=#arg)}
  .setAlpha={$$.callMethod(^method="setAlpha";^types=["float"];^args=#arg)}
  .setCurrentToInit={$$.callMethod(^method="setCurrentToInit";^types=[];^args=[])}
  .getInitID={$$.callMethod(^method="getInitID";^types=[];^args=[])}
  .uninit={$$.callMethod(^method="uninit";^types=[];^args=[])}
>>
AmbientLightRT.extends="GenericPeer"
AmbientLightRT.Class.javaClass="com.kaon.master.runtime.LightRuntime"
AmbientLightRT.Class.init={$$.callMethod(^method="init";^types=["float"];^args=#arg);$$.javaObject}
DirectLightRT.extends="GenericPeer"
DirectLightRT.Class.javaClass="com.kaon.master.runtime.LightRuntime"
DirectLightRT.Class.init={$$.callMethod(^method="init";^types=["float","float","float","float"];^args=#arg);$$.javaObject}
MaterialRT.extends="GenericPeer"
MaterialRT.Class.javaClass="com.kaon.master.runtime.MaterialRuntime"
MaterialRT.Class.init={$$.callMethod(^method="init";^types=["java.lang.String","int","java.lang.String","float","boolean","int","int","java.util.Vector","[I","float","java.lang.String"];^args=#arg);$$.javaObject}
MaterialRT.Class.init2={$$.callMethod(^method="init2";^types=["float","float","float","float","float"];^args=#arg);$$.javaObject}
MaterialRT.Class.initWrap={$$.callMethod(^method="initWrap";^types=["boolean","boolean"];^args=#arg);$$.javaObject}
ViewRT.extends="GenericPeer"
ViewRT.Class.javaClass="com.kaon.master.runtime.ViewRuntime"
ViewRT.Class.init={$$.callMethod(^method="init";^types=["com.kaon.master.runtime.SceneRuntime","float","float","float","float","float","float","float","float","float","float","float","float","float","float"];^args=#arg);$$.javaObject}
ObjectRT.extends="GenericPeer"
ObjectRT.Class<<
  .javaClass="com.kaon.master.runtime.ObjectRuntime"
  .init={$$.callMethod(^method="init";^types=["java.lang.String","com.kaon.master.runtime.ObjectRuntime","float","float","float","float","float","float","float","float","float","float"];^args=#arg);$$.javaObject}
  .initMesh={$$.callMethod(^method="initMesh";^types=["[F","[F","[[F","[I"];^args=#arg)}
  .initMesh2={$$.callMethod(^method="initMesh";^types=["[F","[F","[I","[I","int","boolean"];^args=#arg)}
  .initMeshBinary={$$.callMethod(^method="initMeshBinary";^types=["java.lang.String"];^args=#arg)}
  .initChildren={$$.callMethod(^method="initChildren";^types=["[Lcom.kaon.master.runtime.ObjectRuntime;"];^args=#arg)}
  .setBillboard={$$.callMethod(^method="setBillboard";^types=["int"];^args=#arg)}
  .setCastShadow={$$.callMethod(^method="setCastShadow";^types=["boolean"];^args=#arg)}
>>
EHLoftRT.extends="ObjectRT"
EHLoftRT.Class<<
  .javaClass="com.kaon.master.runtime.EHLoftRuntime"
  .initEHLoft={$$.callMethod(^method="initEHLoft";^types=["com.kaon.master.runtime.ObjectRuntime","float","float","int","int","float","float","float","float","com.kaon.master.runtime.MaterialRuntime"];^args=#arg)}
>>
SequenceRT.extends="GenericPeer"
SequenceRT.Class.javaClass="com.kaon.master.runtime.SequenceRuntime"
SequenceRT.Class.init={$$.callMethod(^method="init";^types=["java.lang.String","com.kaon.master.runtime.SceneRuntime","[Ljava.lang.Object;","[F","[Ljava.lang.String;","[I","[F","[F","[F","[F","[F","[F","[F","[F","[F","[F","[[Lcom.kaon.master.runtime.MaterialRuntime;","[[I","[F","[[Lcom.kaon.master.runtime.MaterialRuntime;","[[Ljava.lang.String;"];^args=#arg);$$.javaObject}
SequenceRT.Class.setCurrentID={$$.callMethod(^method="setCurrentID";^types="java.lang.String";^args=[$$.javaObject,#arg])}
SequenceRT.Class.setCurrentP={$$.callMethod(^method="setCurrentP";^types="float";^args=[$$.javaObject,#arg])}
allPlayingScripts=[]
ScriptRT.extends="GenericPeer"
ScriptRT.Class<<
  .javaClass="com.kaon.master.runtime.ScriptRuntime"
  .init={$$.callMethod(^method="init";^types=["java.lang.String","com.kaon.master.runtime.SceneRuntime","[Ljava.lang.String;","[Ljava.lang.String;","[Lcom.kaon.master.runtime.ScriptRuntime;","[F","[F","[I","[Lcom.kaon.master.runtime.SequenceRuntime;","[F","[Ljava.lang.String;","[Lcom.kaon.master.runtime.ScriptRuntime;","[Lcom.kaon.master.runtime.ViewRuntime;","[[Ljava.lang.String;"];^args=#arg);Meson.currentDataSource->scene~.script_~(#arg)[0]="$$";$$.javaObject}
  .testPreconditionsMethod={$$.getMethod(^method="testPreconditions";^types=[])}
  .testPreconditions={Meson.callMethod(^method=$$.testPreconditionsMethod;^args=[$$.javaObject])}
  .prepareToPlay={$$.callMethod(^method="prepareToPlay";^types=[];^args=[])}
  .stepCurrent={#ret=$$.callMethod(^method="stepCurrent";^types=["float"];^args=[Meson.frameStep*$$.rate]);$$.accel?(($$.rate=$$.rate+0.5*Meson.frameStep)>=1?($$.rate=1;$$.accel=false));#ret}
  .playing=false
  .rate=1f
  .playRate={$$.rate=#arg;$$.accel=false;!$$.playing?(($$.playing=$$.prepareToPlay())?(allPlayingScripts=allPlayingScripts++"$$"))}
  .play={$$.playRate(1f)}
  .playSlow={$$.playRate(0f);$$.accel=true;$$.playing}
  .jumpToEnd={$$.callMethod(^method="jumpToEnd";^types=[];^args=[])}
  .jumpCurrent={$$.callMethod(^method="jumpCurrent";^types=["float"];^args=[#time])}
  .playInstantly={$$.testPreconditions()?($$.jumpToEnd();$$.playing=false;/*return*/true)}
  .stop={$$.playing=false;allPlayingScripts=allPlayingScripts--"$$"}
  .new={
    Ticker.$_play.order={$$.playing?13:-1};
    Ticker.$_play.exec={!($$.playing=!$$.stepCurrent())?allPlayingScripts=allPlayingScripts--"$$"};
  }
>>
HotSpotRT.extends=""
HotSpotRT.Class.location=["","",0,0,0,0] /* SceneRuntime, ObjectRuntime, x, y, z, radius */
HotSpotRT.Class.alwaysVisible=false
HotSpotRT.Class.updateEveryFrame=true
