Преглед изворни кода

Fixed euler angles not being set in Enity::lookAt

Ivan Safrin пре 11 година
родитељ
комит
d56bffaf46
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      Core/Contents/Source/PolyEntity.cpp

+ 2 - 0
Core/Contents/Source/PolyEntity.cpp

@@ -241,6 +241,8 @@ Matrix4 Entity::getLookAtMatrix(const Vector3 &loc, const Vector3 &upVector) {
 void Entity::lookAt(const Vector3 &loc, const Vector3 &upVector) {	
 void Entity::lookAt(const Vector3 &loc, const Vector3 &upVector) {	
 	Matrix4 newMatrix = getLookAtMatrix(loc, upVector);
 	Matrix4 newMatrix = getLookAtMatrix(loc, upVector);
 	rotationQuat.createFromMatrix(newMatrix);
 	rotationQuat.createFromMatrix(newMatrix);
+    rotation = rotationQuat.toEulerAngles();
+    rotation = rotation * TODEGREES; 
 	matrixDirty = true;
 	matrixDirty = true;
 }
 }