public HeaderV14(byte[] raw) { _Identifier = Encoding.ASCII.GetString(raw, 0, 4); _Version = BitConverter.ToInt32(raw, 4); _Name = Encoding.ASCII.GetString(raw, 8, 64).Trim('\0'); _Length = BitConverter.ToInt32(raw, 72); _EyePosition = new EyePosition(BitConverter.ToSingle(raw, 76), BitConverter.ToSingle(raw, 80), BitConverter.ToSingle(raw, 84)); _BoundingBoxMin = new Point3D(BitConverter.ToSingle(raw, 88), BitConverter.ToSingle(raw, 92), BitConverter.ToSingle(raw, 96)); _BoundingBoxMax = new Point3D(BitConverter.ToSingle(raw, 100), BitConverter.ToSingle(raw, 104), BitConverter.ToSingle(raw, 108)); _ClippingBoxMin = new Point3D(BitConverter.ToSingle(raw, 112), BitConverter.ToSingle(raw, 116), BitConverter.ToSingle(raw, 120)); _ClippingBoxMax = new Point3D(BitConverter.ToSingle(raw, 124), BitConverter.ToSingle(raw, 128), BitConverter.ToSingle(raw, 132)); _TypeFlag = (TypeFlag)BitConverter.ToInt32(raw, 136); _Bones = new CountOffsetPair(BitConverter.ToInt32(raw, 140), BitConverter.ToInt32(raw, 144)); _BoneControllers = new CountOffsetPair(BitConverter.ToInt32(raw, 148), BitConverter.ToInt32(raw, 152)); _HitBoxes = new CountOffsetPair(BitConverter.ToInt32(raw, 156), BitConverter.ToInt32(raw, 160)); _Sequences = new CountOffsetPair(BitConverter.ToInt32(raw, 164), BitConverter.ToInt32(raw, 168)); _SequenceGroups = new CountOffsetPair(BitConverter.ToInt32(raw, 172), BitConverter.ToInt32(raw, 176)); _Textures = new CountOffsetPair(BitConverter.ToInt32(raw, 180), BitConverter.ToInt32(raw, 184)); _TextureInfo = BitConverter.ToInt32(raw, 188); _SkinReferences = BitConverter.ToInt32(raw, 192); _SkinFamilies = BitConverter.ToInt32(raw, 196); _SkinsOffset = BitConverter.ToInt32(raw, 200); _BodyGroups = new CountOffsetPair(BitConverter.ToInt32(raw, 204), BitConverter.ToInt32(raw, 208)); _Attachments = new CountOffsetPair(BitConverter.ToInt32(raw, 212), BitConverter.ToInt32(raw, 216)); _SoundGroups = new CountOffsetPair(BitConverter.ToInt32(raw, 220), BitConverter.ToInt32(raw, 224)); _SoundsOffset = BitConverter.ToInt32(raw, 228); _TransitionsCount = BitConverter.ToInt32(raw, 232); _TransitionFlagsOffset = BitConverter.ToInt32(raw, 236); _TransitionsOffset = BitConverter.ToInt32(raw, 240); _LevelOfDetailFlags = (LevelOfDetailFlags)BitConverter.ToInt32(raw, 244); _ModelCount = BitConverter.ToInt32(raw, 248); _VertexCount = BitConverter.ToInt32(raw, 252); _TriangleCount = BitConverter.ToInt32(raw, 256); _TriangleMapOffset = BitConverter.ToInt32(raw, 260); _VerticesOffset = BitConverter.ToInt32(raw, 264); _NormalOffset = BitConverter.ToInt32(raw, 268); _TextureCoordsOffset = BitConverter.ToInt32(raw, 272); _UselessOffset = BitConverter.ToInt32(raw, 276); _BlendingScalesOffset = BitConverter.ToInt32(raw, 280); _BlendingOffset = BitConverter.ToInt32(raw, 284); _BoneFixUpOffset = BitConverter.ToInt32(raw, 288); for (int i = 0; i < _ModelsOffset.Length; i++) { _ModelsOffset[i] = BitConverter.ToInt32(raw, (i * 4) + 292); } }
public Sequence(byte[] raw) { _Name = Encoding.ASCII.GetString(raw, 0, 32).Trim('\0'); _FramesPerSecond = BitConverter.ToSingle(raw, 32); _Flags = (SequenceFlags)BitConverter.ToInt32(raw, 36); _Activity = BitConverter.ToInt32(raw, 40); _ActivityWeight = BitConverter.ToInt32(raw, 44); _Events = new CountOffsetPair(BitConverter.ToInt32(raw, 48), BitConverter.ToInt32(raw, 52)); _EventCollection = new Event[_Events.Count]; _FrameCount = BitConverter.ToInt32(raw, 56); _Pivots = new CountOffsetPair(BitConverter.ToInt32(raw, 60), BitConverter.ToInt32(raw, 64)); _PivotCollection = new Pivot[_Pivots.Count]; _MotionType = (MotionFlags)BitConverter.ToInt32(raw, 68); _MotionBone = BitConverter.ToInt32(raw, 72); _LinearMovement = new Point3D(BitConverter.ToSingle(raw, 76), BitConverter.ToSingle(raw, 80), BitConverter.ToSingle(raw, 84)); _AutomovePositionIndex = BitConverter.ToInt32(raw, 88); _AutomoveAngleIndex = BitConverter.ToInt32(raw, 92); _BoundingBoxMin = new Point3D(BitConverter.ToSingle(raw, 96), BitConverter.ToSingle(raw, 100), BitConverter.ToSingle(raw, 104)); _BoundingBoxMax = new Point3D(BitConverter.ToSingle(raw, 108), BitConverter.ToSingle(raw, 112), BitConverter.ToSingle(raw, 116)); _BlendCount = BitConverter.ToInt32(raw, 120); _AnimationOffset = BitConverter.ToInt32(raw, 124); _BlendType[0] = (MotionFlags)BitConverter.ToInt32(raw, 128); _BlendType[1] = (MotionFlags)BitConverter.ToInt32(raw, 132); _BlendStart[0] = BitConverter.ToSingle(raw, 136); _BlendStart[1] = BitConverter.ToSingle(raw, 140); _BlendEnd[0] = BitConverter.ToSingle(raw, 144); _BlendEnd[1] = BitConverter.ToSingle(raw, 148); _BlendParent = BitConverter.ToInt32(raw, 152); _SequenceGroupIndex = BitConverter.ToInt32(raw, 156); _NodeEntry = BitConverter.ToInt32(raw, 160); _NodeExit = BitConverter.ToInt32(raw, 164); _NodeFlags = (NodeFlags)BitConverter.ToInt32(raw, 168); _Unknown[0] = BitConverter.ToInt32(raw, 172); _Unknown[1] = BitConverter.ToInt32(raw, 176); _Unknown[2] = BitConverter.ToInt32(raw, 180); _Unknown[3] = BitConverter.ToInt32(raw, 184); }
public ModelInfoV14(int skin, CountOffsetPair mesh) { _SkinReference = skin; _Mesh = mesh; }
public ModelInfoV14(int skin) { _SkinReference = skin; _Mesh = new CountOffsetPair(); }
public ModelInfoV14(byte[] raw) { _SkinReference = BitConverter.ToInt32(raw, 0); _Mesh = new CountOffsetPair(BitConverter.ToInt32(raw, 4), BitConverter.ToInt32(raw, 8)); }