Commit graph

949 commits

Author SHA1 Message Date
Anthony J. Thibault
960ffd9c9e DisplayPlugins: updateHeadPose() no longer returns a value.
Also, moved updateHeadPose so that the overlay and the main rendering use the same headPose.
Which should also be the same place the latencyMarker for the ovr_GetTrackingState is set.
2016-03-18 15:16:58 -07:00
Anthony J. Thibault
2faaf243a1 Revert change to OpenVrDisplayPlugin::isSupported() 2016-03-18 13:42:31 -07:00
Anthony J. Thibault
d218ca4960 openvr: fix for crash on exit
Before this fix, a script could call into HMD.getHUDLookAtPosition2D() while the app was shutting down, which in turn would call
getHeadPose() on the currently active display plugin.  This call could cause a crash within the openvr plugin, because the SDK was either shutdown, or in the process of shutting down on the main thread.

This fixes this by spliting the previous DisplayPlugin::getHeadPose(int) into two parts:

* updateHeadPose(int) which is only called once a frame and only by the main thread.
* getHeadPose() which is thread-safe and will return a cached copy of the hmd pose sampled by the last updateHeadPose.
2016-03-18 12:26:11 -07:00
Bradley Austin Davis
cde56d6fa2 Disable OpenVR plugin when Oculus HMD is connected 2016-03-17 10:13:52 -07:00
Bradley Austin Davis
25c8a3a0f3 Fixing legacy plugin 2016-03-17 10:13:52 -07:00
Bradley Austin Davis
b279ff9f7d Fix for crash on disabling and re-enabling openvr 2016-03-17 10:13:52 -07:00
Bradley Austin Davis
7045680bc7 Reduce crashes on switching display plugins 2016-03-17 10:13:52 -07:00
Bradley Austin Davis
384351067e Don't crash when the Rift is turned off 2016-03-16 20:16:28 -07:00
Brad Hefta-Gaub
9e0d9f5748 Merge pull request #7337 from sethalves/disable-oculus-legacy-on-linux
don't build oculus-legacy plugin on Linux
2016-03-13 12:26:37 -07:00
Brad Davis
27033e5bb5 Fix vive crash on deactivate 2016-03-12 21:48:36 -08:00
Seth Alves
d036e0618d don't build oculus-legacy plugin on linux 2016-03-12 07:54:59 -08:00
Chris Collins
ae596d79f1 Merge pull request #7317 from jherico/hmd_worn
Expose a property in display plugins to determine if the device is visible to the user
2016-03-11 11:46:06 -08:00
Philip Rosedale
e87ef52a4c Merge pull request #7302 from hyperlogic/tony/wrong-way-overlay
More reliable and usable UI sphere overlay location
2016-03-10 17:43:50 -08:00
Brad Davis
87c9961aa8 Expose a property in display plugins to determine if the device is visble to the user 2016-03-10 17:19:32 -08:00
Anthony Thibault
153f7fc3aa OpenVR: adjusted translation of UI sphere overlay 2016-03-10 09:45:47 -08:00
Anthony Thibault
42d27557a1 OpenVR: remove 180 y rotation for UI bounds.
Turns out the room I was using was misconfigured.
2016-03-09 18:42:58 -08:00
Anthony Thibault
5df616be37 OpenVR: More usable UI Sphere overlay location
Also, added a debug option to display SensorToWorld matrix in Developer > Avatar menu.
2016-03-09 16:24:08 -08:00
Brad Davis
d428f3b96f Working on crash bugs 2016-03-09 14:00:05 -08:00
Brad Davis
17852e86d2 Fixing enum names 2016-03-08 16:16:44 -08:00
Brad Davis
f651adbd24 Correcting vive button naming 2016-03-08 15:12:54 -08:00
Brad Davis
1312901f06 Removing thumb mappings, using start/back for camera and menu 2016-03-08 15:09:45 -08:00
Brad Davis
166a419e90 Oculus update 2016-03-08 11:20:53 -08:00
Brad Davis
28103cf5ef Migrate composition of the overlay and pointer to the present thread 2016-03-07 17:14:41 -08:00
Anthony Thibault
89885805d2 OpenVR: Added hysteresis to the touch pad dead spot
This should make using the Vive touch pad for movement more reliable.
2016-02-26 18:34:33 -08:00
Anthony J. Thibault
01ef5aabcb OpenVR: More reliable detection of left and right hands 2016-02-26 14:38:35 -08:00
Anthony J. Thibault
0fd260076b SixenseManager: fix velocity and angularVelocity computation
Copied the delta based computation of velocity and angularVelocity that was in
Application::setPalmData() and moved it into SixenseManager.  This will guarantee
that the velocity computation is the same as it was previously.  The goal here is
to NOT change the behavior of the hydra.

The moving average style calculation of velocities has been removed.

Removed dead code.
2016-02-22 20:05:41 -08:00
Anthony Thibault
3b87cd0ea8 Improve hold action by using controller velocity
The AvatarHoldAction now derives the body velocity by using data from the controller::Pose.  Rather then trying to derive it based on previous positions.  This results in more acurate motion of the held object when the hold is released.

OpenVR input plugin: pass the velocity and angularVelocity directly from the controller pose to the controller::Pose.
2016-02-22 19:15:22 -08:00
Anthony Thibault
942f2c13ab Vive: smoother updates for IK driven by vive controllers
Before this PR the simulation rate was clamped to never exceed 60htz.
This had problems when waving the vive hand controllers in the world,
they would jitter.  The simulation rate is now clamped to never exceed
120 htz.  This has the effect of synchronizing the display and the
update rates to 90htz.

Also there are improvements to vive support if threaded present is
disabled.
2016-02-19 15:58:13 -08:00
Anthony Thibault
93f61fce7a OpenVRDisplayPlugin: predict poses for better tracking
Extrapolate the next set of poses for HMD and hand controllers.
Currently we predict 44ms into the future, this seems too high, however
it was discovered by inspection to be the best value.
Obviously there is a source of latency that we need to track down,
however even with this latency, it is a much improved experience.
2016-02-18 18:00:04 -08:00
Brad Davis
8289c39a2a Removing flicker from OpenVR mirror 2016-02-17 14:48:24 -08:00
Brad Davis
d1583e8cbe Fixing warnings 2016-02-16 17:00:00 -08:00
Brad Davis
d61f4fbb25 PR feedback 2016-02-16 16:44:16 -08:00
Brad Davis
56fc9ea301 Remove distortion on HMD previews, both mono and stereo 2016-02-15 21:46:29 -08:00
Anthony J. Thibault
111ed65bf8 Controller Pose values are relative to Avatar.
Pass a InputCalibrationData to each inputPlugin and inputDevice.
This contains the most up sensorToWorldMatrix, avatarMat and hmdSensorMatrix.
Each input plugin can use this data to transform it's poses into Avatar space
before sending it up the chain.

This fixes a bug in the handControllerGrab.js script that relied on the hand controller
rotation/positions being in the avatar frame.
2016-02-11 17:18:01 -08:00
Brad Hefta-Gaub
d77d102384 add support for persisting the mono preview mode option 2016-02-10 22:01:17 -08:00
Anthony J. Thibault
c8e6aee3e7 OpenVr: fix for conflict between openvr and oculus display plugins
* Call vr::VR_Shutdown() when ref-count goes to zero.  The ref-count
  is ncessary because the vr::IVRSystem poitner is shared between the
  the openvr input and display plugins.
* OpenVR plugins options will display in the menu if vr::VR_IsHmdPresent() is true.
  This is faster then initializing all of openvr and less likely to conflict with the
  oculus display plugin.
2016-02-10 16:28:03 -08:00
Anthony J. Thibault
90f0821c2b OpenVR: reduce thread contention, fix sensor reset 2016-02-10 11:14:26 -08:00
Anthony J. Thibault
b9a16cec25 Re-enable OpenVR plugin
* Enabled preview window
* rendering is only mono for some-reason.
2016-02-09 18:49:18 -08:00
Philip Rosedale
b038e4b7e7 calibrate using either the 1 or 2 button on each hand 2016-02-01 16:48:00 -08:00
Brad Davis
e58f99c989 Ensure Oculus session is valid before base class activation 2016-01-11 13:07:02 -08:00
Brad Hefta-Gaub
c0cf717a04 CR feedback 2016-01-11 11:13:33 -08:00
Brad Hefta-Gaub
dfba05ae5f CR feedback 2016-01-11 11:07:07 -08:00
Brad Hefta-Gaub
d8ced32879 fix mac/unix build buster 2016-01-08 21:37:00 -08:00
Brad Hefta-Gaub
e2a3903def add support for advanced/developer plugins and change diplay modes to match spec 2016-01-08 16:58:25 -08:00
Brad Hefta-Gaub
1508a637ab Menu restructuring 2016-01-07 12:09:02 -08:00
Andrew Meadows
9ab5ef358a remove dangling whitespace 2016-01-05 16:44:36 -08:00
Anthony J. Thibault
e10cecd310 Build fix for linux #2? 2015-12-29 09:23:03 -08:00
Anthony J. Thibault
7e514d2f4d Mac build fix 2015-12-28 18:42:03 -08:00
Anthony Thibault
27e80913d6 NeuronPlugin: register for combination mode
This will tell us, if user is using arms, upper-body or full body configurations.
2015-12-26 12:13:29 -08:00
Anthony Thibault
fd3eed3d41 NeruonPlugin: translation support
Warn if translations are not present.
2015-12-26 11:50:54 -08:00
Anthony Thibault
878fe80040 Merge branch 'master' into tony/neuron-plugin 2015-12-25 10:24:55 -08:00
Anthony Thibault
84260192fb Set up controller poses to match hifi standard skeleton
Neuron plugin in fills in the gap (thumb1) with identity.
Updated neuronAvatar script to work with new controller pose names.
2015-12-25 09:57:50 -08:00
Anthony Thibault
8b979b67ee neruonAvatar.js: now sets rotations in correct frame.
The rotations from the neuron are effectively in world space and are deltas
from the default pose.

There still is an issue with the thumb, due to the missing joint from the Neuron.
The Neuron only has 3 thumb joints, not 4.
2015-12-24 17:16:49 -08:00
Anthony J. Thibault
c44f69b370 WIP checkpoint
Changed euler angle compisition based on experiments in maya.
Also, the neuronAvatar.js attempts to transform the neuron input quaternions into
a pose relative to the avatar's default pose, but doesn't it doesn't work.
2015-12-23 17:13:52 -08:00
Anthony J. Thibault
6afe3bae5e Copy Neuron joints into controller poses
This makes the accessible for controller mapping and to JavaScript.

Added 'neuronAvatar.js' as an example of reading joints from the neuron and setting them
on the avatar.  NOTE: the rotations are currently in the wrong coordinate frame.
2015-12-22 17:21:33 -08:00
Brad Hefta-Gaub
68c6cae4f3 fix warning 2015-12-22 17:21:25 -08:00
Brad Hefta-Gaub
298e4d0f83 Merge pull request #6726 from jherico/legacy_oculus
Legacy oculus work
2015-12-22 11:02:37 -08:00
Bradley Austin Davis
79d8b20637 Simulating Oculus interaction on legacy platforms 2015-12-22 10:09:45 -08:00
Bradley Austin Davis
e0e1ae43f5 Fixing legacy oculus plugin 2015-12-22 09:28:38 -08:00
Brad Hefta-Gaub
eff830ad4b fix crash on mac when sixense DLL can't be loaded 2015-12-22 01:03:23 -08:00
Anthony J. Thibault
0459479c2b NeuronPlugin: Added external project for Neuron SDK
Now builds on windows with actual Neuron SDK.
Can to TCP server on localhost, and receive joint data.
Will debug draw joint 6, (left foot?)
2015-12-21 18:30:15 -08:00
Anthony J. Thibault
dcde640acd Stub Perception Neuron input plugin 2015-12-21 10:06:36 -08:00
samcake
41525a7c4d Merge branch 'master' of https://github.com/highfidelity/hifi into graphicsMaster 2015-12-18 16:20:41 -08:00
Andrew Meadows
4e76e9e50b prevent nan values in measure of angularVelocity 2015-12-18 13:51:14 -08:00
samcake
dff4327f7d Merge branch 'master' of https://github.com/highfidelity/hifi into graphicsMaster 2015-12-18 13:18:30 -08:00
Andrew Meadows
d6541e9ee7 angular velocity is a vector, not a quaternion 2015-12-18 11:06:58 -08:00
samcake
a50b14dfae Merging with upstream graphics 2015-12-14 18:18:39 -08:00
Brad Davis
98263f0c0d Moving sdl2 to external plugin 2015-12-10 14:56:41 -08:00
Brad Hefta-Gaub
e133bd867a Merge pull request #6600 from jherico/aeryn-sixense
Moving Sixense to external plugin
2015-12-10 13:33:17 -08:00
Brad Davis
645695d5d5 Moving sixense to external plugin 2015-12-10 10:44:23 -08:00
Howard Stearns
83078b9d8c Merge branch 'master' of https://github.com/highfidelity/hifi into correct-target-frame-rate 2015-12-10 08:44:08 -08:00
Bradley Austin Davis
1644bda908 Migrate to latest Oculus SDK (0.8) 2015-12-09 17:32:11 -08:00
Bradley Austin Davis
fd5fb3096f Disabling OpenVR plugin 2015-12-09 17:31:53 -08:00
Brad Davis
978d39b7f4 Moving OpenVR to external plugin and updating to latest version 2015-12-09 16:20:24 -08:00
Howard Stearns
acb43e18d0 coding standards 2015-12-09 15:54:49 -08:00
Howard Stearns
dd2d040253 Merge branch 'fix-sync-period-calc' into correct-target-frame-rate 2015-12-09 15:43:43 -08:00
howard-stearns
1d65cbce88 Remove unneeded getTargetFramePeriod and isVSynchronized. 2015-12-08 18:08:57 -08:00
Bradley Austin Davis
e77f2e8ac4 Pass correct frame index into Oculus SDK 2015-12-08 16:49:50 -08:00
Howard Stearns
fa0ad1fe4d Merge branch 'master' of https://github.com/highfidelity/hifi into correct-target-frame-rate 2015-12-04 16:12:22 -08:00
Brad Davis
90ef7c6bf7 Disabling 0.5 Oculus plugin (Mac / Linux) for now 2015-12-04 10:28:20 -08:00
Brad Davis
60aa93c38c Fixing menu items in display plugins 2015-12-04 10:28:19 -08:00
Brad Davis
7262a10e62 Refactoring present thread / GL base plugin for saner context management 2015-12-04 10:28:18 -08:00
Brad Davis
b9ace94ff1 Prototyping threaded present 2015-12-04 10:28:16 -08:00
Brad Hefta-Gaub
d9a1563396 Merge pull request #6152 from sethalves/parents
Parents
2015-12-04 10:26:57 -08:00
Atlante45
07387ab8c0 Fix most OpenGL warnings 2015-12-04 10:01:43 -08:00
Howard Stearns
d51785a259 Merge branch 'master' of https://github.com/highfidelity/hifi into correct-target-frame-rate 2015-12-03 17:28:32 -08:00
Howard Stearns
a989b926b0 isVSynchronized, and proper override declarations. 2015-12-03 11:28:26 -08:00
Howard Stearns
8ae05d8490 Plugins target frame rate and period. 2015-12-02 16:40:41 -08:00
Brad Davis
0023c034c4 Fixing naming of GL classes 2015-11-30 18:27:03 -08:00
Seth Alves
a9669531ae quiet a warning 2015-11-21 11:53:16 -08:00
Seth Alves
4646c0c103 unmangle merge 2015-11-21 10:49:31 -08:00
U-GAPOS\andrew
28e349f421 remeasure sensor after recentering 2015-11-19 10:43:40 -08:00
Stephen Birarda
46c8d7b3f8 fix for release build undeclared identifier 2015-11-17 12:32:45 -08:00
Brad Davis
4dec31d524 Fix crash in Oculus simulator 2015-11-04 13:20:47 -08:00
Seth Alves
c381da24a7 get interface building on my linux box 2015-11-02 10:42:06 -08:00
Brad Hefta-Gaub
92bcd9ca9e make oculus plugin use static glew 2015-11-01 15:48:01 -08:00
Brad Hefta-Gaub
b9d60e803b fix mac warning 2015-11-01 15:13:28 -08:00
Brad Davis
1e47a53603 Fixing mac oculus crash 2015-11-01 14:34:03 -08:00
Brad Davis
cfb2fd1523 Support for runtime plugins (DLLs) 2015-11-01 11:12:12 -08:00