#include "xgfxworldstreaminfo.h" XGfxWorldStreamInfo::XGfxWorldStreamInfo() : XAsset() { } void XGfxWorldStreamInfo::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { aStream->read((char*)&mAabbTreeCount, sizeof(int)); // Clear existing data before parsing new data mAabbTrees.clear(); // Parse AABB trees for (int i = 0; i < mAabbTreeCount; ++i) { XGfxStreamingAabbTree tree; tree.ParseData(aStream); mAabbTrees.append(tree); } // Parse leaf ref count and array aStream->read((char*)&mLeafRefCount, sizeof(int)); if (mLeafRefCount > 0) { mLeafRefs.resize(mLeafRefCount); aStream->read((char*)mLeafRefs.data(), mLeafRefCount * sizeof(int)); } } } int XGfxWorldStreamInfo::GetAabbTreeCount() const { return mAabbTreeCount; } void XGfxWorldStreamInfo::SetAabbTreeCount(int count) { mAabbTreeCount = count; } QVector& XGfxWorldStreamInfo::GetAabbTrees() { return mAabbTrees; } const QVector& XGfxWorldStreamInfo::GetAabbTrees() const { return mAabbTrees; } void XGfxWorldStreamInfo::SetAabbTrees(const QVector& trees) { mAabbTrees = trees; } int XGfxWorldStreamInfo::GetLeafRefCount() const { return mLeafRefCount; } void XGfxWorldStreamInfo::SetLeafRefCount(int count) { mLeafRefCount = count; } QVector& XGfxWorldStreamInfo::GetLeafRefs() { return mLeafRefs; } const QVector& XGfxWorldStreamInfo::GetLeafRefs() const { return mLeafRefs; } void XGfxWorldStreamInfo::SetLeafRefs(const QVector& refs) { mLeafRefs = refs; }