Files
funnygame/game/server/physicsprop.cpp
2026-03-05 21:25:59 +02:00

45 lines
799 B
C++

#include "physicsprop.h"
#include "game.h"
void CPhysicsProp::Precache()
{
}
void CPhysicsProp::Spawn()
{
CBaseEntity::Spawn();
SetThink(Think);
}
void CPhysicsProp::Think( float fDelta )
{
SetAbsOrigin(m_pBody->GetPosition());
SetAbsAngles(m_pBody->GetRotation());
}
void CPhysicsProp::SetModel( const char *szName )
{
if (m_hModel)
{
g_pAssetManager->UnrefModel(m_hModel);
}
m_hModel = g_pAssetManager->LoadModel(szName);
m_pModel = g_pAssetManager->GetModelByIndex(m_hModel);
m_pPhysics = g_pAssetManager->GetPhysicsByIndex(m_pModel->m_hPhysics);
m_hCollider = g_pPhysics->CreateCollider(m_pPhysics->m_hShape);
m_pBody = g_pPhysicsWorld->CreateRigidBody(m_hCollider, k_EPhysics_Dynamic);
}
void CPhysicsProp::EnableMovement()
{
}
void CPhysicsProp::DisableMovement()
{
}