(name)
| 1 | class ControlMethod { |
| 2 | constructor(name) { |
| 3 | this.name = name; |
| 4 | |
| 5 | // used for reference observer pose. |
| 6 | this.vp = new THREE.Vector3(0, 0, 0); // observer view point |
| 7 | this.th = 0; |
| 8 | this.ph = -Math.PI / 2; |
| 9 | this.ps = 0; |
| 10 | this.dist = 1 * GLOBAL_SCALE; |
| 11 | |
| 12 | this.baseTh = 0; |
| 13 | this.basePh = 0; |
| 14 | |
| 15 | // current frame variables |
| 16 | this.frameEye = new THREE.Vector3(1, 0, 0); |
| 17 | this.frameCenter = new THREE.Vector3(); |
| 18 | |
| 19 | // update call backs |
| 20 | this.updateCallback = undefined; |
| 21 | |
| 22 | this.referenceRot = new THREE.Vector3(); |
| 23 | this.referenceVp = new THREE.Vector3(); |
| 24 | this.referenceDist = 20; |
| 25 | |
| 26 | // constants |
| 27 | this.SENSI_ROT = 0.01; // Sensitivity of rotation. |
| 28 | this.SENSI_MOVE = 0.4; // Sensitivity of translation |
| 29 | this.SENSI_ZOOM = 180; // Sensitivity of Zooming. |
| 30 | |
| 31 | } |
| 32 | setUpdateCallback(func) { |
| 33 | this.updateCallback = func; |
| 34 | } |
nothing calls this directly
no outgoing calls
no test coverage detected