80 lines
1.7 KiB
C++
80 lines
1.7 KiB
C++
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
#include "xgfxstreamingaabbtree.h"
|
||
|
|
|
||
|
|
XGfxStreamingAabbTree::XGfxStreamingAabbTree()
|
||
|
|
: XAsset() {
|
||
|
|
}
|
||
|
|
|
||
|
|
void XGfxStreamingAabbTree::ParseData(QDataStream *aStream) {
|
||
|
|
if (GetPtr() == -1) {
|
||
|
|
aStream->read((char*)&mFirstItem, sizeof(unsigned short));
|
||
|
|
aStream->read((char*)&mItemCount, sizeof(unsigned short));
|
||
|
|
aStream->read((char*)&mFirstChild, sizeof(unsigned short));
|
||
|
|
aStream->read((char*)&mChildCount, sizeof(unsigned short));
|
||
|
|
aStream->read((char*)mMins, 3 * sizeof(float));
|
||
|
|
aStream->read((char*)mMaxs, 3 * sizeof(float));
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
unsigned short XGfxStreamingAabbTree::GetFirstItem() const {
|
||
|
|
return mFirstItem;
|
||
|
|
}
|
||
|
|
|
||
|
|
void XGfxStreamingAabbTree::SetFirstItem(unsigned short item) {
|
||
|
|
mFirstItem = item;
|
||
|
|
}
|
||
|
|
|
||
|
|
unsigned short XGfxStreamingAabbTree::GetItemCount() const {
|
||
|
|
return mItemCount;
|
||
|
|
}
|
||
|
|
|
||
|
|
void XGfxStreamingAabbTree::SetItemCount(unsigned short count) {
|
||
|
|
mItemCount = count;
|
||
|
|
}
|
||
|
|
|
||
|
|
unsigned short XGfxStreamingAabbTree::GetFirstChild() const {
|
||
|
|
return mFirstChild;
|
||
|
|
}
|
||
|
|
|
||
|
|
void XGfxStreamingAabbTree::SetFirstChild(unsigned short child) {
|
||
|
|
mFirstChild = child;
|
||
|
|
}
|
||
|
|
|
||
|
|
unsigned short XGfxStreamingAabbTree::GetChildCount() const {
|
||
|
|
return mChildCount;
|
||
|
|
}
|
||
|
|
|
||
|
|
void XGfxStreamingAabbTree::SetChildCount(unsigned short count) {
|
||
|
|
mChildCount = count;
|
||
|
|
}
|
||
|
|
|
||
|
|
const float* XGfxStreamingAabbTree::GetMins() const {
|
||
|
|
return mMins;
|
||
|
|
}
|
||
|
|
|
||
|
|
void XGfxStreamingAabbTree::SetMins(const float* mins, size_t count) {
|
||
|
|
if (count <= 3) {
|
||
|
|
memcpy(mMins, mins, count * sizeof(float));
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const float* XGfxStreamingAabbTree::GetMaxs() const {
|
||
|
|
return mMaxs;
|
||
|
|
}
|
||
|
|
|
||
|
|
void XGfxStreamingAabbTree::SetMaxs(const float* maxs, size_t count) {
|
||
|
|
if (count <= 3) {
|
||
|
|
memcpy(mMaxs, maxs, count * sizeof(float));
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|