mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +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) {
|
if (drawBillboardFacingCamera) {
|
||||||
// [CMB] Rotate relative to camera XY position, not just camera direction,
|
// [CMB] Rotate relative to camera XY position, not just camera direction,
|
||||||
// which is nicer in VR
|
// which is nicer in VR
|
||||||
float xrel = xcenter - GLRenderer->mViewActor->X();
|
float xrel = xcenter - ViewPos.X;
|
||||||
float yrel = ycenter - GLRenderer->mViewActor->Y();
|
float yrel = ycenter - ViewPos.Y;
|
||||||
float absAngleDeg = RAD2DEG(atan2(-yrel, xrel));
|
float absAngleDeg = RAD2DEG(atan2(-yrel, xrel));
|
||||||
float counterRotationDeg = 270. - GLRenderer->mAngles.Yaw.Degrees; // counteracts existing sprite rotation
|
float counterRotationDeg = 270. - GLRenderer->mAngles.Yaw.Degrees; // counteracts existing sprite rotation
|
||||||
float relAngleDeg = counterRotationDeg + absAngleDeg;
|
float relAngleDeg = counterRotationDeg + absAngleDeg;
|
||||||
|
|
Loading…
Reference in a new issue