From 0c0394df8607de2836a7cc388c228ed2c7fb50b8 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Sun, 25 Aug 2024 11:21:00 +0100 Subject: [PATCH] Handle object rotation --- project/code/TMV/Mission.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/project/code/TMV/Mission.cs b/project/code/TMV/Mission.cs index eec2a2d..c876230 100644 --- a/project/code/TMV/Mission.cs +++ b/project/code/TMV/Mission.cs @@ -218,20 +218,18 @@ public partial class Mission : Node3D objPath ??= _installPaths.GetObjectPath(modelName + ".bin"); var pos = brush.position.ToGodotVec3(); - var model = new Model(); - model.Position = pos; + var rawRot = brush.angle; + var rot = new Vector3(rawRot.Y, rawRot.Z, rawRot.X) * 360 / ushort.MaxValue; + var model = new Model + { + Position = pos, + RotationDegrees = rot + }; if (objPath != null) { model.BuildModel("", objPath); } AddChild(model); - - // var pos = brush.position.ToGodotVec3(); - // var cube = new CsgBox3D - // { - // Position = pos - // }; - // AddChild(cube); } }