From 0f6a82963a63a13023dbb828dd1fc3999f85ba74 Mon Sep 17 00:00:00 2001 From: Kp Date: Tue, 2 Jun 2015 03:03:32 +0000 Subject: [PATCH] Inline fix_sincos in vm_extract_angles_matrix --- common/maths/vecmat.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/maths/vecmat.cpp b/common/maths/vecmat.cpp index e4446e08d..8bb582b3d 100644 --- a/common/maths/vecmat.cpp +++ b/common/maths/vecmat.cpp @@ -537,14 +537,16 @@ void vm_matrix_x_matrix(vms_matrix &dest,const vms_matrix &src0,const vms_matrix //extract angles from a matrix void vm_extract_angles_matrix(vms_angvec &a,const vms_matrix &m) { - fix sinh,cosh,cosp; + fix cosp; if (m.fvec.x==0 && m.fvec.z==0) //zero head a.h = 0; else a.h = fix_atan2(m.fvec.z,m.fvec.x); - fix_sincos(a.h,&sinh,&cosh); + const auto &&ah = fix_sincos(a.h); + const auto &sinh = ah.sin; + const auto &cosh = ah.cos; if (abs(sinh) > abs(cosh)) //sine is larger, so use it cosp = fixdiv(m.fvec.x,sinh);