NordCFW
IT Specialist/Security Enthusiast
- Messages
- 109
- Reaction score
- 21
- Points
- 888
Code:
D3DXVECTOR4 aim,head,Targetspeed,localpos;
float delay=distance/bulletspeed;
head.y+=(0.5*9.81*delay*delay);
head=head+(delay*Targetspeed);
aim=head-localpos;
float Pitch = (float)atan2(-aim.y, sqrt(aim.x*aim.x+aim.z*aim.z));
float Yaw = (float)atan2(aim.x, aim.z);
pPM->m_localPlayer->getSoldier()->getCurrentWeapon()->m_authorativeAiming->m_fpsAimer->m_yaw=-Yaw;
pPM->m_localPlayer->getSoldier()->getCurrentWeapon()->m_authorativeAiming->m_fpsAimer->m_pitch=-Pitch;
Credits:Rhin