| 1 | #include "MapObj/PeachWorldTree.h" |
|---|---|
| 2 | |
| 3 | #include "Library/Camera/CameraUtil.h" |
| 4 | #include "Library/LiveActor/ActorInitUtil.h" |
| 5 | #include "Library/LiveActor/ActorPoseUtil.h" |
| 6 | #include "Library/Math/MathUtil.h" |
| 7 | |
| 8 | PeachWorldTree::PeachWorldTree(const char* name) : al::LiveActor(name) {} |
| 9 | |
| 10 | void PeachWorldTree::init(const al::ActorInitInfo& info) { |
| 11 | al::initActor(actor: this, initInfo: info); |
| 12 | makeActorAlive(); |
| 13 | } |
| 14 | |
| 15 | void PeachWorldTree::control() { |
| 16 | sead::Vector3f dir = al::getTrans(actor: this) - al::getCameraPos(user: this, viewIdx: 0); |
| 17 | dir.y = 0.0f; |
| 18 | if (al::tryNormalizeOrZero(out: &dir, vec: dir)) |
| 19 | al::setFront(actor: this, front: -dir); |
| 20 | } |
| 21 |