From 655a188a697036d103c9b10708bf69df433d5932 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Sun, 25 Aug 2024 11:22:13 +0100 Subject: [PATCH] Offset any models that aren't centered --- project/code/TMV/Model.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/code/TMV/Model.cs b/project/code/TMV/Model.cs index 3c639a2..32e7939 100644 --- a/project/code/TMV/Model.cs +++ b/project/code/TMV/Model.cs @@ -53,7 +53,6 @@ public partial class Model : Node3D var b = (material.Handle) & 0xff; var g = (material.Handle >> 8) & 0xff; var r = (material.Handle >> 16) & 0xff; - GD.Print($"Handle: {material.Handle}, R: {r}, G: {g}, B: {b}"); var colour = new Color(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f); materials.Add(new StandardMaterial3D { @@ -108,7 +107,8 @@ public partial class Model : Node3D } } - var meshInstance = new MeshInstance3D { Mesh = mesh }; + var pos = -modelFile.Header.Center.ToGodotVec3(); + var meshInstance = new MeshInstance3D { Mesh = mesh, Position = pos }; AddChild(meshInstance); } }