Commit Graph

152 Commits

Author SHA1 Message Date
bjorn 017dd15c78 Update OpenXR to 1.0;
Still untested, gib runtimes pls.
2019-08-03 19:06:57 -07:00
bjorn 7690db28af Windows: Fix all the int warnings; 2019-07-31 17:51:49 -07:00
bjorn c384d54aa5 OpenVR: Default haptic frequency to 1Hz; 2019-07-31 17:17:41 -07:00
bjorn 78f2060405 rm lovr.headset.getAcceleration, getAngularAcceleration;
Because OpenXR did...
2019-07-30 20:22:08 -07:00
bjorn 2b19c64aca rm primary DeviceButton and DeviceAxis;
It is confusing and doesn't really solve the intended problem very well.

For now we will all just suffer with our tedious device-specific Lua code.
2019-07-17 17:33:21 -07:00
bjorn 9156fa2cbf Vector rework; 2019-07-16 20:30:51 -07:00
mcc 39f8203442 Don't reset camera position of desktop driver on reset 2019-07-16 20:27:45 -07:00
bjorn 3c07ad6b0b Replace Animator with Model:animate; 2019-07-10 22:08:19 -07:00
bjorn 4372eb293e rm comma operator;
everyone is making fun of me haha
2019-07-10 18:46:51 -07:00
mcc 070892ee12 Fix crash with lovr.event.quit("restart") on Oculus Mobile
Because of how and when draws occur in our Oculus Mobile path, during a restart it would attempt to draw a frame after lovrGraphicsDestroy() is called, leading to a crash in lovrGraphicsSetCamera(). This blocks draws until the restart is finished and renderTo() has been called (conveniently detectable using the existing state.renderCallback).
2019-07-10 16:10:02 -07:00
bjorn f2feda9420 oculus: Remove offset;
Since we are calling SetTrackingOriginType with floor level, we don't
need to apply the seated-level t.headset.offset adjustment.
2019-07-05 01:05:02 -07:00
mcc 1b085a00ea As discussed in slack, Oculus should be letting lovrCanvasCreate decide whether to double 2019-07-02 13:28:36 -07:00
bjorn e82ba030a6 lovr.headset.getDisplayTime;
Returns the predicted display time, which is the estimated time at which
the photons of the next frame will hit the eyeballs of a person in the HMD.

This should be used instead of lovr.timer.getTime when used for rendering
something that is time-dependent.  Updating simulations, logic, or access
to high frequency times should still use lovr.timer.getTime.
2019-06-29 17:36:36 -07:00
bjorn d87fc56b63 lovr.headset.getDisplayMask; 2019-06-28 00:13:45 -07:00
bjorn adf5e69ea1 oculus: Remove unused variable; 2019-06-26 14:51:32 -07:00
mcc fc90a03584 Fix MSVC-specific warnings 2019-06-25 19:16:48 -07:00
mcc 430fbc27d5 ovrHand -> ovrHandType in oculus.c. We don't understand how this worked before but it fixes the oculus-windows build. 2019-06-25 19:16:48 -07:00
bjorn 010bbff519 openvr: Fix stereo Canvas dimensions mismatch;
(The width is automatically doubled when stereo now)
2019-06-25 19:15:38 -07:00
bjorn 749774e2fc Native texture depth must be explicitly specified;
To fix validation errors when attaching them to Canvases.
2019-06-25 18:57:18 -07:00
bjorn 7e65116add Fix oculus backend; 2019-06-25 18:16:54 -07:00
bjorn a3d5371d01 rm lib/vec/vec from oculus.c; 2019-06-25 18:07:56 -07:00
bjorn 928ccee5f1 Multiview; 2019-06-25 01:21:59 -07:00
bjorn 8d2f005bf3 Add stdlib.h to oculus_mobile; 2019-06-21 11:28:40 -07:00
bjorn 7ebee200ea rm strdup;
It isn't part of C, causing compiler errors on some platforms.
2019-06-20 22:21:31 -07:00
bjorn 879c789a08 Polyfill M_PI;
It technically isn't part of C, which is causing problems on some systems.
2019-06-20 21:43:40 -07:00
bjorn eb1e257209 Add new array implementation; Upgrade filesystem;
Filesystem:

- Uses streaming file IO.
- Uses less memory when requiring files.
- Simplifies its require path implementation.
2019-06-16 13:30:30 -07:00
bjorn de6d3dab5b Add tup build system;
It's still a rough draft and likely only works on my machine, but can be
improved over time.

Rough explanation:

- tup.config contains high-level build configuration defaults.
- Tuprules.tup contains mostly compiler flags (generated from the
  tup.config) and declares some macros used to compile code.
- Tupfile takes all generated object files and links them into the
  lovr executable.
- src/Tupdefault defines the default build steps for src and all
  subdirectories, which is to compile all .c files to .o files and put
  them in the <objects> bucket for linking by the toplevel Tupfile.

It's possible to have multiple configs active at once for different
platforms, projects, etc.  To do this, create a folder for each build
variant you want, and place a tup.config in each folder (it can be a
symlink, which is helpful).  Then, invoking `tup` will build all your
variants, or you can build a specific one by doing `tup <foldername>`.
2019-06-10 04:06:22 -07:00
bjorn 0b5c609264 Add OpenVR touch bindings;
Untested.
2019-06-06 01:10:50 -07:00
bjorn 5551f76557 Reset render data when restarting in oculus_mobile;
Fixes a crash where rendering would occur with the old Lua state
after a restart.
2019-06-05 20:23:21 -07:00
bjorn c0f4e2848b Update android build; 2019-06-05 20:22:51 -07:00
bjorn 06c6b172de vec3 has 4 elements; 2019-06-03 07:20:03 -07:00
bjorn 31e086edaf Inline all the maf functions; 2019-06-03 07:19:25 -07:00
Bjorn Swenson 68c1b6a201
Merge pull request #122 from bjornbytes/hand-updates
Hand updates
2019-06-03 00:14:45 -07:00
bjorn dc34ed4570 Start to trend towards 4-element arrays for vec3;
It will be important for enabling more SIMD.
2019-06-02 20:35:52 -07:00
bjorn cf7a738a9f Fix openvr.c; 2019-06-02 02:27:19 -07:00
bjorn 22fe333150 Update refcounting (again);
- Ref struct only stores refcount now and is more general.
- Proxy stores a hash of its type name instead of an enum.
- Variants store additional information instead of using a vtable.
- Remove the concept of superclasses from the API.
- Clean up some miscellaneous includes.
2019-06-02 01:02:26 -07:00
bjorn 84bd50379d Add primary button/axis;
It's called "primary".
2019-05-31 12:00:15 -07:00
bjorn 7ac3d6938b rm TRACKER devices for now;
This is not the correct way to expose them.  It doesn't seem like
there is consensus on how to expose them yet.  At the very least
LÖVR should instead use the hardcoded OpenVR tracker paths like
/camera, /keyboard, /foot/left, /foot/right, etc.

See these issues:

- https://github.com/ValveSoftware/openvr/issues/1030
- https://github.com/ValveSoftware/openvr/issues/962
2019-05-31 10:57:29 -07:00
bjorn af0678f9e9 rm DEVICE_HAND;
If we expose both unhanded hands and handed hands, people need to
deal with handling (haha) both cases in their apps.  It's simpler
to always deal with left and right hands, even though it is a bit
less general.  Still, this is congruent with the current state of
OpenVR and OpenXR, and I think there are still open questions about
the more uncommon cases where there are more than two hands.
2019-05-31 10:41:40 -07:00
bjorn fe559903e1 Oculus Go controller has handedness; 2019-05-31 10:37:43 -07:00
mcc 1449d4c914 Oculus mobile: Support getAcceleration 2019-05-28 18:59:05 -04:00
mcc f4189d13e8 Oculus Mobile fixes: Fix potential crash, fix touches on Go after Quest changes 2019-05-26 11:17:49 -04:00
mcc 991b35a628 Oculus mobile: revamp bridge to support Oculus Quest 2019-05-26 10:29:42 -04:00
bjorn 0b8bc4145e openxr: Begin the session at the correct time; 2019-05-25 20:15:42 -07:00
bjorn 4cc154fdfa More number conversions; 2019-05-20 20:35:07 -07:00
bjorn e4c32d2f08 Fix oculus_mobile api.h include; 2019-05-20 15:17:38 -07:00
bjorn a9972a88de Fix oculus_mobile_bridge include path; 2019-05-20 15:15:10 -07:00
bjorn e8a8f6718e Fix vrapi_getAxis; 2019-05-20 15:13:05 -07:00
bjorn df6b7fc96a Ref is mostly private now;
It's really nice how objects don't need to care about how they're
allocated/managed now.
2019-05-20 15:09:06 -07:00
bjorn 67ddefd0c2 Ensure platform functions have prefix; 2019-05-20 04:02:25 -07:00
bjorn 7645f4c014 Add core folder; 2019-05-20 02:47:33 -07:00
bjorn a17f10e273 Add modules folder; 2019-05-19 00:38:35 -07:00