Fixed crash trying to update simple cameras.

This commit is contained in:
leo 2015-01-17 01:47:36 +00:00
parent 88e935ccd8
commit 3d79dbd8cc

View file

@ -445,10 +445,13 @@ void lcCamera::Move(lcStep Step, bool AddKey, const lcVector3& Distance)
} }
void lcCamera::UpdatePosition(lcStep Step) void lcCamera::UpdatePosition(lcStep Step)
{
if (!IsSimple())
{ {
mPosition = CalculateKey(mPositionKeys, Step); mPosition = CalculateKey(mPositionKeys, Step);
mTargetPosition = CalculateKey(mTargetPositionKeys, Step); mTargetPosition = CalculateKey(mTargetPositionKeys, Step);
mUpVector = CalculateKey(mUpVectorKeys, Step); mUpVector = CalculateKey(mUpVectorKeys, Step);
}
lcVector3 FrontVector(mPosition - mTargetPosition); lcVector3 FrontVector(mPosition - mTargetPosition);
lcVector3 SideVector = lcCross(FrontVector, mUpVector); lcVector3 SideVector = lcCross(FrontVector, mUpVector);