





#include "xcleafbrushnodechildren.h"

XCLeafBrushNodeChildren::XCLeafBrushNodeChildren()
    : XAsset() {
}

void XCLeafBrushNodeChildren::ParseData(QDataStream *aStream) {
    if (GetPtr() == -1) {
        aStream->read((char*)&mDist, sizeof(float));
        aStream->read((char*)&mRange, sizeof(float));
        aStream->read((char*)mChildOffset, 2 * sizeof(quint16));
    }
}

float XCLeafBrushNodeChildren::GetDist() const {
    return mDist;
}

void XCLeafBrushNodeChildren::SetDist(float dist) {
    mDist = dist;
}

float XCLeafBrushNodeChildren::GetRange() const {
    return mRange;
}

void XCLeafBrushNodeChildren::SetRange(float range) {
    mRange = range;
}

quint16 XCLeafBrushNodeChildren::GetChildOffset(int index) const {
    if (index >= 0 && index < 2) {
        return mChildOffset[index];
    }
    return 0;
}

void XCLeafBrushNodeChildren::SetChildOffset(int index, quint16 offset) {
    if (index >= 0 && index < 2) {
        mChildOffset[index] = offset;
    }
}




