Commit Graph
50 Commits
Author SHA1 Message Date
Vasily 3857c2ac2f Refactor update rates of tab controllers
Previous way of controlling when controllers were run was split among
the different controllers, meaning that third parties would require
knowledge of internal state of controllers in order to be on the same
update schedule as them.

This refactor moves the logic into a seperate class.

Additionally, it also stops the use of the `adjustUpdateRate` function
on all tab controllers, since it broke the prime-number-ability of
less collisions.
2020-06-06 20:53:34 +02:00
Vasily 4757756d32 Refactor alarm system and replace notification method
The old OpenVR overlays did not function for unknown reasons, and it was
not possible to get them to work.

With this a white overlay with ALARM ACTIVATED will be shown for 3 seconds.
It's not pretty, but it effectively communicates that an alarm has been
activated.

This fixes
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/417
2020-06-05 20:52:13 +02:00
ykearaandVasily a803ffaeac Center Marker/ Chaperone Refactor/ IVROverlay/IVRSettings wrappers PT 1/? (#438)
* changed click noises to internal sounds

* udpated to ovr 1.11.11

* in prog added prototypes

* began wrapper for IVRSettings

* added getters for chaperone colors

* added setters for chaperone color

* fixed type conversion issue

* fixed linking issue, added additional settings chaperone page

* adjusted chaperone page qml

* added color chaperone UI

* refactor in prog

* updated ivrsettings wrapper, refactor in prog

* refactor in prog

* collision bound style add

* refactor

* cleaned up error logging

* fixed fade distance remember bug

* fixed sounds

* fixed brightness opacity bug setting to 0 when 0

* fixed sounds

* added wrapper for removing keys

* refactored reset

* added chaperone Styles to UI

* added chaperone floor always on

* fixed copy/paste error

* adjsuted ui chaperone color slider

* started adding chaperone floor marker

* fixeed naming error overlay

* finalized chaperone Ideas, added chaperone markers

* began ivroverlay wrapper

* center marker fully implemented

* added function prototypes for new settings

* added setting, and updated ui for New Center Marker Overlay

* adjsuted sound effect volume and formatting for chaperonecolorbox

* adjusted volume back

* fixed various issues aroudn new overlay

* removed artifact comment

* cleaned up settings wrapper

* cleaned up chaperone tab controller for namespace changes

* removed ide comment issue

* cleanup overlay wrapper

* cleaned up tab/space changed file name

* renamed files

* fixed include statements

* updated namespace in chaperonetabcontroller

* fixed tab/space issues

* re-activated boundbasisheight

* fixed bulgarian case

* changed chaperone warnings to only work in roomscale

* fix capitilization

* fixed tracking universe update

* direct text input change for brightness

* qml fixes

* fixed qml format issues

* fixed sound issue w/ sliders

* fixed super truely

* Add SDL libraries to CircleCI

* Remove -tidy from circleCI config

* flushed out error messages in overlaywrapper

* removed hungarian notation

* added get/set string to ovrsettings wrapper

* misc cleanup

* add reset orientation btn and new center marker to chaperone

* ui adjustments

* changed alarm audio

* adjusted sound effect volume slightly lower

* updated for 5.1.0 release

Co-authored-by: Vasily <vautkin@teknik.io>
2020-05-13 15:11:20 -05:00
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 bb30a7c041 Add framework for implementing Linux AudioManager
Source outputs must all be moved to new default source.
Reference topic
https://askubuntu.com/a/72076

* Adds microphone controls on Linux via PulseAudio (PA) for several
points in
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/43.

It can not be overstated how unsuited the public AudioManager API is for
using the PA API.

It can also not be overstated how undocumented and horrible the PA API
is. The PA way of doing audio is very unlike the Windows way of doing
audio, which the AudioManager is heavily influenced by.

Since I don't have a Linux machine I have not been able to personally
test this. https://github.com/feilen/ has graciously helped with
testing.

PulseAudio is very undocumented and not very widely used for what we
need outside of official utilities. As such there's most likely a better
way of doing things than I've done.
Additional information can be found at
https://github.com/username223/pulseaudio-device-changing.

The "complex" PA API is asynchronous. Since our current AudioManager is
running synchronously and would not work asynchronously (functions are
expected to return valid data on function return) it is necessary to
massage the PA API until it runs synchronously.

This is done with a general workflow of

1. Register a callback function (`pa_context_get_source_info_list()`,
        for example).
2. Run the PA loop through `customPulseLoop()`. This will trigger
any registered callbacks. Sometimes a `void*` is passed through the
callback that can be used for custom data. `successCallback()` uses
this to set the success variable.
3. Run the callback function and do required work.
4. Return to original function, do work or return values.

It is not possible to run a `customPulseLoop()` inside of an already
running loop (inside a callback), as this will lead to a PA assert
error on runtime.
2020-04-08 22:44:12 +02:00
Vasily af572ee0b7 Move AudioManager into audiomanager folder 2020-01-18 00:17:28 +01:00
Vasily 7be55a2199 Move remaining PttController items into AudioTabController 2020-01-16 00:09:09 +01:00
Vasily 0bc77b2fd0 Completely remove features related to Desktop Overlay
As of SteamVR 1.10.1 the overlay width feature has been implemented by
Valve in the standard settings.
OpenVR features related to overlay translation have been removed and the
main reason for including them (multi monitor setups) have been solved
by Valve giving each screen an individual overlay.
2020-01-16 00:09:09 +01:00
Vasily e71bc7b1b3 Add settings object API
Documentation is in `docs/specs/Settings-Object-API.md`.
2020-01-08 21:18:45 +01:00
Vasily c2dff4c863 Move internal settings headers into /internal/ dir
The additional headers are not intended to be public. To reinforce that
it is a bad idea to include these they are put into the /internal/
directory.
2019-12-10 08:28:41 +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
Vasily 2a935895e9 Update Linux build docs for Arch/Ubuntu, add logging calls to Qmake
The page was not made with Arch in mind.

The currently required were tested on Manjaro, more packages may be
explicitly required due to the bare-bones nature of Arch.

Adds simple logging calls makes debugging easier.

The initial build script was basically ported over directly from
Windows. It was written because I at the time didn't understand
compiling on Linux, and the existing standards, very well.

Moving as many build components into a program specifically made for
building C++ makes everything much easier.

The old build script is still used on CI where control flow can only be
changed using environment variables.

`bear` and `clang-format` are only used on the CI, there's no reason to
include them here.
2019-08-23 15:12:58 +02:00
ykeara 746aa23207 Ssbugs, removal of re-vive, and dashboard loop tick (#277)
* minor changes

* debugging testing

* removed un-needed log calls

* moved some logic to run only when dashboard is active

* fixed linker error

* added casting

* removed revive tab

* removed stray revive reference

* removed revive from sources

* fixed misc formatting issues

* added newline
2019-08-22 13:40:48 -05:00
Vasily f958026453 Add DBUS support for media keys 2019-06-05 19:57:44 +02:00
Vasily ef124ee225 Add dummy media_keys file
This allows Linux (and MacOS) to compile correctly again. The previous
behavior was an intended middle step.
2019-05-25 18:49:42 +02:00
Vasily 9fe1f3dc50 Separate media keys from keyboard shortcuts
The media keys were only in the keyboard shortcuts file because their
implementation was the same. With Linux support incoming their
implementations are not necessarily the same.
2019-05-25 18:49:42 +02:00
Vasily 55a3830787 Fix keyboard input implementation error and replace old system 2019-05-25 18:49:42 +02:00
Vasily 6a3a58361d Add Linux keyboard_input support 2019-05-25 18:49:42 +02:00
Vasily 0c7c339e3e Add sending inputs for keyboard_input on Windows 2019-05-25 18:49:42 +02:00
Vasily d6c7b52a47 Add initial keyboard_input parser and tests
The current implementation SEGFAULTs when F characters are followed by
end of string.
2019-05-25 18:49:42 +02:00
Vasily 4ec1fbf201 Add noX11 flag to Linux compilations
This allows users that are not using X11 to still compile the
application.
2019-04-22 09:56:50 +02:00
Vasily d139c34a67 Give clang/gcc explicit path to third-party libs
Qt Creator on Linux does not recognize the previous solution. Adding the
$$PWD makes the IDE work.
2019-04-22 09:56:50 +02:00
Vasily bdf66a658b Make Linux look in current folder for OpenVR lib 2019-04-22 09:56:50 +02:00
Vasily 30ef80d19c Update X11 package on Travis, clarify qt build specs
macx is also unix, apparently meaning it's necessary to distinguish
between the two.
2019-04-22 09:56:50 +02:00
Vasily 860eca1956 Add compiling on Ubuntu for X11 funcs 2019-04-22 09:56:50 +02:00
Vasily b5d63c8166 Update required Qt version to 5.12
On Ubuntu 16.04 and 18.04 it is not possible to get Qt 5.12 from the
official repo. You will need to get it from
https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.12.2-bionic
which places the files in /opt. This leads qmake to including the files
as non system headers, which makes them spam errors. Adding them as
-isystem headers first prevents this.
2019-04-17 20:51:34 +02:00
Vasily a631aefb05 Update whitespace in .pro file 2019-04-17 20:51:34 +02:00
ykeara 9de14e20cb merged master to brightness 2019-04-12 18:25:14 -05:00
ykeara 17b31734be fixed c++ errors 2019-04-11 19:50:12 -05:00
Vasily b53ebb699f Remove version specific header files for KeyboardInput
The headers were identical after no longer using the abstract class for
platform independence.
2019-04-04 14:01:11 +02:00
Vasily e7df60311c Convert keyboardinput from class to regular header
No consistent state is needed so it doesn't make sense for it to be a
class.
2019-04-04 14:01:11 +02:00
Vasily 82d44b4ab5 Move KeyboardInput file into keyboardinput folder 2019-04-04 14:01:11 +02:00
Vasily 760d262a57 Add page to change desktop overlay translation
The implementation is simple 3D vector scaling and addition. The
HmdMatrix34_t consists of a 3x3 rotation matrix and a 3D vector for
position.

The overlay position is only updated whenever a new overlay is changed
because we need the old overlay position in order to modify it. The
openvr call to get the position is only updated whenever you open the
menu.

A new page was created due to lack of space on the utilities page.
2019-03-31 22:31:26 +02: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 a70fade089 Create DigitalAction and AnalogAction types
This errors at compile time if the wrong action is being used, instead
of at runtime.
2019-03-16 14:07:26 +01:00
ykeara 3c5cab72e5 Chaperone Tab Update (#101)
* added actions for haptics

* Haptic WIP #1 crash on haptic event

* haptics rough implemented

* fixed action names and prox sensor work-around

* added workaround to catch-all in begineer chaperone switch

* added idle work-around to alarm warning

* changed visibility slider values to reflect new API limits

* added disable chaperone

* added display Logic

* fixed visibility slider display and some saving fade distance when chaperone disabled

* fixed warnings not always working (hopefully) centralized action/input keys into ivrinput.h

* default bindings for HMD's

* chaperone input re-factor

* refactored ivrinput class

* fixed naming errors commented out prox testing

* formatting removed commented code

* format

* fixed compiler warnings

* updated documentation

* Reduced reload chaperone calls

* adjusted haptics for chaperone bounds warnings
2019-03-15 15:19:23 -05: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 dd5ae97b62 Move ivrinput into openvr folder
Doesn't make sense for it to have it's own folder when there's an openvr
folder now.
2019-03-10 23:12:26 +01:00
Vasily 09251b04aa Move openvr_into openvr folder 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
Vasily 34204d2441 Add -Wnon-virtual-dtor and resolve issues
The IPolicyConfig file is a third party file and since it describes a
third party API we can't make changes to it. Adding it via the system
includes disables warnings on most compilers.
2019-02-21 18:48:53 +01:00
Vasily 5c70aba098 Revert easylogging++ include and attempt changing easylogging++.cc 2019-02-21 18:48:53 +01:00
Vasily 940ad48923 Attempt -i switch in order to ignore warnings in file 2019-02-21 18:48:53 +01:00
Vasily 9019270df8 Refine compiler system includes for different platforms
MSVC seems to be the only platform that doesn't have a non-experimental
way to include files that don't give warnings.
2019-02-21 18:48:53 +01:00
Vasily 1b6cc47238 Add .. to linux include paths 2019-02-21 18:48:53 +01:00
Vasily 4ed6e80645 Include third party headers system headers for clang/g++ 2019-02-21 18:48:53 +01:00
Vasily ab25124d7b Move source files and resources file into separate .pri files 2019-02-21 18:48:53 +01:00