Commit Graph

35 Commits

Author SHA1 Message Date
bjorn aef71192ac Add ConvexShape;
Also luax_readmesh supports ModelData input, and the indices pointer can
be NULL to only request the vertex positions.
2024-04-09 13:01:30 -07:00
bjorn d097d9819d Add wrappers for malloc functions; 2024-03-11 14:38:00 -07:00
bjorn 215e042e05 Add lovrUnreachable branch; 2024-01-31 12:52:29 -08:00
bjorn 40d85c6a16 Model uses sn10x3 normals and tangents;
This shaves 20 bytes off of each model vertex, or around 40% savings.
The vertex size is also a power of two which results in extreme amounts
of style points.
2024-01-20 17:39:36 -08: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 6a915a2993 Fix issue with mesh-multiple-skin check; 2023-06-25 19:16:34 -07:00
bjorn b9e14a8f2d Merge branch 'master' into dev 2023-06-21 16:52:10 -07:00
bjorn 06811dcb1a Fix lovr.graphics.newModel when model has unused meshes;
Prefer n^2 loop over a weird sentinel value that wasn't always getting written over.
2023-06-21 16:50:24 -07:00
bjorn 4100be4f23 Fix vertex color import when model stores it as VEC3; 2023-05-27 12:04:35 -07:00
bjorn 4a6de6caf5 Write blend shape compute shader; Bugfixes; 2023-03-31 18:45:16 -07:00
bjorn 3b1414deac Ok redesign blend shapes but they're good now; 2023-03-31 18:44:29 -07:00
bjorn b118ac1938 Terrible blend shape Lua API; 2023-03-31 18:43:16 -07:00
bjorn b1b78319b5 Model loads blend shape data and weights; 2023-03-31 18:42:45 -07:00
bjorn 21bb3eb096 ModelData parses blend shapes; 2023-03-31 18:39:39 -07:00
s-ol 533e02771e throw when model references external asset but no 'io' is given 2022-11-22 12:24:31 +01:00
bjorn cacc5eae71 ModelData:getTriangles reuses vertices better;
ModelData:getTriangles currently adds a fresh set of vertices for every
mesh in a node.  This is technically correct, but it wastes space when 2
nodes reference the same set of vertices with different index buffers,
which is pretty common when a node has multiple materials.  It also
breaks ODE, who doesn't like it when vertices outnumber indices too
much.
2022-11-09 22:22:51 -08:00
bjorn eba71d5921 Fix more warnings; 2022-08-06 19:23:41 -07:00
bjorn 6011e61d52 Fix lovr.headset.newModel and lovr.headset.animate; 2022-08-06 00:29:46 -07:00
bjorn 7c7f8ed907 Free ModelData metadata; 2022-08-04 00:31:39 -07:00
bjorn d42cac288f Use anonymous union for ModelNode transform; 2022-08-02 23:03:52 -07:00
bjorn 159352770f Model:getTriangles;
Doesn't 100% work, Buffers are kind of a mess, ugh.
2022-07-09 18:30:36 -07:00
bjorn 5f19c2e1be Model:getBoundingBox; Model:getBoundingSphere; 2022-07-06 19:22:02 -07:00
bjorn d088c5471d Model;
Does not include some of the fancier accessors yet.
2022-07-03 17:26:31 -07:00
bjorn 72a54bce2f Support STL models;
Only binary STL files are supported right now, ASCII is more challenging.
2021-02-23 12:07:16 -07:00
bjorn 8164e0b6e8 TextureData is now named Image!;
The existing Image construct was renamed StorageImage.
2021-02-08 20:17:47 -07:00
bjorn bc4cde1653 Adjust lovrRelease signature; 2021-02-08 17:52:26 -07:00
bjorn 3ded60948f rm core/ref; rm lovrAlloc; util does refcounting; 2021-02-08 17:26:44 -07: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 403ed8d3b0 Windows; 2019-12-10 12:19:50 -08:00
bjorn d21911d010 Add core/map hash table; rm lib/map; 2019-10-30 00:07:05 -07:00
bjorn bd773d2d6c Add materialMap to ModelData; 2019-08-09 15:14:22 -07:00
bjorn 3c07ad6b0b Replace Animator with Model:animate; 2019-07-10 22:08:19 -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 4cc154fdfa More number conversions; 2019-05-20 20:35:07 -07:00
bjorn a17f10e273 Add modules folder; 2019-05-19 00:38:35 -07:00
Renamed from src/data/modelData.c (Browse further)