mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
mathlib.c port
This commit is contained in:
parent
4189af8b50
commit
4d4a7d49d5
@ -13,6 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "mathlib.h"
|
#include "mathlib.h"
|
||||||
#include "eiface.h"
|
#include "eiface.h"
|
||||||
@ -308,6 +309,7 @@ SinCos
|
|||||||
*/
|
*/
|
||||||
void SinCos( float radians, float *sine, float *cosine )
|
void SinCos( float radians, float *sine, float *cosine )
|
||||||
{
|
{
|
||||||
|
#if _MSC_VER == 1200
|
||||||
_asm
|
_asm
|
||||||
{
|
{
|
||||||
fld dword ptr [radians]
|
fld dword ptr [radians]
|
||||||
@ -319,6 +321,10 @@ void SinCos( float radians, float *sine, float *cosine )
|
|||||||
fstp dword ptr [edx]
|
fstp dword ptr [edx]
|
||||||
fstp dword ptr [eax]
|
fstp dword ptr [eax]
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
*sine = sinf(radians);
|
||||||
|
*cosine = cosf(radians);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
float VectorNormalizeLength2( const vec3_t v, vec3_t out )
|
float VectorNormalizeLength2( const vec3_t v, vec3_t out )
|
||||||
@ -735,4 +741,4 @@ void QuaternionSlerp( const vec4_t p, const vec4_t q, float t, vec4_t qt )
|
|||||||
QuaternionAlign( p, q, q2 );
|
QuaternionAlign( p, q, q2 );
|
||||||
|
|
||||||
QuaternionSlerpNoAlign( p, q2, t, qt );
|
QuaternionSlerpNoAlign( p, q2, t, qt );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user