summaryrefslogtreecommitdiff
path: root/src/d/col/c/c_bg_s_poly_info.cpp
blob: c1f4ecb48fce1fa26de78608f40290604c71e975 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

#include "d/col/c/c_bg_s_poly_info.h"

#include "d/col/bg/d_bg_s.h"

bool cBgS_PolyInfo::ChkSetInfo() const {
    if (mPolyIndex == 0xFFFF || mBgIndex == BG_ID_MAX) {
        return false;
    }
    return true;
}

void cBgS_PolyInfo::SetPolyInfo(const cBgS_PolyInfo &other) {
    *this = other;
}

bool cBgS_PolyInfo::ChkSafe(const void *pBg, s32 id) const {
    if (unk_0x04 == pBg && mActorPId == id) {
        return true;
    }
    return false;
}

bool cBgS_PolyInfo::ChkBgIndex() const {
    return mBgIndex != BG_ID_MAX;
}

mAng cBgS_PolyInfo::GetAngle(mAng angle) const {
    cM3dGPla pla;
    if (!dBgS::GetInstance()->GetTriPla(*this, &pla)) {
        return mAng(0);
    } else {
        return pla.GetAngle(angle);
    }
}