Offset any models that aren't centered
This commit is contained in:
parent
ad68c25447
commit
655a188a69
|
@ -53,7 +53,6 @@ public partial class Model : Node3D
|
||||||
var b = (material.Handle) & 0xff;
|
var b = (material.Handle) & 0xff;
|
||||||
var g = (material.Handle >> 8) & 0xff;
|
var g = (material.Handle >> 8) & 0xff;
|
||||||
var r = (material.Handle >> 16) & 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);
|
var colour = new Color(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f);
|
||||||
materials.Add(new StandardMaterial3D
|
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);
|
AddChild(meshInstance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue