#ifndef XCOLLISIONAABBTREE_H
#define XCOLLISIONAABBTREE_H

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

#include <QVector3D>

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

    void ParseData(XDataStream *aStream) override;
    void Clear() override;

    QVector3D GetOrigin() const;
    void SetOrigin(QVector3D aOrigin);

    QVector3D GetHalfSize() const;
    void SetHalfSize(QVector3D aHalfSize);

    quint32 GetMaterialIndex() const;
    void SetMaterialIndex(quint32 aIndex);

    quint32 GetChildCount() const;
    void SetChildCount(quint32 aCount);

    XCollisionAabbTreeIndex& GetTreeIndex();
    void SetTreeIndex(const XCollisionAabbTreeIndex& aTreeIndex);

private:
    QVector3D mOrigin;
    QVector3D mHalfSize;
    quint32 mMaterialIndex;
    quint32 mChildCount;
    XCollisionAabbTreeIndex mTreeIndex;
};

#endif // XCOLLISIONAABBTREE_H
