#include "xcplane.h"

XCPlane::XCPlane()
    : XAsset()
    , mNormal()
    , mDist(0)
    , mType(0)
    , mSignbits(0)
    , mPad()
{
    SetName("C Plane");
}

XCPlane::~XCPlane()
{
    
}

void XCPlane::ParseData(XDataStream *aStream)
{
    if (GetPtr() == -1)
    {
        mNormal.setX(aStream->ParseSingle(QString("%1 normal x").arg(GetName())));
        mNormal.setY(aStream->ParseSingle(QString("%1 normal y").arg(GetName())));
        mNormal.setZ(aStream->ParseSingle(QString("%1 normal z").arg(GetName())));
        mDist = aStream->ParseSingle(QString("%1 dist").arg(GetName()));
        mType = aStream->ParseUInt8(QString("%1 type").arg(GetName()));
        mSignbits = aStream->ParseUInt8(QString("%1 signbits").arg(GetName()));
        mPad[0] = aStream->ParseUInt8(QString("%1 pad 0").arg(GetName()));
        mPad[1] = aStream->ParseUInt8(QString("%1 pad 1").arg(GetName()));
    }
}

void XCPlane::Clear()
{
    mNormal = QVector3D();
    mDist = 0;
    mType = 0;
    mSignbits = 0;
    mPad.clear();
}
