Example #1
0
        public static W3xPivot Parse(BinaryReader reader, AssetEntry header)
        {
            string name   = null;
            uint?  nameID = null;

            switch (header.TypeHash)
            {
            case 1002596986u:     // Cnc3
                name = reader.ReadUInt32PrefixedAsciiStringAtOffset();
                break;

            case 3985956449u:     // Ra3
                nameID = reader.ReadUInt32();
                break;

            default:
                throw new InvalidDataException();
            }

            var result = new W3xPivot
            {
                Name        = name,
                NameID      = nameID,
                ParentIdx   = reader.ReadInt32(),
                Translation = reader.ReadVector3(),
                Rotation    = reader.ReadQuaternion()
            };

            // Don't need fixup matrix
            reader.BaseStream.Seek(64, SeekOrigin.Current);

            return(result);
        }
Example #2
0
 internal static W3xHierarchy Parse(BinaryReader reader, AssetEntry header)
 {
     return(new W3xHierarchy
     {
         Pivots = reader.ReadArrayAtOffset(() => W3xPivot.Parse(reader, header))
     });
 }