1#include "Game/LiveActor/MirrorActor.hpp"
2#include "Game/LiveActor/MirrorCamera.hpp"
3#include "Game/NameObj/NameObjExecuteHolder.hpp"
4#include "JSystem/JMath/JMath.hpp"
6MirrorActor::~MirrorActor() {
10MirrorActor::MirrorActor(
LiveActor *pActor,
const char *a2,
const char *a3) :
LiveActor(a2) {
13 initModelManagerWithAnm(a3, 0, 0);
18 MR::connectToSceneMirrorMapObj(
this);
19 MR::copyJointAnimation(
this, _8C);
20 MR::syncMaterialAnimation(
this, _8C);
21 MR::invalidateClipping(
this);
24 MR::calcModelBoundingBox(&modelBB, _8C);
26 register TVec3f stack_14;
27 JMAVECLerp((
const Vec*)&modelBB.mMax, (
const Vec*)&modelBB.mMin, (Vec*)&stack_14, 0.5f);
28 register TVec3f stack_8(modelBB.mMax);
30 register TVec3f* ptrStack = &stack_8;
33 psq_l f1, 0x20(r1), 0, 0
34 psq_l f0, 0(ptrStack), 0, 0
35 psq_l f2, 8(ptrStack), 1, 0
37 psq_l f3, 0x28(r1), 1, 0
39 psq_st f0, 0(ptrStack), 0, 0
40 psq_st f1, 8(ptrStack), 1, 0
43 f32 mag = PSVECMag((
const Vec*)&stack_8);
47 psq_l f0, 0x14(r1), 0, 0
49 psq_st f0, 0x90(r31), 0, 0
57void MirrorActor::movement() {
58 if (MR::isDead(
this) || MR::isDead(_8C) || MR::isClipped(_8C) || MR::isHiddenModel(_8C) || isHostInTheOtherSideOfMirror()) {
62 if (!MR::isHiddenModel(
this)) {
63 MR::disconnectToDrawTemporarily(
this);
71 if (!MR::isHiddenModel(
this)) {
72 MR::connectToDrawTemporarily(
this);
76 LiveActor::movement();
80void MirrorActor::calcAnim() {
81 MR::copyJointAnimation(
this, _8C);
82 MR::updateMaterial(
this);
85void MirrorActor::calcViewAndEntry() {
91bool MirrorActor::isHostInTheOtherSideOfMirror()
const {
92 if (MR::isExistMirrorCamera()) {
94 centerPos = getHostCenterPos();
95 f32 dist = MR::getDistanceToMirror(centerPos);
The basis of a drawable actor that can contain states (see: Nerve)
ModelManager * mModelManager
A pointer to a ModelManager instance, used for drawing a 3D model.
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.