# `class WMBase`

Available on all platforms

Base class for wm3d objects.

## Sub classes:

WMObjBase | Base Object of wm3d.

## Class Fields

### `static var characteristicSize:Float`

scale factor used for relative scaling; default is 0.0025. See also `useRelative` and `scaleBase`.

### `static var scaleBase:Float`

relative scale factor; default value is min(stageWidth,stageHeight)*`characteristicSize`

### `static var useRelative:Bool`

use relative scaling in distance. default value is true.

### `static function getRelative(r:Float):Float`

returns actual position of `r` (if relative scaling is false, `r` itself will be returned)

### `static function parseColor(c:String):Int`

convert color in string (such as red) into RGB integer (such as 0xFF0000). Input value `c` is color string and the return value is RGB color in integer.

### `static function setScaleBase(st:Stage):Void`

set scale factor for relative scaling. Stage size `st` is used as a reference length.

### `static function splitString(s:String):Array<String>`

split string like split function is perl. Return value is array of splitted strings of `s`.

## Instance Fields

### `var alpha:Float`

alpha value (range 0.0(transparent)-1.0(opaque))

### `var ambient:Float`

intensity of ambient; note that ambient in wm3d is colored

### `var color0:Int`

color

### `var color1:Int`

optional color

### `var diffuse:Float`

intensity of diffuse; used in Gouraud and Phong shaders.

### `var gloss:Float`

gloss used in Phong-shaders

### `var offset:Float`

offset value; a few objects use this value

### `var quality:Int`

quality (accuracy) of the object; important for spherical moiety

### `var radius:Float`

radius in angstrom

### `var shader:String`

Shader used for this object; Simple, Gouraud, and Phong are the only valid values.

### `var specular:Float`

intensity of specular; used in Phong-shaders.

### `function new(r:Float, c0:Int, c1:Int, a:Float, o:Float, q:Int, ag:Float, d:Float, sp:Float, gl:Float, sh:String):Void`

Constructor.

### `function clear(def:WMDefaults):Void`

initialize variables

### `function copyFrom(d:Dynamic):Void`

copy values from `d`

### `function getDataSize():Int`

data size: this is not meaningful for this class

### `function get_alpha():Float`

getter of `alpha`

### `function get_ambient():Float`

getter of `ambient`

### `function get_color0():Int`

getter of `color0`

### `function get_color1():Int`

getter of `color1`

### `function get_diffuse():Float`

getter of `diffuse`

### `function get_gloss():Float`

getter of `gloss`

### `function get_offset():Float`

getter of `offset`

### `function get_quality():Int`

getter of `quality`

### `function get_radius():Float`

getter of `radius`

### `function get_shader():String`

getter of `shader`

### `function get_specular():Float`

getter of `specular`

### `function loadFromXml(x:Xml, def:WMDefaults):Void`

load varibles from Xml. If `def` is given, `def` is used as an initial values and then overwritten by Xml data `x`.

### `function set(r:Float, c0:Int, c1:Int, a:Float, o:Float, q:Int, ag:Float, d:Float, sp:Float, gl:Float, sh:String):Void`

set vaiables

### `function set_alpha(a:Float):Float`

setter of `alpha`

### `function set_ambient(a:Float):Float`

setter of `ambient`

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

setter of `color0`

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

setter of `color1`

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

setter of `diffuse`

### `function set_gloss(g:Float):Float`

setter of `gloss`

### `function set_offset(o:Float):Float`

setter of `offset`

### `function set_quality(q:Int):Int`

setter of `quality`

### `function set_radius(r:Float):Float`

setter of `radius`

### `function set_shader(sn:String):String`

setter of `shader`

### `function set_specular(s:Float):Float`

setter of `specular`