Commit Graph

18 Commits

Author SHA1 Message Date
bjorn e2fdba6f24 Add Collider:getShapes for backcompat; 2024-04-05 11:55:12 -07:00
bjorn 0f2717850e Collider shape is required I think;
Jolt doesn't really support bodies without shapes.
2024-04-05 11:29:26 -07:00
bjorn d48af00156 Add Collider:get/setShapeOffset; 2024-04-05 11:29:26 -07:00
bjorn 6b86cecb4c Colliders can only have 1 shape; rm shape pose; 2024-04-05 11:29:26 -07:00
bjorn fdba60214c Fix Collider/Shape/Joint UserData leak;
refs are cumbersome because they require storing an int and they require
manual cleanup when the object is destroyed.

Instead, we'll go with a pure Lua solution using a table in the
registry.  The table has weak keys containing the LÖVR object, and the
values are the userdata.  This doesn't require any manual cleanup,
reduces the size of objects by 8 bytes, and is about 25% faster.
2024-04-01 16:03:42 -07:00
bjorn be795c0ebd Change vec3 back to 3 floats; Clean up maf/vectors;
The "vec3 is 4 floats" thing was consistently confusing to people.  It's
reverted everywhere except for Curve.

maf now has full sets of methods for vec2/vec3/vec4, for consistency.

Vector bindings now use luax_readvec* helper functions for the
number/vector variants, and use maf for most functionality, which cleans
things up a lot.
2023-07-10 17:51:24 -07:00
bjorn a511064987 Collider:isDestroyed; 2023-06-22 15:48:23 -07:00
bjorn e9776f98c6 Fix compatibility with Lua 5.2, 5.3, 5.4;
Part of this involved putting the Lua header back in api.h, since we
need to know the Lua version to define some macros properly.
2022-11-24 14:33:55 -08:00
bjorn 8fcdfd2bb4 Minor physics cleanup; 2022-03-30 22:05:10 -07:00
bjorn 159243190b rm some unnecessary includes; 2021-04-20 20:08:30 -06:00
bjorn e63099ba6a Flatten api.h; 2021-03-15 18:54:27 -06:00
bjorn 3bc2c00b79 api doesn't include util; 2020-12-25 12:50:26 -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
bjorn 6539bc1bd2 Make physics orientation getters more consistent; 2020-05-10 02:08:36 -06:00
Josip Miskovic f2fcc4e5c4 Collider API accepts both vec3 and number coords 2020-05-10 01:12:45 +03:00
Josip Miskovic a4b0d004a1 Fix collider setOrientation() and setPose()
The conversion from angle,ax,ay,az to quaternion is already done in
physics module.
2020-04-28 20:15:09 +03:00
bjorn 6d0369d365 Convert some collider functions to use vectors; 2020-03-07 16:35:32 -08:00
bjorn c9b1f257bf api: try new file naming convention; Tupfile: cleanup;
I assume full responsibility for any catastrophes this causes.
2019-12-31 19:31:44 -08:00
Renamed from src/api/l_collider.c (Browse further)