Skip to content

Commit

Permalink
Force object transforms to be decomposable
Browse files Browse the repository at this point in the history
  • Loading branch information
kythyria committed Oct 12, 2023
1 parent 50043f4 commit 498f93c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion PD2ModelParser/Exporters/GltfExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ void CreateNodeFromObject3D(Object3D thing, GLTF.IVisualNodeContainer parent)
var mat = thing.Transform;
mat.Translation = mat.Translation * scaleFactor;

// Some models in the wild need this doing to them, god knows why
// Some models in the wild need this doing to them, god knows why,
// but bogus fourth rows are a thing.
mat.M14 = 0;
mat.M24 = 0;
mat.M34 = 0;
mat.M44 = 1;

node.LocalMatrix = isSkinned ? Matrix4x4.Identity : mat;
Expand Down

0 comments on commit 498f93c

Please sign in to comment.