| 1 | #include "Library/Camera/ActorCameraSubTarget.h" |
|---|---|
| 2 | |
| 3 | #include "Library/LiveActor/ActorMovementFunction.h" |
| 4 | #include "Library/LiveActor/ActorPoseUtil.h" |
| 5 | #include "Library/LiveActor/LiveActor.h" |
| 6 | |
| 7 | namespace al { |
| 8 | |
| 9 | ActorCameraSubTarget::ActorCameraSubTarget(const LiveActor* actor) : mActor(actor) {} |
| 10 | |
| 11 | const char* ActorCameraSubTarget::getTargetName() const { |
| 12 | return mActor->getName(); |
| 13 | } |
| 14 | |
| 15 | void ActorCameraSubTarget::calcTrans(sead::Vector3f* trans) const { |
| 16 | trans->set(getTrans(actor: mActor)); |
| 17 | if (mOffset) { |
| 18 | sead::Vector3f side, up, front; |
| 19 | calcSide(side: &side); |
| 20 | calcUp(up: &up); |
| 21 | calcFront(front: &front); |
| 22 | *trans += side * mOffset->x + up * mOffset->y + front * mOffset->z; |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | void ActorCameraSubTarget::calcSide(sead::Vector3f* side) const { |
| 27 | calcSideDir(side, actor: mActor); |
| 28 | } |
| 29 | |
| 30 | void ActorCameraSubTarget::calcUp(sead::Vector3f* up) const { |
| 31 | calcUpDir(up, actor: mActor); |
| 32 | } |
| 33 | |
| 34 | void ActorCameraSubTarget::calcFront(sead::Vector3f* front) const { |
| 35 | calcFrontDir(front, actor: mActor); |
| 36 | } |
| 37 | |
| 38 | void ActorCameraSubTarget::calcVelocity(sead::Vector3f* velocity) const { |
| 39 | velocity->set(getVelocity(actor: mActor)); |
| 40 | } |
| 41 | |
| 42 | ActorBackAroundCameraSubTarget::ActorBackAroundCameraSubTarget(const LiveActor* actor) |
| 43 | : ActorCameraSubTarget(actor) { |
| 44 | mTargetName.format(formatStr: "%s[背後回り込み]", actor->getName()); |
| 45 | } |
| 46 | |
| 47 | void ActorBackAroundCameraSubTarget::calcTrans(sead::Vector3f* trans) const { |
| 48 | ActorCameraSubTarget::calcTrans(trans); |
| 49 | sead::Vector3f front = {0.0f, 0.0f, 0.0f}; |
| 50 | calcFrontDir(front: &front, actor: getActor()); |
| 51 | *trans += front * 200.0f; |
| 52 | } |
| 53 | } // namespace al |
| 54 |