diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2014-05-15 09:36:28 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2014-05-16 00:28:56 +0400 |
commit | 183b417cce6de2ea00ca1f0d89b0170827aa75b3 (patch) | |
tree | 195bfdc0ebb3aa55c5958c49c69dcb5f5bd16b45 /source/gameengine | |
parent | 48fcadc88d1a958e8bfc13871d23addfa1514d61 (diff) |
BGE Physics: Better follow the old (pre-cleanup) logic for determining bounds types.
This prevents older files from breaking.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | 23 |
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); |