#include "xboneinfo.h"

XBoneInfo::XBoneInfo()
    : XAsset()
    , mBounds(3)
    , mOffset()
    , mRadiusSquared(0)
{
    SetName("Bone Info");
}

XBoneInfo::~XBoneInfo()
{
    
}

void XBoneInfo::ParseData(XDataStream *aStream)
{
    if (GetPtr() == -1)
    {
        for (int i = 0; i < 2; i++)
        {
            for (int j = 0; j < 3; j++)
            {
                mBounds[i][j] = aStream->ParseSingle(QString("%1 bound (%2, %3)")
                                                         .arg(GetName())
                                                         .arg(i)
                                                         .arg(j));
            }
        }

        for (int i = 0; i < 3; i++)
        {
            mOffset[i] = aStream->ParseSingle(QString("%1 offset %2")
                                                     .arg(GetName())
                                                     .arg(i));
        }

        mRadiusSquared = aStream->ParseSingle(QString("%1 radius squared").arg(GetName()));
    }
}

void XBoneInfo::Clear()
{
    mBounds.clear();
    mOffset = QVector3D();
    mRadiusSquared = 0;
}
