struct IEntitySystem
{
IEntity* GetEntityFromPhysics(IPhysicalEntity* pPhysEntity) {
return _vcall<IEntity*>(this, 26, pPhysEntity);
}
};
struct IPhysicalWorld
{
struct SRWIParams
{
SRWIParams() { RtlSecureZeroMemory(this, sizeof(*this)); }
void* pForeignData;
int iForeignData;
int(__fastcall* OnEvent)(EventPhysRWIResult*);
Vec3 org;
Vec3 dir;
int objtypes;
uint32_t flags;
ray_hit* hits;
int nMaxHits;
ray_hit_cached* phitLast;
int nSkipEnts;
IPhysicalEntity** pSkipEnts;
SCollisionClass collclass;
};
int RayWorldIntersection(SRWIParams& rp, const char* pNameTag = 0, int iCaller = 4)
{
return _vcall<int>(this, 35, rp, pNameTag, iCaller);
}
int RayWorldIntersection(const Vec3& org, const Vec3& dir, int objtypes, unsigned int flags, ray_hit* hits, int nMaxHits, IPhysicalEntity* pSkipEnt, IPhysicalEntity* pSkipEntAux = 0, void* pForeignData = 0, int iForeignData = 0)
{
IPhysicalEntity* pSkipEnts[2];
int nSkipEnts = 0;
if (pSkipEnt) pSkipEnts[nSkipEnts++] = pSkipEnt;
if (pSkipEntAux) pSkipEnts[nSkipEnts++] = pSkipEntAux;
return RayWorldIntersection(org, dir, objtypes, flags, hits, nMaxHits, pSkipEnts, nSkipEnts, pForeignData, iForeignData);
}
int RayWorldIntersection(const Vec3& org, const Vec3& dir, int objtypes, unsigned int flags, ray_hit* hits, int nmaxhits, IPhysicalEntity** pSkipEnts = 0, int nSkipEnts = 0, void* pForeignData = 0, int iForeignData = 0, const char* pNameTag = 0, ray_hit_cached* phitLast = 0, int iCaller = 4)
{
SRWIParams rp;
rp.org = org;
rp.dir = dir;
rp.objtypes = objtypes;
rp.flags = flags;
rp.hits = hits;
rp.nMaxHits = nmaxhits;
rp.pForeignData = pForeignData;
rp.iForeignData = iForeignData;
rp.phitLast = phitLast;
rp.pSkipEnts = pSkipEnts;
rp.nSkipEnts = nSkipEnts;
return RayWorldIntersection(rp, 0, iCaller);
}
int GetSurfaceParameters(int surface_idx, float* bounciness, float* friction, float* damage_reduction, unsigned int* flags)
{
return _vcall<int>(this, 24, surface_idx, bounciness, friction, damage_reduction, flags);
}
int GetPhysicalEntityId(IPhysicalEntity* pent)
{
return _vcall<int>(this, 20, pent);
}
};