#include "xcollisionaabbtreeindex.h"

XCollisionAabbTreeIndex::XCollisionAabbTreeIndex()
    : XAsset()
    , mFirstChildIndex(0)
    , mPartitionIndex(0)
{
    SetName("Collision AABB Tree Index");
}

XCollisionAabbTreeIndex::~XCollisionAabbTreeIndex()
{

}

void XCollisionAabbTreeIndex::ParseData(XDataStream *aStream) {
    if (GetPtr() == -1) {
        mFirstChildIndex = aStream->ParseInt32(QString("%1 first child index").arg(GetName()));
        mPartitionIndex = aStream->ParseInt32(QString("%1 partition index").arg(GetName()));
    }
}

int XCollisionAabbTreeIndex::GetFirstChildIndex() const {
    return mFirstChildIndex;
}

void XCollisionAabbTreeIndex::SetFirstChildIndex(int index) {
    mFirstChildIndex = index;
}

int XCollisionAabbTreeIndex::GetPartitionIndex() const {
    return mPartitionIndex;
}

void XCollisionAabbTreeIndex::SetPartitionIndex(int index) {
    mPartitionIndex = index;
}




