From 3d79dbd8cce7b2a82232aa95216fa61d8ab1fdc2 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 17 Jan 2015 01:47:36 +0000 Subject: [PATCH] Fixed crash trying to update simple cameras. --- common/camera.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/camera.cpp b/common/camera.cpp index a0450066..0df1500f 100644 --- a/common/camera.cpp +++ b/common/camera.cpp @@ -446,9 +446,12 @@ void lcCamera::Move(lcStep Step, bool AddKey, const lcVector3& Distance) void lcCamera::UpdatePosition(lcStep Step) { - mPosition = CalculateKey(mPositionKeys, Step); - mTargetPosition = CalculateKey(mTargetPositionKeys, Step); - mUpVector = CalculateKey(mUpVectorKeys, Step); + if (!IsSimple()) + { + mPosition = CalculateKey(mPositionKeys, Step); + mTargetPosition = CalculateKey(mTargetPositionKeys, Step); + mUpVector = CalculateKey(mUpVectorKeys, Step); + } lcVector3 FrontVector(mPosition - mTargetPosition); lcVector3 SideVector = lcCross(FrontVector, mUpVector);