diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index faa136f11b2f..d6b29207d558 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -494,6 +494,7 @@ enum { OB_BOUND_CONVEX_HULL = 5, /* OB_BOUND_DYN_MESH = 6, */ /*UNUSED*/ OB_BOUND_CAPSULE = 7, + OB_BOUND_EMPTY = 8, }; /* lod flags */ diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 4291fae97955..c54744b5b0b4 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -115,6 +115,7 @@ static EnumPropertyItem collision_bounds_items[] = { {OB_BOUND_CONVEX_HULL, "CONVEX_HULL", ICON_MESH_ICOSPHERE, "Convex Hull", ""}, {OB_BOUND_TRIANGLE_MESH, "TRIANGLE_MESH", ICON_MESH_MONKEY, "Triangle Mesh", ""}, {OB_BOUND_CAPSULE, "CAPSULE", ICON_MESH_CAPSULE, "Capsule", ""}, + {OB_BOUND_EMPTY, "Empty", ICON_EMPTY_DATA, "Empty", ""}, /*{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""}, */ {0, NULL, 0, NULL, NULL} }; @@ -504,6 +505,7 @@ static EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *UNUSED(C), RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_SPHERE); RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_BOX); RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CAPSULE); + RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_EMPTY); } RNA_enum_item_end(&item, &totitem); diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 03d40c6111bf..c081f4504c85 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -2556,6 +2556,12 @@ btCollisionShape *CcdShapeConstructionInfo::CreateBulletShape(btScalar margin, b collisionShape = compoundShape; } break; + case PHY_SHAPE_EMPTY: + { + collisionShape = new btEmptyShape(); + collisionShape->setMargin(margin); + break; + } } return collisionShape; } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 6488cd350b95..f4d6f8e9bef6 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -2930,6 +2930,12 @@ void CcdPhysicsEnvironment::ConvertObject(BL_BlenderSceneConverter& converter, K break; } + case OB_BOUND_EMPTY: + { + shapeInfo->m_shapeType = PHY_SHAPE_EMPTY; + bm = shapeInfo->CreateBulletShape(ci.m_margin); + break; + } } if (!bm) { diff --git a/source/gameengine/Physics/Common/PHY_DynamicTypes.h b/source/gameengine/Physics/Common/PHY_DynamicTypes.h index 71f829ff432a..0778cd6139ed 100644 --- a/source/gameengine/Physics/Common/PHY_DynamicTypes.h +++ b/source/gameengine/Physics/Common/PHY_DynamicTypes.h @@ -99,6 +99,7 @@ typedef enum PHY_ShapeType { PHY_SHAPE_MESH, PHY_SHAPE_POLYTOPE, PHY_SHAPE_COMPOUND, + PHY_SHAPE_EMPTY, PHY_SHAPE_PROXY } PHY_ShapeType;