





#ifndef XCOLLISIONAABBTREE_H
#define XCOLLISIONAABBTREE_H

#include "xasset.h"
#include "xcollisionaabbtreeindex.h"

class XCollisionAabbTree : public XAsset
{
public:
    explicit XCollisionAabbTree();

    void ParseData(QDataStream *aStream) override;

    const float* GetOrigin() const;
    void SetOrigin(const float* origin, size_t count = 3);

    const float* GetHalfSize() const;
    void SetHalfSize(const float* halfSize, size_t count = 3);

    quint16 GetMaterialIndex() const;
    void SetMaterialIndex(quint16 index);

    quint16 GetChildCount() const;
    void SetChildCount(quint16 count);

    XCollisionAabbTreeIndex& GetU();
    const XCollisionAabbTreeIndex& GetU() const;
    void SetU(const XCollisionAabbTreeIndex& u);

private:
    float mOrigin[3] = {0.0f, 0.0f, 0.0f};
    float mHalfSize[3] = {0.0f, 0.0f, 0.0f};
    quint16 mMaterialIndex = 0;
    quint16 mChildCount = 0;
    XCollisionAabbTreeIndex mU;
};

#endif // XCOLLISIONAABBTREE_H





