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 // 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; startToFinal = startToFinal * ratio;
// We compute the position we are looking at // We compute the direction we are looking at
NLMISC::CVector currLookAtPos = startDir + startToFinal; NLMISC::CVector currLookAtDir = startDir + startToFinal;
// We compute the direction
NLMISC::CVector currLookAtDir = currLookAtPos - currPos;
currLookAtDir.normalize(); currLookAtDir.normalize();
return currLookAtDir; return currLookAtDir;

@ -82,14 +82,11 @@ public:
float ratio = currCamInfo.ElapsedTimeSinceStartStep / getDuration(); 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 // We compute the final look at direction
NLMISC::CVector finalDir = resolvePositionOrEntityPosition(LookAtPos) - currCamInfo.CamPos; NLMISC::CVector finalDir = resolvePositionOrEntityPosition(LookAtPos) - currCamInfo.CamPos;
// We get the current look at direction // 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; return camInfo;
} }

Loading…
Cancel
Save