| 1 | #pragma once |
| 2 | |
| 3 | #include <math/seadBoundBox.h> |
| 4 | #include <math/seadMatrix.h> |
| 5 | #include <math/seadVector.h> |
| 6 | |
| 7 | #include "Library/Factory/Factory.h" |
| 8 | #include "Library/HostIO/HioNode.h" |
| 9 | |
| 10 | namespace al { |
| 11 | |
| 12 | class AreaShape : public HioNode { |
| 13 | public: |
| 14 | AreaShape(); |
| 15 | |
| 16 | virtual bool isInVolume(const sead::Vector3f&) const = 0; |
| 17 | virtual bool isInVolumeOffset(const sead::Vector3f&, f32) const = 0; |
| 18 | virtual bool calcNearestEdgePoint(sead::Vector3f*, const sead::Vector3f&) const = 0; |
| 19 | virtual bool checkArrowCollision(sead::Vector3f*, sead::Vector3f*, const sead::Vector3f&, |
| 20 | const sead::Vector3f&) const = 0; |
| 21 | virtual bool calcLocalBoundingBox(sead::BoundBox3f*) const = 0; |
| 22 | |
| 23 | const sead::Vector3f& getScale() const { return mScale; } |
| 24 | |
| 25 | void setBaseMtxPtr(const sead::Matrix34f* baseMtxPtr); |
| 26 | void setScale(const sead::Vector3f& scale); |
| 27 | |
| 28 | bool calcLocalPos(sead::Vector3f* localPos, const sead::Vector3f& trans) const; |
| 29 | bool calcWorldPos(sead::Vector3f* worldPos, const sead::Vector3f& trans) const; |
| 30 | bool calcWorldDir(sead::Vector3f* worldDir, const sead::Vector3f& trans) const; |
| 31 | void calcTrans(sead::Vector3f* trans) const; |
| 32 | |
| 33 | private: |
| 34 | const sead::Matrix34f* mBaseMtxPtr = nullptr; |
| 35 | sead::Vector3f mScale = {1.0f, 1.0f, 1.0f}; |
| 36 | }; |
| 37 | |
| 38 | using AreaShapeCreatorFunction = AreaShape* (*)(); |
| 39 | |
| 40 | class AreaShapeFactory : public Factory<AreaShapeCreatorFunction> { |
| 41 | public: |
| 42 | AreaShapeFactory(const char* factoryName); |
| 43 | }; |
| 44 | |
| 45 | } // namespace al |
| 46 | |