SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
BaseMatrixFollowTargetHolder.cpp
1#include "Game/Util/BaseMatrixFollowTargetHolder.hpp"
2
3BaseMatrixFollower::BaseMatrixFollower(NameObj *pObj, const JMapInfoIter &rIter) {
4 mFollowerObj = pObj;
5 mLinkInfo = 0;
6 mFollowTarget = 0;
7 mFollowID = -1;
8 MR::getJMapInfoFollowID(rIter, &mFollowID);
9 mLinkInfo = new JMapLinkInfo(rIter, false);
10}
11
12NameObj* BaseMatrixFollower::getFollowTargetActor() const {
13 return mFollowTarget->mActor;
14}
15
16/*
17void BaseMatrixFollower::calcFollowMatrix(TPos3f *pOut) const {
18 MtxPtr baseMtx = mFollowTarget->getHostBaseMtx();
19 pOut->set((const TMtx34f)&baseMtx);
20 pOut->concat((const TMtx34f)&pOut, mFollowTarget->_0);
21}*/
22
23bool BaseMatrixFollower::isEnableFollow() const {
24 BaseMatrixFollowTarget* targ = mFollowTarget;
25
26 if (targ == 0) {
27 return false;
28 }
29
30 return targ->mActor;
31}
32
33bool BaseMatrixFollower::isValid() const {
34 return mFollowTarget->isValid(mFollowID);
35}
36
37BaseMatrixFollowTarget::BaseMatrixFollowTarget(const JMapLinkInfo *pInfo) {
38 mLinkInfo = pInfo;
39 _30 = 0;
40 mActor = 0;
41 mValidater = 0;
42 _0.identity();
43}
44
45void BaseMatrixFollowTarget::set(LiveActor *pActor, const TPos3f &a2, const TPos3f *a3, BaseMatrixFollowValidater *pValidator) {
46 mValidater = pValidator;
47 mActor = pActor;
48 _0.set(a2);
49 _0.invert(_0);
50
51 if (a3) {
52 _30 = a3;
53 }
54}
55
56const MtxPtr BaseMatrixFollowTarget::getHostBaseMtx() const {
57 if (!_30) {
58 return mActor->getBaseMtx();
59 }
60
61 // MtxPtr and TPos3f are both 3 x 4 matricies, so this is fine
62 return (const MtxPtr)_30;
63}
64
65bool BaseMatrixFollowTarget::isValid(s32 followId) const {
66 if (mValidater) {
67 return mValidater->isValid(followId);
68 }
69
70 return true;
71}
72
73BaseMatrixFollowTargetHolder::~BaseMatrixFollowTargetHolder() {
74
75}
The basis of a drawable actor that can contain states (see: Nerve)
Definition LiveActor.hpp:24
virtual MtxPtr getBaseMtx() const
Gets the base matrix of the model used for the actor.
The most basic form of an object.
Definition NameObj.hpp:11