Commit Graph

395 Commits

Author SHA1 Message Date
Nevyn Bengtsson b938a839e0 fix crash in lovrGraphicsGetPixelDensity
Neither Quest nor Pico check for null on its out-params.
Better to send in dummy params to avoid nulls.
2020-08-05 14:48:58 +02:00
bjorn e0decf5327 Fix ModelData pointer alignment;
ModelData manages a single allocation and creates pointers into
that allocation.  These pointers were tightly packed, creating
alignment issues which triggered undefined behavior.  Now, the
pointers are all aligned to 8 byte boundaries.
2020-08-04 12:28:21 -06:00
bjorn 83ff4783c2 ALIGN macro aligns up instead of down;
So you don't have to add (n - 1).  Hopefully this turns out to be
the common case.
2020-08-04 12:23:45 -06:00
Nevyn Bengtsson 27384ac62c Fix Pico build
* lovrPlatformGetBundlePath was missing the root argument
* ANDROID_SDK can't be assumed to be the parent of the ndk folder, in case it's a side-by-side installation of the NDK. Instead, ANDROID_SDK should be provided with -D
* One more thing we could mention in the docs that I ran into: Installing java with apt gave me an incompatible version. It worked better to just -DJAVA_HOME= to the java that comes with Android studio (/snap/android-studio/91/android-studio/jre on ubuntu).
2020-08-04 10:42:04 +02:00
bjorn ee95e6c6bd Refactor OBJ model loading;
It no longer uses sscanf and no longer overflows its buffer.
2020-08-04 00:12:58 -06:00
bjorn b45baacb66 Handle active attributes that don't have a location;
There are some attributes that don't have a location (gl_InstanceID
is being reported for some reason).  Their location is -1 and this
causes a left shift of a negative value which is undefined.
2020-07-30 02:46:17 -06:00
bjorn 4160743b77 Fix desktop game packaging issue;
Accidentally hardcoded it to "assets" when updating Android.
2020-07-29 16:30:14 -06:00
bjorn 826fc098bc Set identity to empty string if save mount fails; 2020-07-29 16:27:17 -06:00
Bjorn 617d508d68
Merge pull request #269 from jmiskovic/savemount
Config parameter for save directory precedence
2020-07-29 16:26:07 -06:00
bjorn ae2e14f98f rm save directory mount failure fix;
This is a temporary revert to make a merge easier.
2020-07-29 16:25:29 -06:00
bjorn 99fdcc8287 Fix calling convention of GL debug callback; 2020-07-29 14:56:46 -06:00
bjorn f0a5a8838b OpenGL debug messages and contexts;
The new t.graphics.debug flag controls the following:

- If enabled, a debug context is created
- If disabled, a no-error context is created
- If enabled, GL debug messages are forwarded to lovr.log
2020-07-28 16:12:30 -06:00
bjorn e3aa4c7d5d t.graphics.debug flag; 2020-07-28 16:12:15 -06:00
bjorn c423b1292a Fix save directory to use system path separator; 2020-07-27 18:15:16 -06:00
bjorn ac58a1aeba Pico: Draw the rest of the owl;
Add entrypoints, headset backend code, fill in the Activity, and
add various special cases to account for the asynchronous render loop,
lack of sRGB support, and OpenGL state resets.
2020-07-27 14:56:21 -06:00
bjorn 58ab637465 Custom os implementation for pico; 2020-07-27 14:28:40 -06:00
bjorn b0b9e38da6 Pico: add pico jar and missing DRIVER_PICO enumerant; 2020-07-27 14:25:57 -06:00
bjorn e7d4e6cf7b Start pico headset backend; 2020-07-27 13:58:52 -06:00
bjorn 066a8a3795 opps; 2020-07-27 11:28:35 -06:00
bjorn d045929065 ShaderBlock:getShaderCode: add namespace support; 2020-07-04 17:50:00 -06:00
bjorn 29f8365eed Clean up os_android and fix event polling issues; 2020-07-03 20:17:39 -06:00
bjorn eb008935e8 vrapi: wasPressed/wasReleased; 2020-07-03 18:12:14 -06:00
bjorn 59a1c14c04 rm oculus_didChange; 2020-07-03 17:59:18 -06:00
bjorn 9777306b70 rm oculus mobile; 2020-07-02 10:46:10 -06:00
Bjorn 26b4b58479
Merge pull request #273 from bjornbytes/android-tup
Android Support
2020-07-02 09:26:14 -07:00
bjorn a0d2ba94ad vrapi: haptics, tracking space fixes; 2020-07-02 10:22:38 -06:00
bjorn 0dd4a1191c rm getApplicationId; 2020-06-29 18:10:03 -06:00
bjorn 4d6ad2239e Quest input fixes; 2020-06-26 16:09:16 -06:00
bjorn afaae2febb Remaining android filesystem work; 2020-06-25 18:18:44 -06:00
bjorn 27b04b2bde vrapi: Add support for focus awareness; 2020-06-25 15:00:12 -06:00
bjorn 6819a04f31 Bugfixes/cleanup for octupus go; 2020-06-25 14:29:44 -06:00
bjorn 2042010b5b Move core/fs paths to core/os;
Usually these are more of a platform-specific concept, and they
don't really interact with files or do any io.

There is a little bit of duplication among the *nix platforms since
they're similar, but overall this organization feels a bit better.
2020-06-25 13:28:40 -06:00
Josip Miskovic 66d7e887c7 Config parameter for save directory precedence 2020-06-21 18:02:36 +03:00
mcc cf05249b8b Oculus: Fix bug where vibration never stops
(because of a sign error)
2020-06-11 12:33:42 -04:00
bjorn a1aa3c8ae8 Finish vrapi driver; 2020-06-09 18:02:03 -06:00
bjorn f58c7075b1 OpenVR: Emit quit event when exiting from SteamVR dashboard; 2020-06-07 00:42:44 -06:00
Bjorn 27b2c0abad
Merge pull request #263 from jmiskovic/world-settings
Physics simulation access to global ERP and CFM
2020-06-04 10:06:51 -07:00
Nevyn Bengtsson e34953f064 lovrMicrophoneGetData: fix potential buffer overrun
With the check for samples==0 being done BELOW the assert for offset+samples<soundData->samples,
setting samples to 0 and then having more samples available in the mic than present in
the created buffer would cause buffer overrun
2020-06-04 14:31:24 +02:00
Josip Miskovic 139808cab0 Get/set World and Joint simulation parameters
Tightness parameter is amount of force is exerted on collider to resolve
collisions and enforce joint operation. Low values make joints loose,
high values make it tight and can cause collider to overshot the joint
target. With tightness set to 0 the joint loses its function. Going
above 1 puts even more energy into joint oscillations. Tightness
parameter is called ERP in ODE manual.

The responseTime affects the time constant of physics simulation, both
for collisions and for joint inertia. Low responseTime values make
simulation tight and fast, higher values make it sluggish. For
collisions it affects how fast penetration is resolved, with higher
values resulting in spongy objects with more surface penetration and
slower collision resolving. For joints the responseTime is similar to
inertia, with higher responseTime values resulting in slow oscillations.
The oscillation frequency is also affected by collider mass, so
responseTime can be used to tweak the joint to get desired frequency
with specific collider mass. Values higher than 1 are often desirable,
especially for very light objects. Unlike tightness, responseTime is
tweaked in orders of magnitude with useful values (depending on mass)
being between 10^-8 and 10^8.

Both parameters can be applied to World for simulation-wide usage, or
specified per-joint in case of distance and ball joints. Other joints
don't allow customizing these parameters, and will use World settings
instead..
2020-06-03 19:03:38 +03:00
bjorn 90e985c45b Fix MSAA Canvas readback; 2020-05-26 09:53:26 -06:00
bjorn 6d2fdac89f Prefix headset implementation files with headset_; 2020-05-24 13:32:13 -06:00
bjorn d6abcdfb0e Fix 2 memory leaks; 2020-05-23 13:03:16 -06:00
bjorn 1185fcf6e1 Autodetect integer attribute types;
Fixes inability to use integer attributes with Mesh.
2020-05-21 00:31:49 -06:00
bjorn 75e26f0051 Move core/hash to core/util; 2020-05-19 13:49:40 -06:00
bjorn 92ac93e6b8 Improve image uniform errors; 2020-05-18 15:14:17 -06:00
bjorn dab0be7055 World:getColliders; 2020-05-11 12:05:30 -06:00
bjorn 95635b4b02 Support loading 16 bit images;
With 1, 2, or 4 channels;
2020-05-10 02:35:45 -06:00
bjorn 6539bc1bd2 Make physics orientation getters more consistent; 2020-05-10 02:08:36 -06:00
Bjorn 62fbf7e0e3
Merge pull request #257 from jmiskovic/physics-vectors
Physics API support for vectors
2020-05-10 01:04:23 -07:00
bjorn 1e78ac8669 Add r16, rg16, rgba16 texture formats; 2020-05-10 01:59:58 -06:00