So I have this:
But when I call TraceRay, my logs keep spamming errors, so now I'm crying for help again.
I don't think my vmt index is wrong, because it was in position 5 in IEngineTrace.h.
Code:
struct Ray_t
{
Vector m_Start; // starting point, centered within the extents
Vector m_Delta; // direction + length of the ray
Vector m_StartOffset; // Add this to m_Start to get the actual ray start
Vector m_Extents; // Describes an axis aligned box extruded along a ray
bool m_IsRay; // are the extents zero?
bool m_IsSwept; // is delta != 0?
void Init( Vector const& start, Vector const& end )
{
Assert( &end );
VectorSubtract( end, start, m_Delta );
m_IsSwept = (m_Delta.LengthSqr() != 0);
VectorClear( m_Extents );
m_IsRay = true;
// Offset m_Start to be in the center of the box...
VectorClear( m_StartOffset );
VectorCopy( start, m_Start );
}
private:
};
class CBaseTrace
{
public:
bool allsolid; // if true, plane is not valid
CBaseTrace() {}
private:
// No copy constructors allowed
CBaseTrace(const CBaseTrace& vOther);
};
class CGameTrace : CBaseTrace
{
public:
CGameTrace() {}
CBaseEntity *m_pEnt;
private:
// No copy constructors allowed
CGameTrace(const CGameTrace& vOther);
};
typedef CGameTrace trace_t;
class ITraceFilter
{
public:
};
class IEngineTrace
{
public:
void TraceRay( const Ray_t &ray, unsigned int fMask, ITraceFilter *pTraceFilter,trace_t *pTrace )
{
typedef void ( __thiscall* OriginalFn )( PVOID, const Ray_t&, unsigned int, ITraceFilter *, trace_t* );
getvfunc<OriginalFn>( this, 5 )( this, ray, fMask, pTraceFilter, pTrace );
}
};
extern IEngineTrace* g_pEngineTrace;I don't think my vmt index is wrong, because it was in position 5 in IEngineTrace.h.
Aucun commentaire:
Enregistrer un commentaire