# Class: matobject

Several classes which materials can be applied to, allow the detailed control of some material values. l3dmodels need to pass 2 arguments as matobject: l3dmodel,meshid. If you pass materials, then you will change values for the default matobject. If the node's material is changed, its old materialobject will be lost.

## Hierarchy

    o-+ renderinterface
      o-+ matobject

## Classes that implement this interface:

- l2dimage
- l3dmodel
- l3dprimitive
- l3dtrail
- l3dview
- material
- particlecloud
- particlesys
- rcmddraw2dmesh

## Methods:

### Method overview:

- moAutocontrol
- moAutotexstage
- moControl
- moModoff
- moPos
- moRotaxis
- moSeqoff
- moShdcontrol
- moTexcontrol
- moTexmatrix
- moTime

moAutocontrol (matobject,matcontrolid,[matautocontrol])
  returns: ([matautocontrol])
  sets or returns matautocontrol for this control value. Note that only vector controllers are allowed. Passing a non-matautocontrol will disable it.
moAutotexstage (matobject,int stage,boolean texgen,[matautocontrol])
  returns: ([matautocontrol])
  sets or returns matautocontrol for a texture stage. Use texgen=true if you want to modify texgenplanes. Note that only matrix controllers are allowed. Passing a non-matautocontrol will disable it.
moControl (matobject,matcontrolid,[offset],[float ...])
  returns: ([float ...])
  sets or returns materialcontrol value. Depending on length of control, 1..4 values are required. If the control value has length > 4, as in array values, the array offset is required. Offsets are multiplied by 4.
moModoff (matobject,[boolean])
  returns: (boolean)
  sets or returns modifiers active state
moPos (matobject,[float x,y,z])
  returns: ([float x,y,z])
  sets or returns position of texture matrix. Returns 0,0,0 if no matrix is set
moRotaxis (matobject,[float x1,y1,z1,x2,y2,z2,x3,y3,z3])
  returns: ([float x1,y1,z1,x2,y2,z2,x3,y3,z3])
  sets or returns rotaxis of texture matrix. Returns 1,0,0, 0,1,0, 0,0,1 if no matrix is set. May contain scaling!
moSeqoff (matobject,[boolean])
  returns: (boolean)
  sets or returns sequence play state
moShdcontrol (matobject,matshdcontrolid,[shader])
  returns: ([shader])
  sets or returns material shdcontrol value. If material has shader parameters, the passed shader must have matching parameterids as original
moTexcontrol (matobject,mattexcontrolid,[texture])
  returns: ([texture])
  sets or returns material texcontrol value.
moTexmatrix (matobject,[matrix4x4])
  returns: (matrix4x4)
  sets or returns texturematrix, pass 0 as matrix4x4 to disable.
moTime (matobject,[int])
  returns: (time)
  sets or returns time value, for automatic material values. 0 means systemtime is used.

## Inherited Methods: