Kutu_Kucing

visible

Sep 28th, 2018
668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.58 KB | None | 0 0
  1. class i3PhysixResult
  2. {
  3. public:
  4.     float GetDistanceResult()
  5.     {
  6.     return *(float*)(this + 0x28);
  7.     }
  8. };
  9. class i3PhysixContext
  10. {
  11. public:
  12.     i3PhysixResult * RaycastClosest(i3CollideeLine* pLine, int dwOption,unsigned int dwOption2)
  13.     {
  14.             typedef i3PhysixResult* (__thiscall * tRaycastClosest)(i3PhysixContext* Base, i3CollideeLine* pLine, int dwOption,unsigned int dwOption2);
  15.             tRaycastClosest RaycastClosest = (tRaycastClosest)(oMemoryBase.dwRaycastClosest);
  16.             return RaycastClosest(this, pLine, dwOption,dwOption2);
  17.     }
  18. };
  19. class i3Viewer
  20. {
  21. public:
  22.     i3PhysixContext* Geti3PhysixContext(void)
  23.     {
  24.         return (i3PhysixContext*)*(DWORD*)(this + 0xC);
  25.     }
  26.     static i3Viewer * pi3Viewer()
  27.     {
  28.         return (i3Viewer*)(*(DWORD*)(oMemoryBase.dwi3Viewer));
  29.     }
  30. };
  31. bool isVisible(unsigned long TargetAvatar,unsigned long LocalAvatar)
  32. {
  33.         if (LocalAvatar < 0)return false;
  34.         i3CollideeLine* Line = i3CollideeLine::Singleton();
  35.        
  36.         if (Line == NULL)return false;
  37.         D3DXVECTOR3 vTarget, vLocal;
  38.         GetMatrixArray(vLocal, LocalAvatar,0);
  39.         GetMatrixArray(vTarget, TargetAvatar,0);
  40.         vLocal.y += 0.1f;
  41.         Line->SetStart((D3DXVECTOR3*)&vLocal);
  42.         Line->SetEnd((D3DXVECTOR3*)&vTarget);
  43.         i3PhysixResult* PhysixHitResult = i3Viewer::pi3Viewer()->Geti3PhysixContext()->RaycastClosest(Line,0,-1);
  44.         if (PhysixHitResult == NULL)return false;
  45.    
  46.             return (PhysixHitResult->GetDistanceResult() >= DistanceBetweenVector(vTarget,vLocal));
  47. }
  48. oMemoryBase.dwRaycastClosest    = (DWORD)GetProcAddress(LoadLibraryA("i3SceneDx.dll"),"?RaycastClosest@i3PhysixContext@@QAEPAUI3_PHYSIX_HIT_RESULT@@PAVi3CollideeLine@@HI@Z");
Advertisement
Add Comment
Please, Sign In to add comment