| 1 | #pragma once |
| 2 | |
| 3 | #include <gfx/seadProjection.h> |
| 4 | #include <math/seadMatrix.h> |
| 5 | |
| 6 | namespace al { |
| 7 | |
| 8 | class Projection { |
| 9 | public: |
| 10 | Projection(); |
| 11 | Projection(const Projection& other); |
| 12 | Projection(f32 top, f32 bottom, f32 left, f32 right); |
| 13 | |
| 14 | void init(); |
| 15 | void calcMtx(); |
| 16 | void copyFrom(const Projection&); |
| 17 | f32 getTop() const; |
| 18 | f32 getBottom() const; |
| 19 | f32 getLeft() const; |
| 20 | f32 getRight() const; |
| 21 | f32 getNear() const; |
| 22 | f32 getFar() const; |
| 23 | void setProjTBLRNF(f32 top, f32 bottom, f32 left, f32 right, f32 near, f32 far); |
| 24 | void setProj(f32 top, f32 bottom, f32 left, f32 right); |
| 25 | void setFovy(f32 fovy); |
| 26 | void setAspect(f32 aspect); |
| 27 | void setNear(f32 near); |
| 28 | void setFar(f32 far); |
| 29 | f32 calcNearClipHeight(); |
| 30 | f32 calcNearClipWidth(); |
| 31 | void setTop(f32 top); |
| 32 | void setBottom(f32 bottom); |
| 33 | void setLeft(f32 left); |
| 34 | void setRight(f32 right); |
| 35 | void setOffset(const sead::Vector2f& offset); |
| 36 | void merge(const Projection& proj1, const Projection& proj2); |
| 37 | f32 getAspect() const; |
| 38 | const sead::Vector2f& getOffset() const; |
| 39 | f32 getFovy() const; |
| 40 | const sead::Matrix44f& getProjMtx() const; |
| 41 | const sead::Matrix44f& getProjInvMtx() const; |
| 42 | |
| 43 | const sead::Matrix44f& getMtxStd() const { return mStdMtx; } |
| 44 | |
| 45 | const sead::Projection& getProjectionSead() const { return mBase; } |
| 46 | |
| 47 | private: |
| 48 | sead::PerspectiveProjection mBase; |
| 49 | sead::Matrix44f _bc; |
| 50 | sead::Matrix44f mInvMtx; |
| 51 | sead::Matrix44f mStdMtx; |
| 52 | sead::Matrix44f _17c; |
| 53 | f32 mLeft; |
| 54 | f32 mBottom; |
| 55 | f32 mNear; |
| 56 | f32 mRight; |
| 57 | f32 mTop; |
| 58 | f32 mFar; |
| 59 | f32 mFovy; |
| 60 | f32 mFocalLength; |
| 61 | f32 mAspect; |
| 62 | sead::Vector2f mOffset; |
| 63 | }; |
| 64 | |
| 65 | } // namespace al |
| 66 | |