mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 15:52:09 +00:00
- 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.)
This commit is contained in:
parent
b6af4677f3
commit
0f8f08edfd
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue