Skip to content

Commit

Permalink
Remove gravity for kinematic.
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Jan 16, 2024
1 parent b14252b commit 8222043
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Plugins/BulletPhysics/physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ CStaticBody *CPhysicsManager::CreateStaticBody(cl_entity_t *ent, vertexarray_t *
{
body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
body->setActivationState(DISABLE_DEACTIVATION);
body->setGravity(btVector3(0, 0, 0));

staticbody->m_kinematic = true;
}
Expand Down Expand Up @@ -3177,6 +3178,7 @@ void CPhysicsManager::ResetPose(CRagdollBody *ragdoll, entity_state_t *curstate)
//Transform to dynamic at next tick
rig->rigbody->setCollisionFlags(rig->oldCollisionFlags | btCollisionObject::CF_KINEMATIC_OBJECT);
rig->rigbody->setActivationState(DISABLE_DEACTIVATION);
rig->rigbody->setGravity(btVector3(0, 0, 0));

bNeedResetKinematic = true;
}
Expand Down Expand Up @@ -3543,6 +3545,7 @@ bool CPhysicsManager::UpdateKinematic(CRagdollBody *ragdoll, int iActivityType,
{
rig->rigbody->setCollisionFlags(rig->oldCollisionFlags | btCollisionObject::CF_KINEMATIC_OBJECT);
rig->rigbody->setActivationState(DISABLE_DEACTIVATION);
rig->rigbody->setGravity(btVector3(0, 0, 0));
}
else
{
Expand Down

0 comments on commit 8222043

Please sign in to comment.