Handle object rotation
This commit is contained in:
parent
85599b4069
commit
0c0394df86
|
@ -218,20 +218,18 @@ public partial class Mission : Node3D
|
||||||
objPath ??= _installPaths.GetObjectPath(modelName + ".bin");
|
objPath ??= _installPaths.GetObjectPath(modelName + ".bin");
|
||||||
|
|
||||||
var pos = brush.position.ToGodotVec3();
|
var pos = brush.position.ToGodotVec3();
|
||||||
var model = new Model();
|
var rawRot = brush.angle;
|
||||||
model.Position = pos;
|
var rot = new Vector3(rawRot.Y, rawRot.Z, rawRot.X) * 360 / ushort.MaxValue;
|
||||||
|
var model = new Model
|
||||||
|
{
|
||||||
|
Position = pos,
|
||||||
|
RotationDegrees = rot
|
||||||
|
};
|
||||||
if (objPath != null)
|
if (objPath != null)
|
||||||
{
|
{
|
||||||
model.BuildModel("", objPath);
|
model.BuildModel("", objPath);
|
||||||
}
|
}
|
||||||
AddChild(model);
|
AddChild(model);
|
||||||
|
|
||||||
// var pos = brush.position.ToGodotVec3();
|
|
||||||
// var cube = new CsgBox3D
|
|
||||||
// {
|
|
||||||
// Position = pos
|
|
||||||
// };
|
|
||||||
// AddChild(cube);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue