# `class WMStates`

Available on all platforms

Status variables in wm3d

## Instance Fields

### `var arDegreeX:Float`

current auto-rotation degrees for x direction

### `var arDegreeY:Float`

current auto-rotation degrees for y direction

### `var arNow:Bool`

is auto-rotating now?

### `var busyNow:Bool`

general flag; whether i am busy on doing something now?

### `var camera:Camera`

Camera

### `var cpos:Vector3D`

camera position

### `var frameCounter:Int`

frame counter for play mode

### `var frameIndex:Int`

current frame

### `var light:Vector3D`

light direction; directional light source

### `var mouseModeL:Int`

current mouse mode for left button. Valid values are listed in `WMMouseModeL` class.

### `var mouseModeW:Int`

curret mode of mouse wheel Valid values are listed in `WMMouseModeW` class.

### `var mpos:Matrix3D`

rotation/translation matrix

### `var myLoadSysTimer:Timer`

timer for loading systems

### `var playReverse:Bool`

is current playing mode is remove mode?

### `var playingNow:Bool`

is playing scenes now?

### `var updateCameraPos:Bool`

whether updating camera position is requested

### `var updateMPos:Bool`

whether updating translation/rotation matrix is requested

### `var updateScene:Bool`

whether updating scene is required

### `var updateViewOffset:Bool`

whether updating offset of view is requested

### `var view_offset:Vector3D`

offset of view; not used now (maybe)

### `function new(w:Watermelon):Void`

Constructor.

Default values:

- arDegreeX: 0.0
- arDegreeY: params.arDegree (see WMParams)
- mouseModeL: MOUSELROTAT_MODE (rotation)
- mousemodeW: MOUSEWSCALE_MODE (scale)
- camera position: -max( stageWidth, stageHeight ) * 2;
- camera aspect: stageWidth / stageHeight
- camera fov angle: determineFov( stageHeight, abs( camera.pos.z ) )
- lght source: ( 1, -1 -1 )

### `function applyAutoRotation():Void`

apply auto-rotation to the rotation matrix

### `function backScene(e:MouseEvent):Void`

go to previous scene

### `function beginAutoRotation():Void`

begin auto-rotation

### `function beginLoadSysTimer(delay:Float):Void`

begin load system timer

### `function changeDepth(d:Int):Void`

mouse action: change camera z position

### `function changeScale(d:Int):Void`

mouse action: scale coordinate by d

### `function forwardScene(e:MouseEvent):Void`

go to next scene

### `function get_arDegreeX():Float`

getter of `arDegreeX`

### `function get_arDegreeY():Float`

getter of `arDegreeY`

### `function get_arNow():Bool`

getter of `arNow`

### `function get_busyNow():Bool`

getter of `busyNow`

### `function get_camera():Camera`

getter of `camera`

### `function get_cpos():Vector3D`

getter of `cpos`

### `function get_frameCounter():Int`

getter of `frameCounter`

### `function get_frameIndex():Int`

getter of `frameIndex`

### `function get_light():Vector3D`

getter of `lught`

### `function get_mouseModeL():Int`

getter of `mouseModeL`

### `function get_mouseModeW():Int`

getter of `mouseModeW`

### `function get_mpos():Matrix3D`

### `function get_myLoadSysTimer():Timer`

getter of `myLoadSysTimer`

### `function get_playReverse():Bool`

getter of `playReverse`

### `function get_playingNow():Bool`

getter of `playingNow`

### `function get_updateCameraPos():Bool`

getter of `updateCameraPos`

### `function get_updateMPos():Bool`

getter of `updateMPos`

### `function get_updateScene():Bool`

getter of `updateScene`

### `function get_updateViewOffset():Bool`

getter of `updateViewOffset`

### `function get_view_offset():Vector3D`

getter of `view_offset`

### `function gotoInitScene(e:MouseEvent):Void`

go to first scene

### `function gotoLastScene(e:MouseEvent):Void`

go to the scene

### `function initPlay():Void`

begin playing scenes (if there is only one scene, do nothing.). Usually this function is called by `playForward` or `playReverse`

### `function isLoadSysTimerRunning():Bool`

return if load system timer is running

### `function needToUpdate():Bool`

return whether is update of the scene is needed

### `function pausePlay(e:MouseEvent):Void`

pause playing

### `function playBackward(e:MouseEvent):Void`

begin playing: backward mode

### `function playForward(e:MouseEvent):Void`

begin playing: forward mode

### `function processCounter():Void`

counter frames for playing

### `function resetFlags():Void`

reset instant flags

### `function setCameraPosZ(z:Float):Void`

set camera z position (camera.pos.z) to given `z`

### `function setLightDirection(p:Point3D):Void`

setter of light

### `function set_arDegreeX(d:Float):Float`

setter of `arDegreeX`

### `function set_arDegreeY(d:Float):Float`

setter of `arDegreeY`

### `function set_arNow(f:Bool):Bool`

setter of `arNow`

### `function set_busyNow(f:Bool):Bool`

setter of `busyNow`

### `function set_camera(c:Camera):Camera`

setter of `camera`

### `function set_cpos(p:Vector3D):Vector3D`

setter of `cpos`

### `function set_frameCounter(c:Int):Int`

setter of `frameCounter`

### `function set_frameIndex(i:Int):Int`

setter of `frameIndex`

### `function set_light(l:Vector3D):Vector3D`

setter of `lught`

### `function set_mouseModeL(m:Int):Int`

setter of `mouseModeL`

### `function set_mouseModeW(m:Int):Int`

setter of `mouseModeW`

### `function set_mpos(m:Matrix3D):Matrix3D`

### `function set_playReverse(f:Bool):Bool`

setter of `playReverse`

### `function set_playingNow(f:Bool):Bool`

setter of `playingNow`

### `function set_updateCameraPos(f:Bool):Bool`

setter of `updateCameraPos`

### `function set_updateMPos(f:Bool):Bool`

setter of `updateMPos`

### `function set_updateScene(f:Bool):Bool`

setter of `updateScene`

### `function set_updateViewOffset(f:Bool):Bool`

setter of `updateViewOffset`

### `function set_view_offset(o:Vector3D):Vector3D`

setter of `view_offset`

### `function stopAutoRotation():Void`

stop auto-rotation

### `function stopLoadSysTimer():Void`

stop load system timer

### `function updateCPos():Void`

update camera position; copy `camera.pos` to `cpos`