Initial basic sub object transformation
This commit is contained in:
parent
beae881f37
commit
59582bdfb8
|
@ -49,6 +49,25 @@ public class ModelLoader
|
|||
GD.Print($"Failed to load model file: {modelPath}");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Transform subobjs
|
||||
// TODO: Traverse children properly
|
||||
// TODO: Apply to normals
|
||||
// TODO: Apply joints(??)
|
||||
foreach (var subObj in modelFile.Objects)
|
||||
{
|
||||
if (subObj.Type == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (var i = subObj.PointIdx; i < subObj.PointIdx + subObj.PointCount; i++)
|
||||
{
|
||||
var v = modelFile.Vertices[i];
|
||||
v = System.Numerics.Vector3.Transform(v, subObj.Transform);
|
||||
modelFile.Vertices[i] = v;
|
||||
}
|
||||
}
|
||||
|
||||
var materials = new List<StandardMaterial3D>();
|
||||
foreach (var material in modelFile.Materials)
|
||||
|
|
Loading…
Reference in New Issue