'use strict' module.exports = createViewController var createTurntable = require('turntable-camera-controller') var createOrbit = require('orbit-camera-controller') var createMatrix = require('matrix-camera-controller') function ViewController(controllers, mode) { this._controllerNames = Object.keys(controllers) this._controllerList = this._controllerNames.map(function(n) { return controllers[n] }) this._mode = mode this._active = controllers[mode] if(!this._active) { this._mode = 'turntable' this._active = controllers.turntable } this.modes = this._controllerNames this.computedMatrix = this._active.computedMatrix this.computedEye = this._active.computedEye this.computedUp = this._active.computedUp this.computedCenter = this._active.computedCenter this.computedRadius = this._active.computedRadius } var proto = ViewController.prototype var COMMON_METHODS = [ ['flush', 1], ['idle', 1], ['lookAt', 4], ['rotate', 4], ['pan', 4], ['translate', 4], ['setMatrix', 2], ['setDistanceLimits', 2], ['setDistance', 2] ] COMMON_METHODS.forEach(function(method) { var name = method[0] var argNames = [] for(var i=0; i