fixes for physics
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user