2023-12-13 00:40:16 -05:00
|
|
|
#include "Game/LiveActor/MirrorReflectionModel.hpp"
|
|
|
|
|
#include "Game/NameObj/NameObjExecuteHolder.hpp"
|
2022-07-20 04:40:42 -04:00
|
|
|
|
|
|
|
|
MirrorReflectionModel::MirrorReflectionModel(const LiveActor *pActor, const char *pName, const char *pInternalName, MtxPtr mtx) : LiveActor(pName) {
|
|
|
|
|
_8C = pActor;
|
|
|
|
|
_90 = mtx;
|
|
|
|
|
_94 = 0;
|
|
|
|
|
|
|
|
|
|
if (mtx) {
|
|
|
|
|
TPos3f pos;
|
|
|
|
|
pos.set(mtx);
|
|
|
|
|
pos.getTrans(mPosition);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
mPosition.set(pActor->mPosition);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mRotation.set(_8C->mRotation);
|
|
|
|
|
mScale.set(_8C->mScale);
|
2023-02-13 03:33:10 -05:00
|
|
|
initModelManagerWithAnm(pInternalName, nullptr, false);
|
2022-07-20 04:40:42 -04:00
|
|
|
MR::connectToSceneMirrorMapObjDecoration(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MirrorReflectionModel::init(const JMapInfoIter &rIter) {
|
|
|
|
|
MR::invalidateClipping(this);
|
|
|
|
|
MR::registerDemoSimpleCastAll(this);
|
|
|
|
|
makeActorAppeared();
|
|
|
|
|
_94 = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MirrorReflectionModel::movement() {
|
|
|
|
|
if (MR::isDead(_8C) || MR::isClipped(_8C) || MR::isHiddenModel(_8C)) {
|
|
|
|
|
if (!_94) {
|
|
|
|
|
_94 = 1;
|
|
|
|
|
|
|
|
|
|
if (!MR::isHiddenModel(this)) {
|
|
|
|
|
MR::disconnectToDrawTemporarily(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (_94) {
|
|
|
|
|
_94 = 0;
|
|
|
|
|
if (!MR::isHiddenModel(this)) {
|
|
|
|
|
MR::connectToDrawTemporarily(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LiveActor::movement();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MirrorReflectionModel::calcAnim() {
|
|
|
|
|
if (!_94) {
|
|
|
|
|
if (!MR::isDead(this)) {
|
2022-07-20 14:30:03 -04:00
|
|
|
if (MR::isNoCalcAnim(this) || MR::isClipped(this)) {
|
|
|
|
|
return;
|
2022-07-20 04:40:42 -04:00
|
|
|
}
|
2022-07-20 14:30:03 -04:00
|
|
|
|
|
|
|
|
LiveActor::calcAnim();
|
2022-07-20 04:40:42 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MirrorReflectionModel::calcViewAndEntry() {
|
|
|
|
|
if (!_94) {
|
|
|
|
|
LiveActor::calcViewAndEntry();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MirrorReflectionModel::calcAndSetBaseMtx() {
|
|
|
|
|
if (!_90) {
|
|
|
|
|
LiveActor::calcAndSetBaseMtx();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
TPos3f pos;
|
|
|
|
|
pos.set(_90);
|
|
|
|
|
pos.getTrans(mPosition);
|
|
|
|
|
MR::setBaseTRMtx(this, _90);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MirrorReflectionModel::~MirrorReflectionModel() {
|
|
|
|
|
|
|
|
|
|
}
|