mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-18 23:21:41 +00:00
Fixed camera rotation from FraggleScript
https://forum.zdoom.org/viewtopic.php?t=57559
This commit is contained in:
parent
6d6c25bb26
commit
4afface97c
1 changed files with 6 additions and 2 deletions
|
@ -2910,11 +2910,14 @@ void FParser::SF_MoveCamera(void)
|
||||||
|
|
||||||
DAngle targetangle = floatvalue(t_argv[4]);
|
DAngle targetangle = floatvalue(t_argv[4]);
|
||||||
DAngle anglespeed = floatvalue(t_argv[5]);
|
DAngle anglespeed = floatvalue(t_argv[5]);
|
||||||
DAngle diffangle = deltaangle(cam->Angles.Yaw, targetangle);
|
|
||||||
|
|
||||||
if (movespeed > 0 && anglespeed == 0.)
|
if (movespeed > 0 && anglespeed == 0.)
|
||||||
{
|
{
|
||||||
if (!finished) targetangle = diffangle * movespeed / movelen;
|
if (!finished)
|
||||||
|
{
|
||||||
|
const DAngle diffangle = targetangle - cam->Angles.Yaw;
|
||||||
|
targetangle = cam->Angles.Yaw + diffangle * movespeed / movelen;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2924,6 +2927,7 @@ void FParser::SF_MoveCamera(void)
|
||||||
cam->radius = 1 / 8192.;
|
cam->radius = 1 / 8192.;
|
||||||
cam->Height = 1 / 8192.;
|
cam->Height = 1 / 8192.;
|
||||||
cam->SetOrigin(movepos, true);
|
cam->SetOrigin(movepos, true);
|
||||||
|
cam->SetAngle(targetangle, false);
|
||||||
t_return.value.i = 1;
|
t_return.value.i = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue