Skip to content

Commit

Permalink
Area: Fix RotateArea's NewOrientation for NWN bearings
Browse files Browse the repository at this point in the history
Original math based on +90degrees being clockwise. NWN uses +90 degrees to be Anti-clockwise. Fixes the math for this..
  • Loading branch information
WilliamDraco authored Dec 3, 2023
1 parent 459d30c commit a6147c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Plugins/Area/Area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ NWNX_EXPORT ArgumentStack RotateArea(ArgumentStack&& args)
case 1:
{
vOrientation.x = (std::cos(std::acos(vOrientation.x) - (M_PI/2)));//less half-radian
vOrientation.y = (std::sin(std::asin(vOrientation.y) - (M_PI/2)));
vOrientation.y = (std::sin(std::asin(vOrientation.y) + (M_PI/2)));
break;
}
case 2:
Expand All @@ -1056,7 +1056,7 @@ NWNX_EXPORT ArgumentStack RotateArea(ArgumentStack&& args)
case 3:
{
vOrientation.x = (std::cos(std::acos(vOrientation.x) + (M_PI/2)));//Add half-radian
vOrientation.y = (std::sin(std::asin(vOrientation.y) + (M_PI/2)));
vOrientation.y = (std::sin(std::asin(vOrientation.y) - (M_PI/2)));
break;
}
}
Expand Down

0 comments on commit a6147c1

Please sign in to comment.