Commit Graph

2791 Commits

Author SHA1 Message Date
bjornbytes 80a33c0544 mat4_multiply -> mat4_mul;
quat_mul vs. mat4_multiply is inconsistent.  Going with mul over
multiply is consistent with vec3_sub and Lua's __mul metamethod.
2020-11-21 14:32:59 -07:00
bjornbytes 314a5a9a2d vrapi: cleanup; fix getPose for non-head/hands devices; 2020-11-21 14:24:20 -07:00
bjornbytes 842efe36c7 Handle openvr-specific warnings more precisely;
Instead of disabling a warning for the entire project, it is only
disabled while processing the OpenVR header.
2020-11-21 14:09:51 -07:00
Nevyn Bengtsson dfacb6408b on lodr restart, make sure lovr.headset is nil'd if none is available
In boot.lua, it assumes that lovr.headset.init will assert if no driver
is available. This was previously only true on the first call to it,
since after it's initialized, it'll just return early and won't assert.
This will later crash since your lua code will now see a lovr.headset
being available, but calling anything in it will crash since
lovrHeadsetDisplayDriver is NULL

After this fix, initialized becomes false before boot sets up the
headset module again, so that the assertion fires correctly.
2020-11-20 10:04:01 +01:00
Bjorn 8a3d365268
Merge pull request #299 from Wallbraker/linux-openxr
Linux OpenXR support
2020-11-16 13:51:41 -07:00
Jakob Bornecrantz 1400cd201a OpenXR: Add support for X11 and EGL on Linux 2020-11-15 22:51:20 +00:00
bjornbytes 0b73e7d7a6 KeyCode -> KeyboardKey because X11 conflict; 2020-11-15 22:51:20 +00:00
bjorn a139ed33e5 Fix OpenXR view matrix; 2020-11-15 22:49:00 +00:00
Bjorn df3b918f74
Merge pull request #327 from jmiskovic/feature/curve-empty
Create empty curve with specified number of points
2020-11-13 12:33:48 -07:00
Josip Miskovic 1defba8f24 Create empty curve with specified number of points
This `lovr.math.newCurve(n)` variant is already described in API
documentation, now it is implemented.
2020-11-13 17:53:37 +01:00
Bjorn 4ec1494d29
Merge pull request #329 from jmiskovic/fix/damping-threshold
Change default damping threshold to zero
2020-11-12 18:09:17 -07:00
Nevyn Bengtsson 453d348fdc Stack trace when background thread crashes
Without this, the error handler only prints the _main thread's
error handler's_ stack trace
2020-11-12 18:08:05 -07:00
bjorn e8db2f8187 Basic cylinder uvs; 2020-11-12 18:08:05 -07:00
bjorn 43d5bc78f0 lovr.mirror disables blending when drawing headset texture;
This is so transparent headset textures (when rendering overlays)
don't ghost.  Alternatively, clear could be used.
2020-11-12 18:08:05 -07:00
bjorn b2cb2c8752 Fix l_event; 2020-11-12 18:08:05 -07:00
bjorn 1a1605f9ce rm textureData include; 2020-11-12 18:08:05 -07:00
bjorn 75c37bf7e9 rm trailing whitespace; 2020-11-12 18:08:05 -07:00
bjorn 276faf30ad l_event cleanup; 2020-11-12 18:08:05 -07:00
bjorn e533adf649 openxr indentation; 2020-11-12 18:08:05 -07:00
bjorn cdac6bf146 Fix textureData include; 2020-11-12 18:08:05 -07:00
bjorn 5f0542cc43 Fix util declspec spacing; 2020-11-12 18:08:05 -07:00
bjorn 827dfda748 TextureData:encode returns Blob; rm core/png; 2020-11-12 18:08:05 -07:00
bjorn 1e7749a58a Fix MSVC warnings;
It's that time of year.
2020-11-12 18:08:05 -07:00
bjornbytes a81cd0d731 KeyCode -> KeyboardKey because X11 conflict; 2020-11-12 18:08:04 -07:00
bjorn 362e5525e7 Fix OpenXR view matrix; 2020-11-12 18:08:04 -07:00
bjorn 81065a6e6b Ref overflow no longer prints filename;
It was an absolute path.
2020-11-12 18:08:04 -07:00
bjorn 4ef944d7c1 lovrDestroy calls lovrPlatformDestroy; 2020-11-12 18:08:04 -07:00
bjorn f472f0161c os_web: Unregister callbacks in lovrPlatformDestroy; 2020-11-12 18:08:04 -07:00
Josip Miskovic b4d391f45f Change default damping threshold to zero
Zero as default makes more sense. Colliders can come to full stop which
allows them to go to sleep for CPU optimization. Also in zero gravity
colliders crawling through air with 0.01 velocity are infuriating.
2020-11-12 18:28:59 +01:00
Josip Miskovic b735015f6e Check if shape can be positioned and oriented
Shape without attached collider cannot be positioned or oriented. Trying
to do so results in ODE crash. Better to throw a more descriptive error.
2020-11-12 17:18:40 +01:00
Patrik Sjöberg ec501903d5 Correct the argument indices for Source:setCone 2020-11-11 22:17:10 +01:00
bjorn 61eaf579cd Thread local vector metatable refs; 2020-11-06 13:12:57 -07:00
Nevyn Bengtsson 326d275424 don't free window icon before it's used
It seems to me like that lovrRelease will delete textureData->blob immediately,
which means the windowing system later can't use it because it's already freed.
There's already a free on line 378 which looks more correct.

Also, icon appears flipped if 'flipped' is set to true here on Linux. Is GLFW
inconsistent between linux and windows, or should it indeed be false?
2020-11-06 21:00:38 +01:00
bjornbytes 5c381ead34 Force set vsync in lovrGraphicsCreateWindow;
Headset drivers are allowed to override the vsync setting if vsync
messes up their frame timing.  The vsync property is effectively a
global piece of state in core/os and doesn't change across restarts
because the window is persistent.  This can mean that if you switch
from a headset driver that wants vsync off (anything except desktop)
to a headset driver that doesn't care what the vsync is (desktop),
you could end up with a vsync setting that doesn't match t.window.vsync.
I think this is a symptom of poor design somewhere and the best solution
to this probem is "to just not have it".  Similar issues exist for, e.g.
the window size (but that one is less weird because at least you were
the one who changed it).  For now we are just going to ensure that
lovr.graphics.createWindow always modifies the vsync property.
Untested, may need to adjust this fix later.
2020-11-02 11:57:02 -07:00
bjorn e12a6b7dc4 Fix WebGL; 2020-11-01 23:11:35 -07:00
Nevyn Bengtsson a321d997a1
network permissions for pico too 2020-11-01 22:54:02 +01:00
Ben Ferguson efe143bf55 enet and hand tracking permissions fix 2020-11-01 16:43:03 -05:00
bjorn 38875cb399 Fix buffer flushing;
lovrGraphicsMapBuffer had the potential to cause a flush.  Flushing
unmaps buffers.  This meant that during any of the calls to map while
creating a Batch, it was possible to cause a flush and unmap other
buffers that expected to be mapped.  This caused writes to unmapped
pointers and subsequent skipping of calls to glFlushMappedBufferRange.

The fix is to figure out if we need to flush upfront and get it out
of the way before mapping any buffers.
2020-10-29 12:12:34 -06:00
Jakob Bornecrantz 22a14e1013 OpenXR: Make sure to set types for XrActionState[Boolean|Float] structs 2020-10-25 01:20:44 +01:00
Jakob Bornecrantz e7d0a73353 OpenXR: Fix right actions not being marked as active in xrSyncActions call 2020-10-25 00:14:17 +01:00
Jakob Bornecrantz b8e3c187ed OpenXR: Fixes for implementations that are more strict with validation 2020-10-24 18:13:41 +01:00
Nevyn Bengtsson 57827eed3c Quest: Make tracked hands have a pose facing -Z
To be consistent with the pose for controllers.
2020-10-21 22:44:57 +02:00
bjorn 6a4779e899 Pico: Reset index buffer binding using vao; 2020-10-19 19:24:18 -06:00
Nevyn Bengtsson 0b9f4d30fd pico: start each eye from origin 2020-10-16 09:29:29 +02:00
bjorn 85cc82d8cb v0.14.0; 2020-10-05 16:40:27 -06:00
bjorn 0388213be4 Reset camera after lovr.headset.renderTo; 2020-10-02 19:50:00 -06:00
bjorn 98f481e941 WebXR input fixes; 2020-10-02 15:57:42 -06:00
Nevyn Bengtsson da79a87328 Allow lovr.headset.init to fail
with a pcall, like the requires above. so if there
is no matching headset driver, the module is just
turned off.
2020-10-01 22:43:57 +02:00
bjorn e14db6c671 Fixes from webxr testing; 2020-09-29 23:41:42 -06:00
bjorn f70201240a nogame fix; 2020-09-29 22:24:40 -06:00