Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class i3PhysixResult
- {
- public:
- float GetDistanceResult()
- {
- return *(float*)(this + 0x28);
- }
- };
- class i3PhysixContext
- {
- public:
- i3PhysixResult * RaycastClosest(i3CollideeLine* pLine, int dwOption,unsigned int dwOption2)
- {
- typedef i3PhysixResult* (__thiscall * tRaycastClosest)(i3PhysixContext* Base, i3CollideeLine* pLine, int dwOption,unsigned int dwOption2);
- tRaycastClosest RaycastClosest = (tRaycastClosest)(oMemoryBase.dwRaycastClosest);
- return RaycastClosest(this, pLine, dwOption,dwOption2);
- }
- };
- class i3Viewer
- {
- public:
- i3PhysixContext* Geti3PhysixContext(void)
- {
- return (i3PhysixContext*)*(DWORD*)(this + 0xC);
- }
- static i3Viewer * pi3Viewer()
- {
- return (i3Viewer*)(*(DWORD*)(oMemoryBase.dwi3Viewer));
- }
- };
- bool isVisible(unsigned long TargetAvatar,unsigned long LocalAvatar)
- {
- if (LocalAvatar < 0)return false;
- i3CollideeLine* Line = i3CollideeLine::Singleton();
- if (Line == NULL)return false;
- D3DXVECTOR3 vTarget, vLocal;
- GetMatrixArray(vLocal, LocalAvatar,0);
- GetMatrixArray(vTarget, TargetAvatar,0);
- vLocal.y += 0.1f;
- Line->SetStart((D3DXVECTOR3*)&vLocal);
- Line->SetEnd((D3DXVECTOR3*)&vTarget);
- i3PhysixResult* PhysixHitResult = i3Viewer::pi3Viewer()->Geti3PhysixContext()->RaycastClosest(Line,0,-1);
- if (PhysixHitResult == NULL)return false;
- return (PhysixHitResult->GetDistanceResult() >= DistanceBetweenVector(vTarget,vLocal));
- }
- 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