Commit Graph
51 Commits
Author SHA1 Message Date
1ae740463c Implement Auto-turn and Redirected Walking
Initial implementation of Auto-Turn

Auto-turn leverages Space Turn automatically whenever you reach a configured distance from your chaperone boundary. Turn direction is in order of precedence:

1. Away from a corner where you're already touching one wall. This is to avoid being turned to face a wall, which we pretty much never want. If 'use corner angle' is enabled, it'll turn the angle of the corner, otherwise it'll turn the angle of your headset to the wall you encountered.
2. In whichever direction will start you unwinding your cord. If your rotations is greater than 'cord detangling rotations' and your angle to the wall is less than 'min detangling angle' it'll turn you such that the thing you're walking towards is directly along a wall, in the direction which will begin unwinding your cord.
3. In the closest angle to the wall. This too will put whatever you're walking towards directly along a wall, so you can walk the maximum distance to it. 
- If Smooth turn is checked, it'll turn at a constant (configurable) rate until the world is aligned with the new angle, otherwise it'll snap to the new direction instantly. 
- Activation distance is the distance from your chaperone at which auto-turn starts, and deactivation distance is the minimum distance (+ the activation distance) at which it'll be able to be activated again, to avoid turning twice at once.


Redirected walking tries to gently guide you away from your playspace boundaries by tweaking the world's angle at smaller increments than your brain is capable of noticing. While most playspaces won't be big enough to allow this to give you a true 'infinite walk' experience, it can give the perception of your playspace being ever so slightly bigger by making you walk in a slight arc in real life while walking forward in VR.
- Redirected walking is independent from Auto-turn and can be activated on its own. At both the 'slight' and 'imperceptable' radii, the turning speed is incredibly minimal. When walking along one wall of your chaperone to another, you should notice the far corner of your playspace (relative to the world) drifting ever so slightly away from you. In normal circumstances at the lowest settings this shouldn't be noticable. 


Co-authored-by: feilen <feilen1000@gmail.com>

* Initial implementation of Infinite Walk

* Code cleanup and abstraction, use nearest corner instead of nearest wall to determine turn direction

* Run clang-format

* Turn relative to the last wall if we run into adjacent walls, otherwise turn at easiest angle

* Limit maximum turns (just refuse to turn for now), only turn on shared corners if going the same direction

* Improve same-corner

* get rid of LastDirectionLeft

* WIP: cord untangling hint

* Try to automatically untangle cord, don't rotate if we encounter a wall behind us

* Incorrect offset for walls

* optimize if hmd inactive

* Cleanup/clarify angles

* (probably?) solve rare segfault

* Adjust the defaults and fix a bug with blocking reverse turns

* Implement smooth turn, fix a bug with shared-corners that would cause it to turn the wrong way

* actually really fix shared corner bug

vect[i + 1 % vect.size()] was somehow evaluating to vect[i + (1 %
vect.size())]

* Move configurables for autoturn to .h to make clearer what's configurable

* WIP: true redirected walking

* First pass optimization/cleanup

* Second pass cleanup/optimize

* Missing clang-format

* Somewhat ugly: Optionally turn the exact angle of the corner when using shared corner turns

* added rotation tab controller in progress

* cleaned up chaperone controller/ finished settings/rotationtab

* did first 4 settings qml, and main qml setup

* initial working build, not all settings UI done

* merging master into redirected walking. (#387)

* Update OVR to 1.10.30 (#379)

* updated to ovr 1.10.30

* fixed updated showoverlaykeyboard call

* fixed keyboard location

* Updated Manifest (#380)

* updated to ovr 1.10.30

* fixed updated showoverlaykeyboard call

* fixed keyboard location

* removed un-necessary matrix, updated app key and manifest

* fixed formatting

* Fix push to mute icon not being used when PTM enabled

* added touch default bindings (#385)

travis CI down/broken?

Co-authored-by: Vasily <vautkin@teknik.io>

* added action, and additional settings

* fixed various bugs added turn speed and mode

* fixed conversion error for turn speed

* added redirected walking options

* formatting

* formatting fixing

* removed old comments

* changed logs to debug and some wording changes

* changed UI layout

* added space turn to rotation page

* added icon, fixed autoturn to autoTurn, fixed conversion to be in qml vs set

* Update src/res/qml/RootPage.qml

yep XD

Co-Authored-By: Kung-vr <38249782+Kung-vr@users.noreply.github.com>

* reverted build changes

* removed un-needed app image build commands

* Cleanup some functions, avoid an extra chaperone check.

* Make redirected walking and autoturn independently enable-able

Co-authored-by: Feilen <feilen1000@gmail.com>
Co-authored-by: Vasily <vautkin@teknik.io>
Co-authored-by: Kung-vr <38249782+Kung-vr@users.noreply.github.com>
2020-04-08 18:57:53 -07:00
Vasily 0c7c888c82 Update OpenVR from 1.8.19 -> 1.9.16 and remove Sync() calls
Release log:
https://github.com/ValveSoftware/openvr/releases/tag/v1.9.16
```
Removed sync function. Saving of settings is controlled automatically by
the system now. All existing calls to Sync can be deleted. Calls to sync
using old APIs do nothing.
```
2020-01-18 00:17:28 +01:00
Vasily 016e5ebc4a Add switch for enabling debug symbols and logs
Enabling the switch on release builds will optimize the binaries as
normal, but will still include debug symbols. This is advantageous for
bugs that do not show up in debug builds without optimizations.
2020-01-15 14:01:47 +01:00
Vasily f1105d15a3 Remove unused QSettings imports 2020-01-08 21:18:45 +01:00
Vasily c1690056cc Add settings API and specification
The details of the API are in the `/docs/specsSettings-API.md` file.

The enums do not list all available settings, more are to be added as
the settings API replaces inline QSettings calls.
2019-12-03 08:26:10 +01:00
ykeara 05c12cd4a0 Re-Add color overlay (#311)
* fixed Chaperone toggle, toggle state on launch

* made update rates based on variable frame rate assuming 90 default

* added overlay color back in

* fixed opacity value not synching

* updated to ovr 1.8.19

* fixed license issue

* rolled back ovr update

* fixed overlay toggle state, formatting, and clamped max opacity to .85%
2019-11-08 14:45:26 -06:00
ykeara 263759a0df Color overlay adjustment feature (#208)
* perf graph overlay/checkbox added

* added toggle Chaperone action

* toggle chaperone non-functional

* fixed chaperone toggle action const to once

* Added Proximity Sensor Action back-end, not implemented via logic Until fixed by valve

* added default WMR controller profile

* formated

* formated steamvrtabcontroller.h

* fixed un-intended change

* fixed audio profile Bug w/ changed devices

* fixed name being used as param instead of ID

* fixed loop logic in saveAudioProfile

* audio profile fix WIP defaults OVR integration

* fixed profile Saves, delete logic and mirror logic needed

* fixed QML format, added TODO message

* Fixed Audio Profile Behavior

* fixed qml reference error

* audiodeviceselector changed qml

* Removed some comments

* changed Visibility slider Minimum to 30% (steamVR minimum allowed)

* fixed mirror/playback same issue

* fixed Audio device refresh bug, removed currently un-used proximity logic (commented out)

* removed dead code

* fixed Manifest install/un-install behavior

* removed un-used param

* color overlay in prog

* video overlay basic functions added

* fixed qml errors

* fixed init order error and chaperone min init error

* fixed duplicate button id issue, init issue

* fixed log call w/ manifest

* removed commented log lines
2019-06-01 11:02:55 -05:00
ykeara 511b189efd Fixed Manifest Behavor (#199)
* fixed Manifest install/un-install behavior

* removed un-used param

* fixed double or in log msg
2019-05-18 12:00:32 -05:00
Vasily 387ae30899 Fix indentation with clang-format 8
AppVeyor automatically updated to LLVM 8 while everything else was on 7.
It is not possible to downgrade to LLVM 7 on AppVeyor, so we'll update
everything else to LLVM 8.
2019-04-19 15:29:18 +02:00
Kung-vr b32d621994 Implement Seated Universe and Raw (Room Setup) Universe Support (#150)
* Add checks for seated improve shutdown state

Seated mode chaperone update is still broken. Normal standing mode space motion needs testing on WMR and Rift

* Fix updating chaperone on room setup completion

* Implement seated universe recenter/offsets/motion

Addresses #145

* Add Option "Allow External App Chaperone Edits"

This option is added to the settings tab. It allows external apps to modify the chaperone but only if the current offset is 0,0,0 and rotation is 0. The option is disabled by default.
2019-04-12 13:46:06 -05:00
Vasily 2e42773529 Add special message to Qt handler
This makes it more obvious where an error came from.
2019-03-31 14:19:05 +02:00
Vasily 96513c6d07 Fix null pointer dereference in QtMessageHandler function
The `QMessageLogContext` is only filled out in debug builds. Release
builds will have null pointers in `file` and `line`. This causes any
error attempted to be logged to result in a null pointer dereference.

Since we never use debug builds anyway, simply removing the uses of
`file` and `line` makes sense.

Github issue
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/139
2019-03-31 14:19:05 +02:00
username223 86fdc8f26f Refactor actions into separate action sets (#122)
* Fix indentation in action manifest

* Rename action sets to drop unnecessary prefix notation

Since the variable is in the action_sets namespace it does not make
sense to prepend it with an identifier for it being constant, or a set.

* Rename input keys to drop prefix notation

The vars are in a namespace that only contains constant inputs, it
doesn't make sense to prepend it to every var.

* Rename actions to drop prefixes

It is implicit that actions are const values for sets, therefore the
prefix is not needed.

* Remove unneeded action set member func

* Move active action set in preparation for more action sets

* Move action strings above class

Class is not able to use variables in namespaces, which is stupid.

* Move sets into member variable

* Split music into separate action set

* Convert action_manifest.json to spaces only

* Refactor actions into separate action sets

* Rename main set to haptic

* Reorder action sets

The haptics and misc sets are misc bindings.

* format

* fixed manifest path issue

* Change path concat to use QDir

The old way was not platform independent.

* Move accessibility actions to motion set

* Remove "(Held)" from action name

Might be confusing for end users.

* Replace slash with platform independent separator

* Make paths output native paths
2019-03-20 15:42:45 -05:00
Vasily 97776b5776 Change binary dir to be binary dir for all OS
Linux did not see AppDataLocation as the binary directory, but as an
arbitrary dir in the home folder.
2019-03-19 16:10:35 +01:00
Vasily 04c59d5f20 Convert setup to new paths 2019-03-19 16:10:35 +01:00
Vasily e1866e635f Convert logfile to use new paths functions 2019-03-19 16:10:35 +01:00
Vasily d654567d98 Convert to new paths system 2019-03-19 16:10:35 +01:00
Vasily 62dcea6943 Replace dedicated functions with single binary function
There are only 1 or 2 calls to specific directories in the codebase,
hence this is unnecessary and just leads to bloat.
2019-03-19 16:10:35 +01:00
Vasily d6660049e9 Implement prototype Qml path function 2019-03-19 16:10:35 +01:00
Vasily 1d05ae96f9 Implement prototype paths in manifest class 2019-03-19 16:10:35 +01:00
Vasily ac4a124450 Add prototype for binary directory functions 2019-03-19 16:10:35 +01:00
Vasily b770d869ae Add initial planning for paths API
The idea is to reduce manual string directories in the general code as
much as possible, in order to reduce typos and general weirdness.
2019-03-19 16:10:35 +01:00
Vasily e04a9355ea Move log and settings file to APPDATA/AdvancedSettings-Team
Keeping the logfile in a separate folder did not make sense.
2019-03-11 11:44:14 +01:00
Vasily 783e8093bd Refactor logfile name to be variable 2019-03-11 11:33:48 +01:00
Vasily 2d6d482f2d Refactor log file location to use application strings 2019-03-11 11:32:44 +01:00
Vasily 5b9e94869c Move application strings into separate namespace
Them being in the overlay controller required them to be static, which
forces the compiler to give them a memory location at compile time. They
also don't really fit into the overlaycontroller.
2019-03-11 11:24:57 +01:00
Vasily d078bd88a4 Move definitions from header file to cpp file
Clang-tidy does not like definitions in header files unless they're
inline.
2019-03-10 23:12:26 +01:00
Vasily 0bb22090ba Replace easylogging parsing from string to explicit calls
This makes sure that there are no typos in the string. And prevents the
few bytes of string from being included in the final binary.
2019-03-10 23:12:26 +01:00
Vasily ef223b90a1 Remove end user changing logging settings
Fixes
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/63

Removes the ability for end users to change logging settings. This was
deemed unnecessary because logging is a developer troubleshooting tool
and users being able to change it could almost only introduce problems.

People who want to change the logging settings can compile from source.
2019-03-10 23:12:26 +01:00
Vasily 09251b04aa Move openvr_into openvr folder 2019-03-10 23:12:26 +01:00
Vasily 293ca21af5 Convert openvr_init from class to function
Since the OpenVR initialization code is no longer inside the
overlaycontroller there is no need for it to be available during object
construction. Therefore it doesn't make sense to have it be an object.

The shutdown call was completely removed because shutdowns are handled
by an OpenVR event that calls the relevant shutdown code. The destructor
for the old object was never called, removing it adds clarity to the
actual operation of the code and also removes unnecessary code.
2019-03-10 23:12:26 +01:00
Vasily 37e0366e9d Move OpenVR init function out of Overlaycontroller
This prevents the issue of OpenVR not being initialized in constructors
of other objects, and there's really no reason not to do it.
2019-03-10 23:12:26 +01:00
Vasily 9f24099a93 Update documentation for new command line arguments 2019-03-10 23:12:26 +01:00
Vasily 45bb199a0d Replace arg parsing function with Qt built ins
This automatically provides version and help functions, and offloads the
arg parsing to a third party lib.
2019-03-10 23:12:26 +01:00
Vasily 5d2901be33 Remove option forcing bindings to show up in SteamVR
Overlay applications show up in the bindings menu after SteamVR beta
1.3.1, making these features unnecessary.
2019-03-10 23:12:26 +01:00
Vasily 84be2090c8 Move setup code in main to separate file
This makes it easier to find the entry point for the program and also
moves a lot of implementation out of the main.cpp file.
2019-03-10 23:12:26 +01:00
Kung-vr 884343783c Move quaternion functions to quaternion namespace 2019-03-04 01:39:33 +09:00
Kung-vr 0f2f956b2e Manual Merge Cleanup 2019-03-03 01:02:53 +09:00
Kung-vr 3792488372 Merge branch 'master' into alpha-kung 2019-03-03 00:27:35 +09:00
Vasily bc8ab72363 Fix clang -Wdouble-promotion cast 2019-02-21 18:48:53 +01:00
Vasily 60b9f71b9a Fix gcc -Wdouble-promotion warnings
For some reason GCC uses the float version of sqrt even though all
arguments and results are floats.
2019-02-21 18:48:53 +01:00
Vasily 8444a4972b Attempt different fix for clang -Wdouble-promotion 2019-02-21 18:48:53 +01:00
Vasily 88dad1087f Fix clang -Wdouble-promotion issues 2019-02-21 18:48:53 +01:00
Vitaly acb666a142 Remove old style casts and enable warnings for them 2019-02-21 18:48:53 +01:00
Kung-vr 5832eea951 Create quaternion.h to centralize quaternion math 2019-02-02 22:36:19 +09:00
Kung-vr 47920bfa74 Fix gimbal-lock when controller pointed up or down
Compare old and new pose via a relative quaternion rather than relative yaw, then calculate the resulting yaw-difference from the quaternion in one go.
2019-01-17 02:32:08 +09:00
Vasily 51057c1d79 Format every single file using .clang-format 2018-12-28 03:06:42 +01:00
Robin Appelman f383fe081e switch to cmath and std::isnan 2018-12-26 02:09:50 +01:00
Robin Appelman 20853df594 fix building under linux 2018-11-09 00:07:32 +01:00
matzman f48b583aca Reimplemented sound effects.
Added chaperone proximity warnings.
Other bugfixes and improvements.
2017-08-15 21:44:29 +02:00