#include "xanimparttransframes.h"

XAnimPartTransFrames::XAnimPartTransFrames()
    : XAsset()
    , mMins()
    , mMaxs()
    , mFrames()
    , mIndices()
{
    SetName("Animation Parts Trans Frames");
}

void XAnimPartTransFrames::ParseData(XDataStream *aStream) {
    if (GetPtr() == -1) {
        mMins[0] = aStream->ParseSingle(QString("%1 min %2").arg(GetName()).arg(0));
        mMins[1] = aStream->ParseSingle(QString("%1 min %2").arg(GetName()).arg(1));
        mMins[2] = aStream->ParseSingle(QString("%1 min %2").arg(GetName()).arg(2));
        mMaxs[0] = aStream->ParseSingle(QString("%1 max %2").arg(GetName()).arg(0));
        mMaxs[1] = aStream->ParseSingle(QString("%1 max %2").arg(GetName()).arg(1));
        mMaxs[2] = aStream->ParseSingle(QString("%1 max %2").arg(GetName()).arg(2));

        // Parse frames
        mFrames.ParseData(aStream);

        // Parse indices
        mIndices.ParseData(aStream);
    }
}

void XAnimPartTransFrames::Clear()
{
    mMins = QVector3D();
    mMaxs = QVector3D();

    mFrames.Clear();
    mIndices.Clear();
}
