Commit Graph

5517 Commits

Author SHA1 Message Date
bjorn ce149558aa Add limited swizzling; 2024-06-24 20:53:57 -07:00
bjorn 9da77e9d05 Adjust __index/__newindex; 2024-06-24 20:53:57 -07:00
bjorn 73025caedf Add vec3:transform/rotate;
For compatibility.
2024-06-24 20:53:57 -07:00
bjorn 98f4c248db quat:direction returns vec3;
For backwards compatibility.
2024-06-24 20:53:57 -07:00
bjorn 3fb293d0a5 Details; 2024-06-24 20:53:57 -07:00
bjorn f4bb0c49ed Details; 2024-06-24 20:53:57 -07:00
bjorn 5eafd30bed Mat4 is a plain userdata instead of a refcounted object;
This is a lot faster, since it doesn't have to do all the registry
bookkeeping that the other objects do.
2024-06-24 20:53:56 -07:00
bjorn dc508c41be Clean up vector constructors; 2024-06-24 20:52:41 -07:00
bjorn 2af1b079de rm some unused maf methods;
They are in math.lua now.
2024-06-24 20:52:41 -07:00
bjorn 19bb936b7e luax_readmat4 uses mat4_fromPose;
No need for a matrix multiplication here.
2024-06-24 20:52:41 -07:00
bjorn 326b0d208f Make readscale consume 1 arg when nil;
That way all the math stuff consumes the same number of arguments when
nil.
2024-06-24 20:52:41 -07:00
bjorn 39b4b817d6 Fix Buffer:setData error messages;
Prevents "expected number, got number" type error messages for vectors.

Had to add an unfortunate flag for whether checkbufferdata accepts
numbers or not...
2024-06-24 20:52:41 -07:00
bjorn 3fcccd3cfe Pass:points/Pass:line work with table vectors; 2024-06-24 20:52:41 -07:00
bjorn 6ef4e266e7 Details; 2024-06-24 20:52:41 -07:00
bjorn d1ea3d7b3d Use helpers for quat multiplication; 2024-06-24 20:52:41 -07:00
bjorn bcf0421da9 Fix -2 scale components; 2024-06-24 20:52:41 -07:00
bjorn d941e55f4f Mat4 methods that return vec4 set metatable; 2024-06-24 20:52:41 -07:00
bjorn d709e8589a Vector metamethod uses rawget/rawset; 2024-06-24 20:52:41 -07:00
bjorn 4a249b8975 Fix sending Mat4 to Buffer data; 2024-06-24 20:52:41 -07:00
bjorn bef9ea3d57 Add lovr.math.mat4 for compatibility; 2024-06-24 20:52:41 -07:00
bjorn a85936b29f Fix luax_readmat4; 2024-06-24 20:52:41 -07:00
bjorn c6971ee68b Fix newMaterial; 2024-06-24 20:52:41 -07:00
bjorn cdf6063355 Mat4; 2024-06-24 20:52:40 -07:00
bjorn 40e2d2bf2b quat; 2024-06-24 20:52:06 -07:00
bjorn da2818d590 vec3; 2024-06-24 20:52:06 -07:00
bjorn 70f80b93e9 vec4; 2024-06-24 20:52:06 -07:00
bjorn e5cb811aaa vec2; 2024-06-24 20:52:06 -07:00
bjorn 57b43f8a0c WIP; 2024-06-24 20:52:06 -07:00
bjorn ce04f902bb Fix issue when mixing different index buffer types; 2024-06-24 20:20:25 -07:00
bjorn 1a67a9c1e4 Adjust ConeJoint/HingeJoint defaults slightly; 2024-06-24 16:04:41 -07:00
bjorn b125a7cad8 Better HingeJoint defaults;
The anchor defaults to one of the collider's positions.

The axis defaults to the direction between the two colliders positions,
or forward if there's only one collider.

Error if the axis is zero.
2024-06-24 15:54:21 -07:00
bjorn 557fd5953d Better DistanceJoint defaults;
The anchors default to the collider positions instead of the origin.
2024-06-24 15:39:31 -07:00
bjorn 1531d4f179 Better ConeJoint defaults; 2024-06-24 15:17:25 -07:00
bjorn ab13890f80 Fix Joint:getForce/Torque for ConeJoint; 2024-06-24 15:03:33 -07:00
bjorn 46c75fa066 BallJoint anchor defaults to one of the collider positions;
Instead of the origin.
2024-06-24 14:28:59 -07:00
bjorn 6e295a9a05 Fix crash when destroying single-collider joint; 2024-06-24 14:22:12 -07:00
bjorn 9fac6bbefb WeldJoint auto-detects anchor; 2024-06-24 14:08:05 -07:00
bjorn 5f5e8f2d9e cmake: add ENABLE_EXPORTS on macos/linux/wasm;
Revision 7373bb bumped CMake version from 3.3 to 3.5, and in 3.4 CMake
stopped exporting symbols in executables by default.  lovr relies on
this so ffi can load a few symbols like os_get_glfw_window.

Don't enable it on Android because executables aren't built there, and
don't do it on Windows because it produces an annoying .lib file and
isn't necessary.
2024-06-23 03:18:39 -07:00
bjorn b7765e9e15 Improve support for buffers with runtime-sized arrays;
- The last top-level field of a buffer can have a length of -1 to make
  it a "dynamic array".
- When a buffer has a dynamic array, lovr tries to guess its length:
  - if no data is given or the data is a table and it's missing the key,
    the length defaults to 1.
  - if the data is a table and the table has a key with the array's
    name, the length of that table is used as the dynamic array's length
    - Note: This does not account for structs that are using integer
      keys (although this messes up length calculation anyway)
    - Note: This does not account for "flat" arrays that are using
      numbers for vector types.
  - if the data is a blob, use the size of the blob to figure out the
    length of the array.
- Shader:getBufferFormat returns -1 for dynamic arrays that are nested
  inside of a struct.  It still returns nil for the "main format length"
  if buffer just consists of a dynamic array.
2024-06-23 00:18:58 -07:00
bjorn 99ef988a99 nogame: gate conf.lua on bundle path instead of exe path;
This means that the nogame screen will use the conf.lua correctly on
Android.  Desktop platforms are not affected.
2024-06-22 23:06:43 -07:00
bjorn 678a173119 Use 1.0 XR API version;
Some runtimes don't seem to support OpenXR 1.1 yet.
2024-06-22 23:06:43 -07:00
bjorn dd38ee9251 Update OpenXR to 1.1.38; 2024-06-22 23:06:43 -07:00
bjorn c68e38baa7 Upgrade Android Manifest SDK version;
Based on Quest recommendation.
2024-06-22 23:06:43 -07:00
bjorn 6a7ab183f9 core/os: use dimensions for borderless instead of fullscreen;
matches glfw behavior
2024-06-20 21:30:13 -07:00
bjorn 19cdec8fd0 Rename win32 icon resource to GLFW_ICON;
GLFW will use this to set the window icon.
2024-06-19 18:34:15 -07:00
bjorn 899ffeda4e rm deterministic World option;
It provides no measurable performance impact.  Better to leave it on, so
as to not have to explain it.
2024-06-18 18:57:02 -07:00
bjorn cab754114d Rename minBounceVelocity to restitutionThreshold; 2024-06-18 18:55:12 -07:00
bjorn 7ff506fdea Rename tickLimit to maxSteps; Fix interpolation when limited; 2024-06-18 18:48:40 -07:00
bjorn 3255078d67 Rename tickRate World option to timestep;
It is also in seconds instead of Hz, and doesn't suffer from integer
rounding.
2024-06-18 18:20:58 -07:00
bjorn 7d9502babf rm lovr.getVersion test;
This was just added to test the testing system, and will be annoying to
keep up to date.
2024-06-18 16:09:45 -07:00