Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- -----------------------------------------
- * Game hacking QTS ( Quickie Tip Series )
- * no. 25 - Is player entity aiming in rect
- -----------------------------------------
- * Author: SEGnosis - GHAnon.net
- * Thanks to:
- * bitterbanana - No known site
- * Drunken Cheetah - No known site
- * fatboy88 - No known site
- * Geek4Ever - No known site
- * learn_more - www.uc-forum.com
- * Novocaine - http://ilsken.net/blog/?page_id=64
- * Philly0494 - No known site
- * Roverturbo - www.uc-forum.com
- * SilentKarma - www.halocoders.com - offline
- * Strife - www.uc-forum.com
- * Wieter20 - No known site
- */
- bool C_Entity_Manager::IsPlayerEntityAimingInRect( C_Player_Entity* pEntity, FVect3 vA, float fWidth )
- {
- FTrigFunc vTrig;
- vTrig.cosine = cosf( pEntity->m_vView.yaw );
- vTrig.sine = sinf( pEntity->m_vView.yaw );
- FVect3 vDistance;
- vA.y -= PMH_CROUCH;
- PointDifference( pEntity->m_vPos, vA, vDistance );
- double fDistance = PointProduct( vDistance );
- float fHeight = fWidth * 2.5f;
- FVect3 vPoint = { pEntity->m_vPos.x + ( vTrig.sine * fDistance ), pEntity->m_vPos.y + ( -pEntity->m_vView.pitch * fDistance ), pEntity->m_vPos.z + ( vTrig.cosine * fDistance ) };
- if( vPoint.x >= vA.x-fWidth && vPoint.x <= vA.x+fWidth &&
- vPoint.z >= vA.z-fWidth && vPoint.z <= vA.z+fWidth &&
- vPoint.y >= vA.y && vPoint.y <= vA.y+fHeight )
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement