mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Update of touch table interface code (#561)
* Version of touch interface for user study that has disabled panning and limited zoom to prevent zooming through the planet surface * Update starlabels.data file * Enable minimum picking distance in NDC * Fix stack corruption bug in TouchMarker * Version of touch interface for user study that has disabled panning and limited zoom to prevent zooming through the planet surface * Fix stack corruption bug in TouchMarker * Add time limit to levmarq solver * Add debug properties to touch GUI with a compile time flag * Guard against accessing outside bounds * Added exponential zoom for faster zoom with increased distance from focus node * Refined the exponential zoom for better behavior on the touch table * Added properties for disabling panning and node boundary sphere multiplier for zoom * Added more debug logging and stopped using camera focusNode (looks deprecated) for distance calculation * Found error in the deceleration algorithm * Default-disable debug logging, exponential zoom coeff change and additional debug log statement
This commit is contained in:
committed by
Alexander Bock
parent
9a44d9c9df
commit
5380636932
@@ -23,10 +23,14 @@ OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <chrono>
|
||||
#include <modules/touch/ext/levmarq.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
|
||||
#define TOL 1e-30 // smallest value allowed in cholesky_decomp()
|
||||
|
||||
namespace {
|
||||
std::chrono::milliseconds TimeLimit(200);
|
||||
double TOL = 1e-30; // smallest value allowed in cholesky_decomp()
|
||||
}
|
||||
|
||||
// set parameters required by levmarq() to default values
|
||||
void levmarq_init(LMstat *lmstat) {
|
||||
@@ -120,8 +124,19 @@ bool levmarq(int npar, double *par, int ny, double *dysq,
|
||||
lmstat->pos.clear();
|
||||
err = error_func(par, ny, dysq, func, fdata, lmstat);
|
||||
|
||||
std::chrono::system_clock::time_point start =
|
||||
std::chrono::system_clock::now();
|
||||
|
||||
// main iteration
|
||||
for (it = 0; it < nit; it++) {
|
||||
std::chrono::system_clock::time_point now =
|
||||
std::chrono::system_clock::now();
|
||||
|
||||
if (now - start > TimeLimit) {
|
||||
LDEBUGC("Touch Levmarq", "Bail out due to time limit!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// calculate the approximation to the Hessian and the "derivative" d
|
||||
for (i = 0; i < npar; i++) {
|
||||
d[i] = 0;
|
||||
|
||||
Reference in New Issue
Block a user