#include "xcmodel.h"

XCModel::XCModel()
    : XAsset()
    , mMins()
    , mMaxs()
    , mRadius(0.0f)
    , mLeaf()
{
    SetName("C Model");
}

XCModel::~XCModel()
{
    
}

void XCModel::ParseData(XDataStream *aStream)
{
    for (int i = 0; i < 3; i++) {
        mMins[i] = aStream->ParseSingle(QString("%1 min %2").arg(GetName()).arg(i));
    }

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

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

    mLeaf.ParseData(aStream);
}

void XCModel::Clear()
{
    mMins = QVector3D();
    mMaxs = QVector3D();
    mRadius = 0.0f;
    mLeaf = XCLeaf();
}
