mirror of
https://github.com/LazyDuchess/OpenTS2.git
synced 2025-01-23 00:31:47 -05:00
Pull IkChainIdx from animation channel flags
This commit is contained in:
parent
1da81c10d6
commit
2cb6db9369
1 changed files with 5 additions and 1 deletions
|
@ -101,12 +101,16 @@ namespace OpenTS2.Files.Formats.DBPF.Scenegraph.Block
|
|||
? (ChannelType)ChannelTypeBits
|
||||
: throw new InvalidCastException($"Channel type has invalid value: {ChannelTypeBits}");
|
||||
|
||||
// Calculated from the top 8 bits of the most-significant byte of ChannelFlags.
|
||||
// Calculated from the top 3 bits of the most-significant byte of ChannelFlags.
|
||||
public uint NumComponents => (ChannelFlags >> 29) & 0b111;
|
||||
|
||||
// Bottom 15 bits give the channel duration.
|
||||
public uint DurationTicks => ChannelFlags & 0x7FFF;
|
||||
|
||||
// Bits 1 to 5 of the most-significant byte are the ik chain idx for this channel.
|
||||
private uint IKChainIdxBits => (ChannelFlags >> 25) & 0b1111;
|
||||
public int IKChainIdx => IKChainIdxBits == 0b1111 ? -1 : (int)IKChainIdxBits;
|
||||
|
||||
public ChannelComponent[] Components;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue