Code:
void inline ASMSinCos( float rad, float *sin, float *cos )
{
#ifdef _MSC_VER // This routine seems to be M$ specific...
_asm
{
fld DWORD PTR[rad]
fsincos
mov edx, DWORD PTR[cos]
mov eax, DWORD PTR[sin]
fstp DWORD PTR[edx]
fstp DWORD PTR[eax]
}
#else
*sin = sin(rad);
*cos = cos(rad);
#endif
}
This one is tested thoroughly without problem, anyway you might need VC Processor Pack to use this
This is much faster than just using sin() and cos(). Maybe it's useful for l33t math beasts who uses scary math routine everywhere in code.
