syjgin
There are something wrong, when I try to animate my camera: it moves in wrong way. Maybe this takes place because on my move functions I have to move both camera node and separate center node:
void LevelCamera::VerticalTranslate(float amount)
{
float currentRot = _cameraNode->GetRotation().YawAngle();
Quaternion distilledRot;
distilledRot.FromAngleAxis(currentRot, Vector3(0,1,0));
Vector3 rotated = distilledRot.RotationMatrix() * Vector3(0,0,amount);
_cameraNode->Translate(rotated, TS_WORLD);
_centerPosition->Translate(rotated);
}
void LevelCamera::HorizontalTranslate(float amount)
{
float currentRot = _cameraNode->GetRotation().YawAngle();
Quaternion distilledRot;
distilledRot.FromAngleAxis(currentRot, Vector3(0,1,0));
Vector3 rotated = distilledRot.RotationMatrix() * Vector3(amount,0,0);
_cameraNode->Translate(rotated, TS_WORLD);
_centerPosition->Translate(rotated);
}
Maybe I made something wrong in camera moving? I have to remove all angles, except yaw, from camera rotation, because without this camera was moving by local axes, not rotated global: