mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 13:07:42 +00:00
CSegId: Add member functions for querying validity
Allows querying validity of segment IDs without hardcoding the magic value that signifies an invalid ID.
This commit is contained in:
@@ -250,9 +250,9 @@ void CCinematicCamera::CalculateMoveOutofIntoEyePosition(bool outOfEye, CStateMa
|
||||
if (const CModelData* mData = act->GetModelData()) {
|
||||
if (const CAnimData* aData = mData->GetAnimationData()) {
|
||||
if (const CAnimTreeNode* root = aData->GetRootAnimationTree().get()) {
|
||||
CSegId lEye = aData->GetLocatorSegId("L_eye"sv);
|
||||
CSegId rEye = aData->GetLocatorSegId("R_eye"sv);
|
||||
if (lEye != 0xff && rEye != 0xff) {
|
||||
const CSegId lEye = aData->GetLocatorSegId("L_eye"sv);
|
||||
const CSegId rEye = aData->GetLocatorSegId("R_eye"sv);
|
||||
if (lEye.IsValid() && rEye.IsValid()) {
|
||||
CCharAnimTime time = outOfEye ? CCharAnimTime(0.f) : root->VGetSteadyStateAnimInfo().GetDuration();
|
||||
CCharAnimTime* pTime = outOfEye ? nullptr : &time;
|
||||
eyePos = ((act->GetTransform() * mData->GetScaledLocatorTransformDynamic("L_eye"sv, pTime)).origin +
|
||||
|
||||
Reference in New Issue
Block a user