Răsfoiți Sursa

Fixed euler angles not being set in Enity::lookAt

Ivan Safrin 11 ani în urmă
părinte
comite
d56bffaf46
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  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) {	
 	Matrix4 newMatrix = getLookAtMatrix(loc, upVector);
 	rotationQuat.createFromMatrix(newMatrix);
+    rotation = rotationQuat.toEulerAngles();
+    rotation = rotation * TODEGREES; 
 	matrixDirty = true;
 }