#include "baseentity.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; }; void CBasePlayer::Precache() { } void CBasePlayer::Spawn() { m_Collider.m_fRadius[0] = 1; m_Collider.m_fRadius[1] = 1; m_Collider.m_fRadius[2] = 1; m_Collider.Spawn(0.0); px_matrix matrix = { .m = { 1,0,0,0, 0,1,0,0, 0,0,1,0, 5,0,0,1, } }; m_RigidBody.Spawn(&m_Collider, matrix, { .gravity_scale = 1, .lockrotx = 1, .lockroty = 1, .lockrotz = 1, }); }; void CBasePlayer::ReadParameter( const char *szName, const char *szValue ) { CBaseEntity::ReadParameter(szName, szValue); } void CBasePlayer::Destroy() { } void CBasePlayer::Think( float fDelta ) { }; DECLARE_ENTITY(player, CBasePlayer);