Fix logic of lerping a missing relative motion node.

This commit is contained in:
2023-04-04 22:11:36 +08:00
parent 0a25b5260d
commit f467832115
2 changed files with 4 additions and 18 deletions

View File

@@ -171,22 +171,7 @@ namespace Cryville.Crtr {
}
public MotionNode GetRelativeNode(short id) {
int i = RelativeNodes.FindIndex(n => n.Id == id);
if (i == -1) {
var r = GetRelativeNode((ushort)(id - 1));
r.Time = null;
r.Id = id;
return r;
}
return RelativeNodes[i];
}
public MotionNode QueryRelativeNode(short id) {
int i = RelativeNodes.FindIndex(n => n.Id == id);
MotionNode cnode;
if (i == -1) cnode = new MotionNode { Id = id };
else cnode = RelativeNodes[i];
return cnode;
return RelativeNodes.Find(n => n.Id == id);
}
public void SetRelativeNode(MotionNode node) {