-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Library/Camera: Implement
ActorCameraSubTarget
- Loading branch information
1 parent
769899d
commit e4d1d2c
Showing
6 changed files
with
96 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#include "Library/Camera/ActorCameraSubTarget.h" | ||
|
||
#include "Library/LiveActor/ActorMovementFunction.h" | ||
#include "Library/LiveActor/ActorPoseKeeper.h" | ||
#include "Library/LiveActor/LiveActor.h" | ||
|
||
namespace al { | ||
|
||
ActorCameraSubTarget::ActorCameraSubTarget(const LiveActor* actor) : mActor(actor) {} | ||
|
||
const char* ActorCameraSubTarget::getTargetName() const { | ||
return mActor->getName(); | ||
} | ||
|
||
void ActorCameraSubTarget::calcTrans(sead::Vector3f* trans) const { | ||
trans->set(al::getTrans(mActor)); | ||
if (mOffset) { | ||
sead::Vector3f side, up, front; | ||
calcSide(&side); | ||
calcUp(&up); | ||
calcFront(&front); | ||
*trans += side * mOffset->x + up * mOffset->y + front * mOffset->z; | ||
} | ||
} | ||
|
||
void ActorCameraSubTarget::calcSide(sead::Vector3f* side) const { | ||
al::calcSideDir(side, mActor); | ||
} | ||
|
||
void ActorCameraSubTarget::calcUp(sead::Vector3f* up) const { | ||
al::calcUpDir(up, mActor); | ||
} | ||
|
||
void ActorCameraSubTarget::calcFront(sead::Vector3f* front) const { | ||
al::calcFrontDir(front, mActor); | ||
} | ||
|
||
void ActorCameraSubTarget::calcVelocity(sead::Vector3f* velocity) const { | ||
velocity->set(al::getVelocity(mActor)); | ||
} | ||
|
||
ActorBackAroundCameraSubTarget::ActorBackAroundCameraSubTarget(const LiveActor* actor) | ||
: ActorCameraSubTarget(actor) { | ||
mTargetName.format("%s[背後回り込み]", actor->getName()); | ||
} | ||
|
||
void ActorBackAroundCameraSubTarget::calcTrans(sead::Vector3f* trans) const { | ||
ActorCameraSubTarget::calcTrans(trans); | ||
sead::Vector3f front = {0.0f, 0.0f, 0.0f}; | ||
calcFrontDir(&front, getActor()); | ||
*trans += front * 200.0f; | ||
} | ||
|
||
const char* ActorBackAroundCameraSubTarget::getTargetName() const { | ||
return mTargetName.cstr(); | ||
} | ||
|
||
} // namespace al |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Library/Play/Camera/ActorCameraTarget.cpp → lib/al/Library/Camera/ActorCameraTarget.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters