added command line, added basic character

This commit is contained in:
2025-06-12 00:17:59 +03:00
parent 64c0f41884
commit af4f0c3cad
65 changed files with 262985 additions and 304 deletions

View File

@@ -5,7 +5,7 @@
#include "tier1/commandline.h"
CUtlVector<CUtlString> client_CompiledFiles = {
"game/client/baseplayer.cpp",
"game/client/milmoba/player.cpp",
};
int client_build()

View File

@@ -1,55 +0,0 @@
#include "baseentity.h"
#include "cglm/affine-pre.h"
#include "cglm/mat4.h"
#include "physics.h"
class CBasePlayer: public CBaseEntity
{
public:
virtual void Precache ( void ) override;
virtual void Spawn( void ) override;
virtual void ReadParameter( const char *szName, const char *szValue ) override;
virtual void Destroy( void ) override;
virtual void Think( float fDelta ) override;
CPxBoxMesh m_Collider;
CPxRigidBody m_RigidBody;
};
class C_BasePlayer: public C_BaseEntity
{
public:
virtual void Precache ( void ) override;
virtual void Spawn( void ) override;
virtual void Destroy( void ) override;
virtual void Think( float fDelta ) override;
};
extern mat4 g_cameraView;
void C_BasePlayer::Precache()
{
}
void C_BasePlayer::Spawn()
{
};
void C_BasePlayer::Destroy()
{
}
void C_BasePlayer::Think( float fDelta )
{
CBasePlayer *pPlayer = (CBasePlayer*)pEntity;
glm_mat4_identity(g_cameraView);
V_memcpy(&g_cameraView[3][0], pPlayer->m_RigidBody.GetPosition().m, 12);
};
LINK_CLIENT_ENTITY(C_BasePlayer, CBasePlayer)

View File

@@ -0,0 +1,38 @@
#include "baseplayer.h"
#include "engine.h"
#include "rendering.h"
class C_MOBAPlayer: public C_BaseEntity
{
public:
virtual void Precache ( void ) override;
virtual void Spawn( void ) override;
virtual void Destroy( void ) override;
virtual void Think( float fDelta ) override;
};
void C_MOBAPlayer::Precache()
{
}
void C_MOBAPlayer::Spawn()
{
};
void C_MOBAPlayer::Destroy()
{
}
void C_MOBAPlayer::Think( float fDelta )
{
if (g_localClient.pBasePlayer == pEntity)
{
g_cameraView[3][0] = pEntity->m_position[0];
g_cameraView[3][1] = pEntity->m_position[1];
g_cameraView[3][2] = pEntity->m_position[2]+0.7;
}
};
LINK_CLIENT_ENTITY(C_MOBAPlayer, CMOBAPlayer)