mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
EngineTrace improvements
Add server's EngineTrace to SDK, unfortunately it does not have a exposed factory interface unlike the client's version.
This commit is contained in:
parent
15429d3f8f
commit
4ca0146499
@ -6,13 +6,21 @@
|
||||
#include "mathlib/mathlib.h"
|
||||
|
||||
class CEngineTrace : public IEngineTrace
|
||||
{
|
||||
public:
|
||||
};
|
||||
{};
|
||||
|
||||
/* ==== CENGINETRACE ======================================================================================================================================================= */
|
||||
#ifndef CLIENT_DLL
|
||||
class CEngineTraceServer : public CEngineTrace
|
||||
{};
|
||||
inline CEngineTraceServer* g_pEngineTraceServer = nullptr;
|
||||
inline CEngineTraceServer* g_pEngineTraceServerVFTable = nullptr;
|
||||
#endif // CLIENT_DLL
|
||||
#ifndef DEDICATED
|
||||
|
||||
inline CEngineTrace* g_pEngineTrace = nullptr;
|
||||
class CEngineTraceClient : public CEngineTrace
|
||||
{};
|
||||
inline CEngineTraceClient* g_pEngineTraceClient = nullptr;
|
||||
#endif // DEDICATED
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void CEngineTrace_Attach();
|
||||
@ -21,10 +29,25 @@ void CEngineTrace_Detach();
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class VEngineTrace : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const { }
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
spdlog::debug("| VAR: g_pEngineTraceServer : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pEngineTraceServer));
|
||||
#endif // CLIENT_DLL
|
||||
#ifndef DEDICATED
|
||||
spdlog::debug("| VAR: g_pEngineTraceClient : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pEngineTraceClient));
|
||||
#endif // DEDICATED
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
}
|
||||
virtual void GetFun(void) const { }
|
||||
virtual void GetVar(void) const { }
|
||||
virtual void GetCon(void) const { }
|
||||
virtual void GetCon(void) const
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
g_pEngineTraceServerVFTable = g_GameDll.GetVirtualMethodTable(".?AVCEngineTraceServer@@").RCast<CEngineTraceServer*>();
|
||||
g_pEngineTraceServer = reinterpret_cast<CEngineTraceServer*>(&g_pEngineTraceServerVFTable); // Must be done for virtual calls.
|
||||
#endif // CLIENT_DLL
|
||||
}
|
||||
virtual void Attach(void) const { }
|
||||
virtual void Detach(void) const { }
|
||||
};
|
||||
|
@ -84,7 +84,7 @@ bool CModAppSystemGroup::Create(CModAppSystemGroup* pModAppSystemGroup)
|
||||
|
||||
#ifndef DEDICATED
|
||||
g_pClientEntityList = g_pFactory->GetFactoryPtr(VCLIENTENTITYLIST_INTERFACE_VERSION, false).RCast<CClientEntityList*>();
|
||||
g_pEngineTrace = g_pFactory->GetFactoryPtr(INTERFACEVERSION_ENGINETRACE_CLIENT, false).RCast<CEngineTrace*>();
|
||||
g_pEngineTraceClient = g_pFactory->GetFactoryPtr(INTERFACEVERSION_ENGINETRACE_CLIENT, false).RCast<CEngineTraceClient*>();
|
||||
|
||||
g_pImGuiConfig->Load(); // Load ImGui configs.
|
||||
for (auto& map : g_pCVar->DumpToMap())
|
||||
|
@ -12,15 +12,53 @@
|
||||
#pragma once
|
||||
#endif
|
||||
#include "..\gametrace.h"
|
||||
#include "..\ihandleentity.h"
|
||||
#include "ICollideable.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// The standard trace filter... NOTE: Most normal traces inherit from CTraceFilter!!!
|
||||
//-----------------------------------------------------------------------------
|
||||
enum TraceType_t
|
||||
{
|
||||
TRACE_EVERYTHING = 0,
|
||||
TRACE_WORLD_ONLY, // NOTE: This does *not* test static props!!!
|
||||
TRACE_ENTITIES_ONLY, // NOTE: This version will *not* test static props
|
||||
TRACE_EVERYTHING_FILTER_PROPS, // NOTE: This version will pass the IHandleEntity for props through the filter, unlike all other filters
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Classes are expected to inherit these + implement the ShouldHitEntity method
|
||||
//-----------------------------------------------------------------------------
|
||||
abstract_class ITraceFilter
|
||||
{
|
||||
public:
|
||||
virtual ~ITraceFilter() {};
|
||||
virtual bool ShouldHitEntity(IHandleEntity* pEntity, int contentsMask) { return false; };
|
||||
virtual TraceType_t GetTraceType() const { return TRACE_EVERYTHING; };
|
||||
virtual bool Unknown() const { return false; };
|
||||
};
|
||||
|
||||
class CTraceFilter : public ITraceFilter
|
||||
{
|
||||
public:
|
||||
virtual TraceType_t GetTraceType() const
|
||||
{
|
||||
return TRACE_EVERYTHING;
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
abstract_class IEngineTrace
|
||||
{
|
||||
public:
|
||||
virtual void stub_0() const = 0;
|
||||
virtual void stub_1() const = 0;
|
||||
virtual void ClipRayToCollideable(__m128* a2, unsigned int a3, __int64* a4, void* a5) = 0;
|
||||
virtual void TraceRay(const Ray_t& ray, unsigned int fMask, void* tracefilter, trace_t pTrace) = 0;
|
||||
virtual void TraceRay(const Ray_t& ray, unsigned int fMask, trace_t pTrace) = 0;
|
||||
virtual void ClipRayToCollideable(const Ray_t& ray, unsigned int fMask, ICollideable* pEntity, trace_t* pTrace) = 0;
|
||||
virtual void TraceRayFiltered(const Ray_t& ray, unsigned int fMask, ITraceFilter* pTracefilter, trace_t* pTrace) = 0;
|
||||
virtual void TraceRay(const Ray_t& ray, unsigned int fMask, trace_t* pTrace) = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // ENGINE_IENGINETRACE_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user