Unify absolute value and relative node of motion event.

This commit is contained in:
2023-04-04 21:18:34 +08:00
parent fd7c1e6635
commit 676d19f452
3 changed files with 25 additions and 29 deletions

View File

@@ -170,7 +170,7 @@ namespace Cryville.Crtr {
dest.RelativeNodes.RemoveRange(tcount, dcount - tcount);
}
public MotionNode GetRelativeNode(ushort id) {
public MotionNode GetRelativeNode(short id) {
int i = RelativeNodes.FindIndex(n => n.Id == id);
if (i == -1) {
var r = GetRelativeNode((ushort)(id - 1));
@@ -181,7 +181,7 @@ namespace Cryville.Crtr {
return RelativeNodes[i];
}
public MotionNode QueryRelativeNode(ushort id) {
public MotionNode QueryRelativeNode(short id) {
int i = RelativeNodes.FindIndex(n => n.Id == id);
MotionNode cnode;
if (i == -1) cnode = new MotionNode { Id = id };
@@ -256,7 +256,7 @@ namespace Cryville.Crtr {
}
public class MotionNode : IComparable<MotionNode> {
public ushort Id;
public short Id = -1;
public Vec1 Time;
float CmpTime { get { return Time != null ? Time.Value : 0; } }
[Obsolete]