Skip to content

Commit

Permalink
static object movement
Browse files Browse the repository at this point in the history
  • Loading branch information
crocdialer committed Nov 15, 2024
1 parent 942306e commit af43010
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/physics_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,10 +1028,13 @@ void PhysicsScene::update(double time_delta)
continue;
}

if(cmp.kinematic || cmp.mass == 0.f)
auto mesh_shape = std::get_if<collision::mesh_t>(&cmp.shape);
bool is_movable = cmp.kinematic || cmp.mass == 0.f || (mesh_shape && !mesh_shape->convex_hull);

if(is_movable)
{
// object -> physics
m_context.body_interface().set_transform(static_cast<uint32_t>(entity), obj->transform);
m_context.body_interface().set_transform(static_cast<uint32_t>(entity), obj->global_transform());
}
else
{
Expand Down

0 comments on commit af43010

Please sign in to comment.