From 0f8f08edfd5c9657f5429ad332ad57fe2ec4a53e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 3 May 2016 19:24:28 +0200 Subject: [PATCH] - fixed: camera facing sprites need to orient themselves toward the actual camera position, not the view actor (which may be invalid or in a completely different part of the map if a portal is being rendered.) --- src/gl/scene/gl_sprite.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index 3f90b251e..c85de8a0d 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -287,8 +287,8 @@ void GLSprite::Draw(int pass) if (drawBillboardFacingCamera) { // [CMB] Rotate relative to camera XY position, not just camera direction, // which is nicer in VR - float xrel = xcenter - GLRenderer->mViewActor->X(); - float yrel = ycenter - GLRenderer->mViewActor->Y(); + float xrel = xcenter - ViewPos.X; + float yrel = ycenter - ViewPos.Y; float absAngleDeg = RAD2DEG(atan2(-yrel, xrel)); float counterRotationDeg = 270. - GLRenderer->mAngles.Yaw.Degrees; // counteracts existing sprite rotation float relAngleDeg = counterRotationDeg + absAngleDeg;