Fast sin/cos
Moderator: InsideQC Admins
1 post
• Page 1 of 1
Fast sin/cos
Lots of places in Quake where both sin and cos of an angle are calculated together. This might work for you, it might not, it might get you more speed, it might not.
- Code: Select all
__declspec (naked) void Q_sincos (float angradians, float *angsin, float *angcos)
{
__asm fld dword ptr [esp + 4]
__asm fsincos
__asm mov ebx, [esp + 12]
__asm fstp dword ptr [ebx]
__asm mov ebx, [esp + 8]
__asm fstp dword ptr [ebx]
__asm ret
}
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
1 post
• Page 1 of 1
Return to Programming Tutorials
Who is online
Users browsing this forum: No registered users and 1 guest