| 1 | #pragma once |
| 2 | |
| 3 | #include <basis/seadTypes.h> |
| 4 | |
| 5 | namespace al { |
| 6 | class CollisionPartsFilterOnlySpecialPurpose; |
| 7 | class LiveActor; |
| 8 | } // namespace al |
| 9 | class In2DAreaMoveControl; |
| 10 | class IUseDimension; |
| 11 | |
| 12 | class ActorDimensionKeeper { |
| 13 | public: |
| 14 | ActorDimensionKeeper(const al::LiveActor* actor); |
| 15 | void validate(); |
| 16 | void invalidate(); |
| 17 | void forceChange2DKeep(); |
| 18 | void forceEndChange2DKeep(); |
| 19 | bool update(); |
| 20 | |
| 21 | bool getIs2D() const { return mIs2D; } |
| 22 | |
| 23 | bool getIsIn2DArea() const { return mIsIn2DArea; } |
| 24 | |
| 25 | bool getIsCurrently2D() const { return mIsCurrently2D; } |
| 26 | |
| 27 | bool getIsCanChange2D() const { return mIsCanChange2D; } |
| 28 | |
| 29 | bool getIsCanChange3D() const { return mIsCanChange3D; } |
| 30 | |
| 31 | private: |
| 32 | const al::LiveActor* mLiveActor; |
| 33 | bool mIsValid = true; |
| 34 | bool mIs2D = false; |
| 35 | bool mIsIn2DArea = false; |
| 36 | bool mIsCurrently2D = false; |
| 37 | bool mIsCanChange2D = false; |
| 38 | bool mIsCanChange3D = false; |
| 39 | In2DAreaMoveControl* mIn2DAreaMoveControl = nullptr; |
| 40 | }; |
| 41 | |
| 42 | static_assert(sizeof(ActorDimensionKeeper) == 0x18); |
| 43 | |
| 44 | namespace rs { |
| 45 | |
| 46 | ActorDimensionKeeper* createDimensionKeeper(const al::LiveActor* actor); |
| 47 | void updateDimensionKeeper(ActorDimensionKeeper* keeper); |
| 48 | |
| 49 | const char* getSpecialPurposeName2DOnly(); |
| 50 | void createAndSetFilter2DOnly(al::LiveActor* actor); |
| 51 | al::CollisionPartsFilterOnlySpecialPurpose* createCollisionPartsFilter2DOnly(); |
| 52 | |
| 53 | bool is2D(const IUseDimension* dimension); |
| 54 | bool isIn2DArea(const IUseDimension* dimension); |
| 55 | bool isChange2D(const IUseDimension* dimension); |
| 56 | bool isChange3D(const IUseDimension* dimension); |
| 57 | bool is3D(const IUseDimension* dimension); |
| 58 | void snap2D(al::LiveActor* actor, const IUseDimension* dimension, f32 unk_distance); |
| 59 | void snap2DGravity(al::LiveActor* actor, const IUseDimension* dimension, f32 unk_distance); |
| 60 | |
| 61 | } // namespace rs |
| 62 | |