summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-01-29 12:00:40 +0100
committerSergeanur <s.anureev@yandex.ua>2020-01-29 12:00:40 +0100
commit81de0e0cbd7d3834c71282348ce61b69474a01e8 (patch)
tree4fd0e0bc5390b85215d59e95e651a959cca71e8a /src/peds
parentreadme change (diff)
downloadre3-81de0e0cbd7d3834c71282348ce61b69474a01e8.tar
re3-81de0e0cbd7d3834c71282348ce61b69474a01e8.tar.gz
re3-81de0e0cbd7d3834c71282348ce61b69474a01e8.tar.bz2
re3-81de0e0cbd7d3834c71282348ce61b69474a01e8.tar.lz
re3-81de0e0cbd7d3834c71282348ce61b69474a01e8.tar.xz
re3-81de0e0cbd7d3834c71282348ce61b69474a01e8.tar.zst
re3-81de0e0cbd7d3834c71282348ce61b69474a01e8.zip
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/PedIK.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/peds/PedIK.cpp b/src/peds/PedIK.cpp
index c8f0409f..bfc9186d 100644
--- a/src/peds/PedIK.cpp
+++ b/src/peds/PedIK.cpp
@@ -344,11 +344,11 @@ void
CPedIK::ExtractYawAndPitchWorld(RwMatrixTag *mat, float *yaw, float *pitch)
{
float f = clamp(DotProduct(mat->up, CVector(0.0f, 1.0f, 0.0f)), -1.0f, 1.0f);
- *yaw = HALFPI - Atan2(f, Sqrt(1.0f - f * f));
+ *yaw = Acos(f);
if (mat->up.x > 0.0f) *yaw = -*yaw;
f = clamp(DotProduct(mat->right, CVector(0.0f, 0.0f, 1.0f)), -1.0f, 1.0f);
- *pitch = HALFPI - Atan2(f, Sqrt(1.0f - f * f));
+ *pitch = Acos(f);
if (mat->up.z > 0.0f) *pitch = -*pitch;
}
@@ -356,11 +356,11 @@ void
CPedIK::ExtractYawAndPitchLocal(RwMatrixTag *mat, float *yaw, float *pitch)
{
float f = clamp(DotProduct(mat->at, CVector(0.0f, 0.0f, 1.0f)), -1.0f, 1.0f);
- *yaw = HALFPI - Atan2(f, Sqrt(1.0f - f * f));
+ *yaw = Acos(f);
if (mat->at.y > 0.0f) *yaw = -*yaw;
f = clamp(DotProduct(mat->right, CVector(1.0f, 0.0f, 0.0f)), -1.0f, 1.0f);
- *pitch = HALFPI - Atan2(f, Sqrt(1.0f - f * f));
+ *pitch = Acos(f);
if (mat->up.x > 0.0f) *pitch = -*pitch;
}