CEngineTrace init

This commit is contained in:
Marvin D 2022-10-13 16:48:56 +02:00
parent fb7f77f7cb
commit 82c60c466a
5 changed files with 120 additions and 0 deletions

View File

@ -0,0 +1,18 @@
//============================================================================//
//
// Purpose: Ray Tracing
//
//============================================================================//
#include "core/stdafx.h"
#include "engine/enginetrace.h"
void CEngineTrace_Attach()
{
}
void CEngineTrace_Dettach()
{
}

View File

@ -0,0 +1,92 @@
#pragma once
#include "mathlib/mathlib.h"
// EVERYTHING IN HERE STILL NEEDS TESTING!!!!
struct Ray_t
{
VectorAligned m_Start;
VectorAligned m_Delta;
VectorAligned m_StartOffset;
VectorAligned m_Extents;
char gap2C[0x10];
void* m_pWorldAxisTransform;
bool m_IsRay;
bool m_IsSwept;
void Init(Vector3D const& start, Vector3D const& end)
{
m_Delta = end - start;
m_IsSwept = (m_Delta.LengthSqr() != 0);
m_Extents.Init();
m_pWorldAxisTransform = NULL;
m_IsRay = true;
m_StartOffset.Init();
m_Start = start;
}
};
struct csurface_t
{
const char* name;
int surfaceProp;
uint16_t flags;
};
struct trace_t
{
Vector3D start;
float unk1;
Vector3D endpos;
float unk2;
cplane_t plane;
float fraction;
int contents;
bool allsolid;
bool startsolid;
char gap3A[0x6];
csurface_t surface;
float fractionleftsolid;
int hitgroup;
short physicsBone;
char gap5A[0x6];
void* hit_entity;
int hitbox;
char gap6C[0x114];
}; //Size: 0x0180
class CEngineTrace
{
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 stub_3() const = 0;
virtual void TraceRay(const Ray_t& ray, unsigned int fMask, trace_t pTrace) = 0;
};
/* ==== CENGINETRACE ======================================================================================================================================================= */
inline CEngineTrace* g_pEngineTrace = nullptr;
///////////////////////////////////////////////////////////////////////////////
void CEngineTrace_Attach();
void CEngineTrace_Detach();
///////////////////////////////////////////////////////////////////////////////
class VEngine_Trace : public IDetour
{
virtual void GetAdr(void) const { }
virtual void GetFun(void) const { }
virtual void GetVar(void) const { }
virtual void GetCon(void) const { }
virtual void Attach(void) const { }
virtual void Detach(void) const { }
};
///////////////////////////////////////////////////////////////////////////////
REGISTER(VEngine_Trace);

View File

@ -20,6 +20,7 @@
#include "engine/server/sv_main.h"
#include "server/vengineserver_impl.h"
#include "client/cdll_engine_int.h"
#include "engine/enginetrace.h"
#ifndef DEDICATED
#include "gameui/IConsole.h"
#endif // !DEDICATED
@ -75,6 +76,7 @@ bool CModAppSystemGroup::Create(CModAppSystemGroup* pModAppSystemGroup)
#ifndef DEDICATED
g_pClientEntityList = g_pFactory->GetFactoryPtr("VClientEntityList003", false).RCast<IClientEntityList*>();
g_pEngineTrace = g_pFactory->GetFactoryPtr("EngineTraceClient004", false).RCast<CEngineTrace*>();
for (auto& map : g_pCVar->DumpToMap())
{

View File

@ -35,6 +35,7 @@
<ClCompile Include="..\engine\cmodel_bsp.cpp" />
<ClCompile Include="..\engine\common.cpp" />
<ClCompile Include="..\engine\debugoverlay.cpp" />
<ClCompile Include="..\engine\enginetrace.cpp" />
<ClCompile Include="..\engine\gl_rsurf.cpp" />
<ClCompile Include="..\engine\gl_screen.cpp" />
<ClCompile Include="..\engine\host.cpp" />
@ -190,6 +191,7 @@
<ClInclude Include="..\engine\common.h" />
<ClInclude Include="..\engine\datablock.h" />
<ClInclude Include="..\engine\debugoverlay.h" />
<ClInclude Include="..\engine\enginetrace.h" />
<ClInclude Include="..\engine\framesnapshot.h" />
<ClInclude Include="..\engine\gl_matsysiface.h" />
<ClInclude Include="..\engine\gl_model_private.h" />

View File

@ -648,6 +648,9 @@
<ClCompile Include="..\engine\sys_mainwind.cpp">
<Filter>sdk\engine</Filter>
</ClCompile>
<ClCompile Include="..\engine\enginetrace.cpp">
<Filter>sdk\engine</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\client\cdll_engine_int.h">
@ -1877,6 +1880,9 @@
<ClInclude Include="..\public\materialsystem\shader_vcs_version.h">
<Filter>sdk\public\materialsystem</Filter>
</ClInclude>
<ClInclude Include="..\engine\enginetrace.h">
<Filter>sdk\engine</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="..\shared\resource\lockedserver.png">