PostPhysX Ptr + VisibilityChecks

Posts 1–2 of 2 · Page 1 of 1
PhysX Ptr + VisibilityChecks
 
Code:
at CGame+0x1DE4:
CPhysicsWrapper* m_physicswrapper; //0x1DE4


 
Code:
class CPhysicsWrapper
{
public:
char _0x0000[3228];
CPhysics* m_physics; //0x0C9C
};

class CPhysics
{
public:
char _0x0000[124];
physx::PxPhysics* m_physx_base; //0x007C
physx::PxScene* m_physx_scene; //0x0080
char _0x0084[20];
};


just get the latest SDK somehow and:

 
Code:
bool IsVisible(CObject* object)
{
if(gGame->m_physicswrapper &&
gGame->m_physicswrapper->m_physics &&
gGame->m_physicswrapper->m_physics->m_physx_scene &&
gPlayer && object)
{
physx::PxVec3 position = *(physx::PxVec3*)object->GetPosition();
physx::PxVec3 origin = *(physx::PxVec3*)gPlayer->GetPosition();

origin.y += (gPlayer->m_stanceflag&0x04)?0.95f:1.6f;
position.y += (object->m_stanceflag&0x04)?0.95f:1.6f;

physx::PxVec3 distance;
distance = position;
distance -= origin;

physx::PxReal length = distance.magnitude();
distance.normalize();

physx::PxSceneQueryHit hit;
if(gGame->m_physicswrapper->m_physics->m_physx_scene->raycastAny(origin, distance, length, hit,
physx::PxSceneQueryFilterData(physx::PxSceneQueryF ilterFlag::eSTATIC)))
return false;
else
return true;
}

return false;
}
Wait how did you get the latest SDK?i am using a SDK Gen but appears to be outdated
Posts 1–2 of 2 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us