7 releases

0.2.1 May 6, 2023
0.2.0 May 5, 2023
0.2.0-rc8 May 4, 2023
0.2.0-rc5 May 2, 2023

#58 in Data formats

Download history 9/week @ 2023-12-18 12/week @ 2023-12-25 4/week @ 2024-01-08 4/week @ 2024-01-15 7/week @ 2024-02-05 6/week @ 2024-02-12 24/week @ 2024-02-19 32/week @ 2024-02-26 20/week @ 2024-03-04 22/week @ 2024-03-11 24/week @ 2024-03-18 37/week @ 2024-03-25 64/week @ 2024-04-01

153 downloads per month
Used in 8 crates (5 directly)

MIT/Apache

1MB
20K SLoC

Transforms

There are two categories of models; "Model as scene" or "Model as single mesh". We prefer the "Model as single mesh" since it will only require a single entity when spawned, but at the cost of not being able to handle animations and only supporting a single object in the scene.

Models as scenes

     [Model entity]
            |
    [(Optional transform node)]
        /              \
[Scene root node 1]  [Scene root node 2] ...

These models can consist of multiple entities, and may have animations. In order for these to have consistent animations when the entire model is transformed, they need to have some kind of extra "transform" node inserted at the root.

Models as a single meshes

[Model entity]

In this case we want the resulting spawn to just be a single entity, with the mesh attached. All model transforms will be applied as mesh_to_local transforms.

Notes on cordinate system conversion

There are two ways to handle coordinate system conversions and scaling of models;

  1. Try to do it everywhere inside of the model loading
  2. Just put a root node that wraps everything that does the conversion

I tried 1. first and just couldn't get it to work. This code does 2. Also it seems like this is kind of how some exporters have solved it; the model may internally use one system and then the exporter has put some transforms at the root, which makes it even harder to try to do the conversions with 1.

Dependencies

~48–93MB
~1.5M SLoC