# Class: l3dview

l3dview is used to render a l3dset. You can specify camera, background and fog for each l3dview.Every l3dset has one default l3dview, which cannot be deleted. Additionally you can register more l3dviews which are processed before the default views.The l3dnodes can be made visible only to certain cameras. By default they are visible to the default camera.
Another special purpose of l3dviews is rendering to a texture.

## Hierarchy

    o-+ l3dlist
      o-+ l3dview

## Interfaces:

- matobject

## Methods:

### Method overview:

- activate
- bgmatsurface
- bgskybox
- bgskyl3dnode
- camera
- deactivate
- defaultcamvisflag
- delete
- depthonly
- drawcamaxis
- filldrawlayers
- fogcolor
- fogdensity
- fogend
- fogstart
- fogstate
- new
- nomultisample
- polygonoffset
- rcmdadd
- rcmdempty
- rcmdflag
- rcmdremove
- usepolygonoffset
- viewpos
- viewrefbounds
- viewsize
- windowsized

new ()
  returns: (l3dview)
  returns a new l3dview.
activate (l3dview,l3dset)
  returns: ()
  activates the l3dview in the given set. Activate inserts the l3dview as first in the list. Has no effect on defaultviews
bgmatsurface (l3dview,[matsurface])
  returns: ([matsurface])
  returns or sets matsurface, disabled when 2nd arg is not a matsurface
bgskybox (l3dview,[skybox])
  returns: ([skybox])
  returns or sets skybox, disabled when 2nd arg is not a skybox
bgskyl3dnode (l3dview,[l3dnode],[float x,y,z])
  returns: ([l3dnode])
  returns or sets l3dnode to be used as background, disabled when 2nd arg is not a l3dnode. Be aware that the l3dnode must not be used anywhere else. It will automatically set the manual world matrix mode. Camera position is scaled using the 3 floats, that way you can 'fix' the model position around camera. Be aware that background models write into max depth, which means that overlapping geometry might create issues.
camera (l3dview,[l3dcamera])
  returns: (l3dcamera)
  returns or sets camera, disabled when 2nd arg is not a camera. If disabled we will use default camera.
deactivate (l3dview)
  returns: ()
  deactivates the l3dview. Has no effect on defaultviews
defaultcamvisflag (l3dview,int id,[boolean])
  returns: ([boolean])
  sets camera visibility bit flag if a default camera is used for this view. It overrides the visflag of the camera itself, however culling is done before and based on the original camera bitid.
delete (l3dview)
  returns: ()
  deletes the l3dview. Has no effect on defaultviews
depthonly (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if a pure Z write should be done.
drawcamaxis (l3dview,[boolean])
  returns: ([boolean])
  draws camera orientation
filldrawlayers (l3dview,[boolean])
  returns: ([boolean])
  enable/disable filling of drawlayers (l3dtrails, l3dmodels, l3dprimitives, l3dtbterrain, l3dlevelmodel, l3dtext, l3dshadowmodel), particlelayers remain active. Default is true. Useful when a pure fx/l2dnode/particle view is being rendered, or layers are organized to be spread over different l3dviews. When set to false the layerstate of previous l3dview remains active (first l3dview of each l3dset always does a clear). That way you can reuse the data, but it only makes sense if camera visibility stays identical. The layer filling is a rather costly operation, so avoid it when possible.
fogcolor (l3dview,[float r,g,b,a])
  returns: ([float r,g,b,a])
  returns or sets
fogdensity (l3dview,[float])
  returns: ([float])
  returns or sets
fogend (l3dview,[float])
  returns: ([float])
  returns or sets
fogstart (l3dview,[float])
  returns: ([float])
  returns or sets
fogstate (l3dview,[boolean])
  returns: ([boolean])
  returns or sets
nomultisample (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if multisampling should be deactivated (default off). Only works when window was created with multisample-support. Be warned that drivers may ignore this.
polygonoffset (l3dview,[float scale,bias])
  returns: ([float scale,bias])
  returns or sets the polygonoffset values..
rcmdadd (l3dview,rcmd,[rcmd ref,int occurance,boolean before])
  returns: (boolean success)
  adds the rcmd to the rcmd queue list of this l3dview. You can add a maximum of 255 rcmds. They are processed in the order they are added. If there are no commands, the l3dview will do nothing cept debug drawing. As long as rcmd is assigned it won't be garbagecollected.
  You can insert after a another rcmd, which is searched in the list. When occurance is negative we will search the rcmd from the back first. An absolute value of 1 will be first occurance, 2 second and so on. 0 or passing no occurance value is same as +1. If before is true we will insert before the given rcmd (default is false).
rcmdempty (l3dview)
  returns: ()
  empties the rcmd list of this l3dview.
rcmdflag (l3dview,int id,[boolean])
  returns: ([boolean])
  sets rcmd process bit flag. If rcmdflag of view AND the own flag bitwise return true, then the rcmd will be processed. id = 0..31
rcmdremove (l3dview,rcmd,[int occurance])
  returns: (boolean success)
  removes the rcmd from the list. Occurance value treated as in rcmdadd.
usepolygonoffset (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if depth values are changed depending on slope and constant factors when depth testing occurs.
viewpos (l3dview,[int x,y])
  returns: ([int x,y])
  returns or sets the viewport starting position in pixels. 0,0 is bottom left, which is not as in list2d. only used when windowsized is false
viewrefbounds (l3dview,[float refx,refy,refwidth,refheight])
  returns: ([float refx,refy,refwidth,refheight])
  returns or sets the viewport size and position in reference coordinates. only used when windowsized is false. Warning: viewsize must always be smaller than current window refsize.
viewsize (l3dview,[int width,height])
  returns: ([int width,height])
  returns or sets the viewport size in pixels. only used when windowsized is false. Warning: viewsize must always be smaller than current window resolution (unless FBO rendering is used).
windowsized (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if the viewport should use the full window size.

## Inherited Methods:

### From l3dlist