added keybinds

This commit is contained in:
2026-03-06 01:43:48 +02:00
parent 99f68e655f
commit 9b4cec7920
15 changed files with 242 additions and 55 deletions

View File

@@ -8,6 +8,7 @@
class CBaseModelEntity: public CBaseEntity
{
public:
DECLARE_CLASS(CBaseModelEntity, CBaseEntity);
virtual void SetModel( const char *szName );
};

View File

@@ -150,11 +150,9 @@ void NET_ProcessPacket( INetworkBase *pBase )
int iIndex = -1;
V_printf("Hi %s\n",pPacket->m_playerJoined.m_szPlayerName);
for ( int i = 0; i < 2; i++ )
{
pEntity = EntitySystem()->CreateByClassname("player", &iIndex);
pEntity->Spawn();
}
pEntity = EntitySystem()->CreateByClassname("player", &iIndex);
pEntity->Spawn();
SetLocalEntity_t stLocalEntity = {
k_EMessage_PlayerSetLocalEntity,

View File

@@ -15,8 +15,31 @@ void CPhysicsProp::Spawn()
void CPhysicsProp::Think( float fDelta )
{
SetAbsOrigin(m_pBody->GetPosition());
SetAbsAngles(m_pBody->GetRotation());
BaseClass::SetAbsOrigin(m_pBody->GetPosition());
BaseClass::SetAbsAngles(m_pBody->GetRotation());
}
void CPhysicsProp::SetAbsAngles( Quat vQuat )
{
BaseClass::SetAbsAngles( vQuat );
if (m_pBody)
m_pBody->SetRotation(m_pBody->GetRotation());
}
void CPhysicsProp::SetAbsQAngles( float fPitch, float fYaw, float fRoll )
{
BaseClass::SetAbsQAngles( fPitch, fYaw, fRoll);
if (m_pBody)
m_pBody->SetRotation(m_pBody->GetRotation());
}
void CPhysicsProp::SetAbsOrigin( Vector origin )
{
BaseClass::SetAbsOrigin( origin );
if (m_pBody)
m_pBody->SetPosition(m_pBody->GetPosition());
}
void CPhysicsProp::SetModel( const char *szName )

View File

@@ -5,23 +5,28 @@
class CPhysicsProp: public CBaseModelEntity
{
friend CBaseEntity;
friend CBaseModelEntity;
public:
DECLARE_CLASS(CPhysicsProp, CBaseModelEntity);
virtual void Spawn() override;
virtual void Precache() override;
virtual void SetAbsAngles( Quat vQuat ) override;
virtual void SetAbsQAngles( float fPitch, float fYaw, float fRoll ) override;
virtual void SetAbsOrigin( Vector origin ) override;
virtual void SetModel( const char *szName ) override;
virtual void EnableMovement();
virtual void DisableMovement();
void Think( float fDelta );
private:
HFunnyModel m_hModel;
FunnyModel_t *m_pModel;
FunnyPhysics_t *m_pPhysics;
HCollider m_hCollider;
IPhysicsBody *m_pBody;
HFunnyModel m_hModel = 0;
FunnyModel_t *m_pModel = NULL;
FunnyPhysics_t *m_pPhysics = NULL;
HCollider m_hCollider = 0;
IPhysicsBody *m_pBody = NULL;
};
#endif