Changed: #1469 Correction of the algorithm to compute the current look at direction

--HG--
branch : gsoc2012-fabien
hg/feature/gsoc2012-fabien
Fabien_HENON 13 years ago
parent 39d4791628
commit f5912260b2

@ -140,11 +140,8 @@ NLMISC::CVector ICameraAnimationStepPlayer::computeCurrentLookAtDir(float ratio,
// We multiply this vector by the ratio so that we can have a vector that represent the current position we are looking at
startToFinal = startToFinal * ratio;
// We compute the position we are looking at
NLMISC::CVector currLookAtPos = startDir + startToFinal;
// We compute the direction
NLMISC::CVector currLookAtDir = currLookAtPos - currPos;
// We compute the direction we are looking at
NLMISC::CVector currLookAtDir = startDir + startToFinal;
currLookAtDir.normalize();
return currLookAtDir;

@ -82,14 +82,11 @@ public:
float ratio = currCamInfo.ElapsedTimeSinceStartStep / getDuration();
// We compute the starting look at direction
NLMISC::CVector startDir = currCamInfo.CamLookAtDir - currCamInfo.CamPos;
// We compute the final look at direction
NLMISC::CVector finalDir = resolvePositionOrEntityPosition(LookAtPos) - currCamInfo.CamPos;
// We get the current look at direction
camInfo.CamLookAtDir = computeCurrentLookAtDir(ratio, camInfo.CamPos, startDir, finalDir);
camInfo.CamLookAtDir = computeCurrentLookAtDir(ratio, camInfo.CamPos, currCamInfo.CamLookAtDir, finalDir);
return camInfo;
}

Loading…
Cancel
Save