Add other trace_t members into TraceResult

This commit is contained in:
SlynxCZ 2026-02-27 22:34:35 +01:00
parent 2d32412819
commit 60c1273145
6 changed files with 320 additions and 244 deletions

View file

@ -119,7 +119,7 @@ namespace RayTracePlugin
return nullptr;
}
const char* IPlugin::GetAuthor() { return "Slynx"; }
const char* IPlugin::GetAuthor() { return "Slynx, contributors"; }
const char* IPlugin::GetName() { return "RayTrace"; }
const char* IPlugin::GetDescription() { return "RayTrace Metamod plugin for CS2 servers."; }
const char* IPlugin::GetURL() { return "https://slynxdev.cz"; }

View file

@ -73,15 +73,35 @@ namespace RayTracePlugin::RayTrace
&filterInc, &tr);
TraceResult r{};
r.StartPosX = tr.m_vStartPos.x;
r.StartPosY = tr.m_vStartPos.y;
r.StartPosZ = tr.m_vStartPos.z;
r.EndPosX = tr.m_vEndPos.x;
r.EndPosY = tr.m_vEndPos.y;
r.EndPosZ = tr.m_vEndPos.z;
r.HitEntity = tr.m_pEnt;
r.Fraction = tr.m_flFraction;
r.AllSolid = tr.m_bStartInSolid;
r.HitPointX = tr.m_vHitPoint.x;
r.HitPointY = tr.m_vHitPoint.y;
r.HitPointZ = tr.m_vHitPoint.z;
r.NormalX = tr.m_vHitNormal.x;
r.NormalY = tr.m_vHitNormal.y;
r.NormalZ = tr.m_vHitNormal.z;
r.Fraction = tr.m_flFraction;
r.HitOffset = tr.m_flHitOffset;
r.TriangleIndex = tr.m_nTriangle;
r.HitboxBoneIndex = tr.m_nHitboxBoneIndex;
r.Contents = tr.m_nContents;
r.RayType = static_cast<int>(tr.m_eRayType);
r.AllSolid = tr.m_bStartInSolid;
r.ExactHitPoint = tr.m_bExactHitPoint;
r.HitEntity = tr.m_pEnt;
r.Hitbox = const_cast<CHitBox *>(tr.m_pHitbox);
r.SurfaceProps = const_cast<CPhysSurfaceProperties *>(tr.m_pSurfaceProperties);
r.BodyHandle = tr.m_hBody;
r.ShapeHandle = tr.m_hShape;
r.BodyTransform = tr.m_BodyTransform;
r.ShapeAttributes = tr.m_ShapeAttributes;
return r;
}