Vixen
02b45cc4
csharp
public static class ModelReader

Reads a model file through Assimp and converts what comes out into engine data.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Separate from ModelImporter so that the conversion — which is where all the decisions and all the ways to be wrong are — can be tested against a file without an import context, a virtual file system or a settings binder in the way.

Every matrix is transposed on the way in, and that is not a stylistic detail. Assimp's aiMatrix4x4 is row-major storage of a column-vector matrix, so a node's translation sits in its fourth column. Vixen is row-major storage of a row-vector matrix, where translation sits in the fourth row. Copying field for field puts every offset into the wrong place, and the symptom is a hierarchy that is subtly and consistently wrong rather than obviously broken — a model that assembles itself inside out.

No axis conversion. Assimp's own convention is right-handed and Y-up, which is Vector3's. A file authored Z-up therefore arrives Z-up, and correcting it is a rotation on the root node that an artist can see rather than a silent transform in a build step. MakeLeftHanded and FlipWindingOrder are deliberately not among the post-processing flags.

Fields and properties (1)

  • public const int MaximumInfluences

    How many joints can influence one vertex.

Methods (1)

Used by (4)

  • AnimationBinderVixen.Editor.AssetEditors
  • ModelImporterVixen.Editor.Assets
  • ModelReaderTestsVixen.Editor.Assets.Tests
  • NavMeshImporterVixen.Editor.Assets