2025-08-17 13:14:17 -04:00
|
|
|
#include "xgfxstreamingaabbtree.h"
|
|
|
|
|
|
|
|
|
|
XGfxStreamingAabbTree::XGfxStreamingAabbTree()
|
2025-09-10 21:58:26 -04:00
|
|
|
: XAsset()
|
|
|
|
|
{
|
|
|
|
|
SetName("GFX Streaming AABB Tree");
|
2025-08-17 13:14:17 -04:00
|
|
|
}
|
|
|
|
|
|
2025-09-10 21:58:26 -04:00
|
|
|
void XGfxStreamingAabbTree::ParseData(XDataStream *aStream) {
|
2025-08-17 13:14:17 -04:00
|
|
|
if (GetPtr() == -1) {
|
2025-09-05 18:35:17 -04:00
|
|
|
*aStream
|
|
|
|
|
>> mFirstItem
|
|
|
|
|
>> mItemCount
|
|
|
|
|
>> mFirstChild
|
|
|
|
|
>> mChildCount
|
|
|
|
|
>> mMins[0]
|
|
|
|
|
>> mMins[1]
|
|
|
|
|
>> mMins[2]
|
|
|
|
|
>> mMaxs[0]
|
|
|
|
|
>> mMaxs[1]
|
|
|
|
|
>> mMaxs[2];
|
2025-08-17 13:14:17 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|