Skip to content

Commit

Permalink
UPBGE: Fix capsule shape dimensions.
Browse files Browse the repository at this point in the history
The height in new version of bullet changed from height including radius on corners
to height of the cylinder part.

The hiehg tis adapted by removing the radius from the half extend bounds.
  • Loading branch information
panzergame committed Oct 2, 2018
1 parent a678430 commit 607351f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2897,7 +2897,7 @@ void CcdPhysicsEnvironment::ConvertObject(BL_SceneConverter& converter, KX_GameO
case OB_BOUND_CAPSULE:
{
shapeInfo->m_radius = std::max(bounds_extends[0], bounds_extends[1]);
shapeInfo->m_height = 2.0f * bounds_extends[2];
shapeInfo->m_height = 2.0f * (bounds_extends[2] - shapeInfo->m_radius);
if (shapeInfo->m_height < 0.0f) {
shapeInfo->m_height = 0.0f;
}
Expand Down

0 comments on commit 607351f

Please sign in to comment.