Compare commits
2 Commits
65dda0194d
...
1b13d92b99
Author | SHA1 | Date |
---|---|---|
Jarrod Doyle | 1b13d92b99 | |
Jarrod Doyle | 045285f82d |
|
@ -83,6 +83,22 @@ public class LinkChunk : IChunk, IMergable
|
||||||
|
|
||||||
public void Merge(IMergable other)
|
public void Merge(IMergable other)
|
||||||
{
|
{
|
||||||
|
// !HACK: We always merge into gamesys so we can pre-trim garbage here
|
||||||
|
var count = links.Count;
|
||||||
|
for (var i = count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
var link = links[i];
|
||||||
|
if (link.linkId.IsConcrete())
|
||||||
|
{
|
||||||
|
links.RemoveAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (links.Count != count)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Trimmed links: {count} -> {links.Count}");
|
||||||
|
}
|
||||||
|
|
||||||
links.AddRange(((LinkChunk)other).links);
|
links.AddRange(((LinkChunk)other).links);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,6 +149,22 @@ public class LinkDataMetaProp : IChunk, IMergable
|
||||||
|
|
||||||
public void Merge(IMergable other)
|
public void Merge(IMergable other)
|
||||||
{
|
{
|
||||||
|
// !HACK: We always merge into gamesys so we can pre-trim garbage here
|
||||||
|
var count = linkData.Count;
|
||||||
|
for (var i = count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
var link = linkData[i];
|
||||||
|
if (link.linkId.IsConcrete())
|
||||||
|
{
|
||||||
|
linkData.RemoveAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (linkData.Count != count)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Trimmed link data: {count} -> {linkData.Count}");
|
||||||
|
}
|
||||||
|
|
||||||
linkData.AddRange(((LinkDataMetaProp)other).linkData);
|
linkData.AddRange(((LinkDataMetaProp)other).linkData);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -317,7 +317,7 @@ public class ModelFile
|
||||||
var objTrans = Matrix4x4.Identity;
|
var objTrans = Matrix4x4.Identity;
|
||||||
if (subObj.Joint != -1)
|
if (subObj.Joint != -1)
|
||||||
{
|
{
|
||||||
var ang = float.DegreesToRadians(joints[subObj.Joint]);
|
var ang = subObj.Joint >= joints.Length ? 0 : float.DegreesToRadians(joints[subObj.Joint]);
|
||||||
// TODO: Is this correct? Should I use a manual rotation matrix?
|
// TODO: Is this correct? Should I use a manual rotation matrix?
|
||||||
var jointRot = Matrix4x4.CreateFromYawPitchRoll(0, ang, 0);
|
var jointRot = Matrix4x4.CreateFromYawPitchRoll(0, ang, 0);
|
||||||
objTrans = jointRot * subObj.Transform;
|
objTrans = jointRot * subObj.Transform;
|
||||||
|
|
Loading…
Reference in New Issue