# Class: CameraCtrl

### LuxModule: luxinialuacore

The CameraCtrl virtual class is a helper class for camera manipulation in editors and alike. Various implementations exist. The attrib array is currently as follows (values used depending on implementation):

1. shiftmulti: float - speed multiplier when keys.fast is pressed
2. movemulti: float - movement multiplier
3. rotmulti: float - rotation multiplier
4. invert: bool - mouse inverted (up/down)
5. mousesense: float - multiplied on all mouse deltas
6. mousewheel: float - multiplied on all wheel deltas
7. fix: boolean - whether mouse position is fixed to action start (default true)
8. keys: table - each value can be a string/keycode or table of such.
   - forward
   - backward
   - left
   - right
   - up
   - down
   - fast

## Hierarchy

    o-+ CameraCtrl
      o-- CameraEgoMCtrl
      o-- CameraEgoMKCtrl

## Methods:

### Method overview:

- addListener
- createML
- new
- removeListener
- reset
- runListeners
- runThink

new (table class, l3dcamera, actornode, table attribs)
  returns: (CameraCtrl)
  creates the controller.
addListener (CameraCtrl,fn)
  returns: ()
  registers a function to be called fn(l3dcamera,actornode) on changes
createML (CameraCtrl, [Component])
  returns: (MouseListener)
  creates a mouselistener based on input. Pass the host component, to get drag for action behavior. Or pass no host and assign to the MouseCursor itself, and the mouse position will be fixed at center of screen and always firing (same when MouseCursor is disabled).
removeListener (CameraCtrl,fn)
  returns: ()
  unregisters the function.
reset (CameraCtrl)
  returns: ()
  Resets internal caches of mouse movement and alike.
runListeners (CameraCtrl,fn)
  returns: ()
  enforces call of all listeners.
runThink (CameraCtrl)
  returns: ()
  The think performs the actual manipulation of the l3dcamera and its actornode and calls the registered listeners. It polls the keyboard and processes the batched mouse move events.