Skip to content

Commit

Permalink
Setting 2d body to be default dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardodoria committed Jan 2, 2024
1 parent f9ff698 commit c493b11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engine/core/object/physics/Body2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ b2BodyType getBodyTypeToB2(BodyType type){
return b2_dynamicBody;
}

return b2_staticBody;
return b2_dynamicBody;
}

BodyType getB2ToBodyType(b2BodyType type){
Expand All @@ -32,7 +32,7 @@ BodyType getB2ToBodyType(b2BodyType type){
return BodyType::DYNAMIC;
}

return BodyType::STATIC;
return BodyType::DYNAMIC;
}

Vector2 getB2ToVector2(b2Vec2 vec2){
Expand Down
1 change: 1 addition & 0 deletions engine/core/subsystem/PhysicsSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ bool PhysicsSystem::loadBody2D(Entity entity){
bodyDef.userData.pointer = entity;

body.body = world2D->CreateBody(&bodyDef);
body.body->SetType(b2_dynamicBody);
body.newBody = true;

return true;
Expand Down

0 comments on commit c493b11

Please sign in to comment.