1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-05 05:53:33 +00:00
Commit graph

33 commits

Author SHA1 Message Date
bjorn 2b94bcb46e Add quat_identity; 2021-04-03 18:38:23 -06:00
bjorn 72284c2c5b Merge branch 'master' into dev 2021-02-12 08:16:36 -07:00
Josip Miskovic 944a6029f0 Add mat4:targetAt and modify the mat4:lookAt
lookAt() returns view matrix that can be used to transform the camera
perspective. target() returns model matrix that is used to change
model transform. Results are matrix inversions of one another. Now both
functions exist it is possible to use right one and avoid extra matrix
inversion.
2021-01-22 16:01:27 +01:00
bjorn 31defbe145 maf windows PI fix; 2020-12-28 12:37:19 -07:00
bjorn 3bc2c00b79 api doesn't include util; 2020-12-25 12:50:26 -07:00
bjorn 9bdceb0094 rm LOVR_INLINE;
Just use the inline keyword which is C99.  Getting util.h out of
maf.h is nice.
2020-12-25 12:29:22 -07:00
bjorn 1a8f972f39 rm MAF_EXPORT;
It was only used when exporting functions for JavaScript.
2020-12-25 12:22:42 -07:00
Colby Klein 08025b9ac0
fix mat4_lookAt translation offset
need to dot with the axes to not have bizarre results.
2020-11-27 17:48:33 -08:00
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
Josip Miskovic ceaac78439 Fix NaN return from mat4 unpacking
The caluclated angle is forced to PI if cos(angle) falls outside the
[-1, +1] range due to floating point precision error.
2020-11-16 19:03:52 +01:00
bjorn 48a347ad01 mat4_fromQuat; mat4_getFov; getViewPose/Angles fixes; 2020-09-24 04:59:53 -07:00
bjorn 8973730d8a openvr_getSkeleton;
Untested
2020-08-22 13:33:06 -06:00
mcc d8abfcfae3 Remove mat4_transform_project, it not only duplicates mat4_transform, it is buggy 2020-04-05 19:51:37 -04:00
bjorn 409c2ad0c6 Fix projection matrices; 2020-02-13 16:33:17 -08:00
bjorn 723f5684cf Fix mat4_fov and desktop driver projection;
OpenVR may need updating now, but at least we know what the correct
approach is now.
2020-02-06 17:32:44 -08:00
bjorn b35ebc15b6 rm LOVR_USE_SSE;
It doesn't really improve performance on an average LÖVR app and
isn't worth the complexity.
2019-10-22 16:46:54 -07:00
bjorn 77258ec4dd mat4 multiplication works with vec4; 2019-10-13 16:02:21 -07:00
bjorn 6ef27ec7cc Merge branch 'master' of github.com:bjornbytes/lovr 2019-10-08 15:29:04 -07:00
bjorn 5f404e2b1f WebVR fixes;
- Re-add the maf.c file that exports all the maf symbols.
- Fix lovrGpuTock for WebGL.
2019-10-07 19:50:17 -07:00
bjorn 0c642a6790 Improve mat4:unpack;
- Orientation is correct when the matrix is scaled
- Orientation calculation is more efficient
2019-10-04 19:26:09 -07:00
bjorn 3e47f958ad Fix mat4:lookAt; 2019-08-31 05:45:19 -07:00
bjorn fb279057b8 maf no longer needs to export symbols; 2019-08-21 03:29:37 -07:00
bjorn b1b97ddb02 quat:direction returns vec3; 2019-08-19 14:19:10 -07:00
bjorn 584261e21f rm ffi vectors; 2019-08-19 14:13:36 -07:00
bjorn 62fe520da1 maf: Fix quat_getDirection; 2019-07-16 23:03:37 -07:00
bjorn 9156fa2cbf Vector rework; 2019-07-16 20:30:51 -07:00
mcc 8bfc8683db Patch maf.h so it can be included in C++
A C-only feature is used in one spot currently, which would be fine if maf.h were maf.c, but it's designed to be #included...
2019-07-10 14:58:55 -07:00
mcc 53270fbd76 mat4_transform_project in maf.h
mat4_transform ignores the final row of the matrix, which normally contains scale data. This is fine for modelview matrices, which is all lovr currently uses mat4_transform for. However it fails if you ever use mat4_transform on a projection matrix.

mat4_transform_project takes the final row into account, so you can use it with projection matrices. This was useful in my fork and might be useful to have around in lovr someday later.
2019-07-02 13:37:33 -07:00
bjorn b17d01e4aa Don't return NULL from mat4_invert; 2019-06-22 17:25:48 -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 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 7645f4c014 Add core folder; 2019-05-20 02:47:33 -07:00
Renamed from src/lib/maf.h (Browse further)