Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
index bbc3968347c..ce6eb221e8d 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
@@ -3056,27 +3056,26 @@ void CcdPhysicsEnvironment::ConvertObject(KX_GameObject *gameobj, RAS_MeshObject
btCollisionShape* bm = 0;
- char bounds;
- if (blenderobject->gameflag & OB_BOUNDS)
- {
- bounds = blenderobject->collision_boundtype;
- }
- else
+ char bounds = isbulletdyna ? OB_BOUND_SPHERE : OB_BOUND_TRIANGLE_MESH;
+ if (!(blenderobject->gameflag & OB_BOUNDS))
{
if (blenderobject->gameflag & OB_SOFT_BODY)
bounds = OB_BOUND_TRIANGLE_MESH;
else if (blenderobject->gameflag & OB_CHARACTER)
bounds = OB_BOUND_SPHERE;
- else if (isbulletdyna)
+ }
+ else
+ {
+ if (ELEM(blenderobject->collision_boundtype, OB_BOUND_CONVEX_HULL, OB_BOUND_TRIANGLE_MESH)
+ && blenderobject->type != OB_MESH)
+ {
+ // Can't use triangle mesh or convex hull on a non-mesh object, fall-back to sphere
bounds = OB_BOUND_SPHERE;
+ }
else
- bounds = OB_BOUND_TRIANGLE_MESH;
+ bounds = blenderobject->collision_boundtype;
}
- // Can't use triangle mesh or convex hull on a non-mesh object, fall-back to sphere
- if (ELEM(bounds, OB_BOUND_TRIANGLE_MESH, OB_BOUND_CONVEX_HULL) && blenderobject->type != OB_MESH)
- bounds = OB_BOUND_SPHERE;
-
// Get bounds information
float bounds_center[3], bounds_extends[3];
BoundBox *bb= BKE_object_boundbox_get(blenderobject);