We're actually rendering models in the mission now (badly)
This commit is contained in:
parent
de4f3d6381
commit
cb2f016455
|
@ -94,6 +94,7 @@ public partial class Mission : Node3D
|
|||
{
|
||||
ClearMap();
|
||||
|
||||
// TODO: This shouldn't be set for things that aren't actually FMs
|
||||
var fmName = FileName.GetBaseDir().GetFile();
|
||||
_textureLoader = new TextureLoader(fmName);
|
||||
_file = new(FileName);
|
||||
|
@ -209,12 +210,26 @@ public partial class Mission : Node3D
|
|||
continue;
|
||||
}
|
||||
|
||||
// Let's try and place an object :)
|
||||
var fmName = FileName.GetBaseDir().GetFile();
|
||||
var objPath = _installPaths.GetObjectPath(fmName, modelName + ".bin");
|
||||
objPath ??= _installPaths.GetObjectPath(modelName + ".bin");
|
||||
|
||||
var pos = brush.position.ToGodotVec3();
|
||||
var cube = new CsgBox3D
|
||||
var model = new Model();
|
||||
model.Position = pos;
|
||||
if (objPath != null)
|
||||
{
|
||||
Position = pos
|
||||
};
|
||||
AddChild(cube);
|
||||
model.BuildModel("", objPath);
|
||||
}
|
||||
AddChild(model);
|
||||
|
||||
// var pos = brush.position.ToGodotVec3();
|
||||
// var cube = new CsgBox3D
|
||||
// {
|
||||
// Position = pos
|
||||
// };
|
||||
// AddChild(cube);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ public partial class Model : Node3D
|
|||
modelSelector.LoadModel += BuildModel;
|
||||
}
|
||||
|
||||
private void BuildModel(string rootPath, string modelPath)
|
||||
public void BuildModel(string rootPath, string modelPath)
|
||||
{
|
||||
foreach (var node in GetChildren())
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ public partial class Model : Node3D
|
|||
return;
|
||||
}
|
||||
|
||||
// TODO: Remove this disgusting hack
|
||||
// TODO: Remove this disgusting hack. Not only is it a hack, it doesn't support custom models
|
||||
var baseDir = ProjectSettings.GlobalizePath($"user://objects/tmp");
|
||||
var options = new EnumerationOptions
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue