fixes for physics

This commit is contained in:
2026-03-17 01:01:10 +02:00
parent f3ed144fb5
commit 0a506f7185
24 changed files with 179 additions and 74 deletions

View File

@@ -11,8 +11,6 @@ void CPhysicsProp::Spawn()
{
CBaseEntity::Spawn();
SetThink(Think);
V_printf("hi\n");
}
void CPhysicsProp::Think( float fDelta )
@@ -60,6 +58,8 @@ void CPhysicsProp::OnModelChanged( const char *szName )
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);
m_pBody->SetPosition({0,0,0});
m_pBody->SetRotation({0,0,0});
}
void CPhysicsProp::EnableMovement()
@@ -71,5 +71,8 @@ void CPhysicsProp::DisableMovement()
{
}
BEGIN_DATADESC(CPhysicsProp)
DEFINE_KEYFIELD(m_ePhysicsType, FIELD_INTEGER, "physics_type")
END_DATADESC()
LINK_ENTITY_TO_CLASS(prop_physics, CPhysicsProp)