diff options
-rw-r--r-- | release/scripts/startup/bl_ui/properties_game.py | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 10 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_types.h | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 70 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 13 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.h | 11 | ||||
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | 8 |
8 files changed, 2 insertions, 130 deletions
diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index f055ac61b72..5ff49a7d369 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -189,16 +189,8 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): layout.operator("mesh.navmesh_reset") layout.operator("mesh.navmesh_clear") - - if physics_type not in {'NO_COLLISION', 'OCCLUDE'}: - layout.separator() - split = layout.split() - - col = split.column() - col.prop(game, "collision_group") - col = split.column() - col.prop(game, "collision_mask") - + + class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel): bl_label = "Collision Bounds" COMPAT_ENGINES = {'BLENDER_GAME'} diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index f2b1dada791..baf216b95e9 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -844,8 +844,6 @@ Object *BKE_object_add_only_object(int type, const char *name) ob->step_height = 0.15f; ob->jump_speed = 10.0f; ob->fall_speed = 55.0f; - ob->col_group = 0x01; - ob->col_mask = 0xff; /* NT fluid sim defaults */ ob->fluidsimSettings = NULL; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 4c5c796aec4..73494d118d4 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7890,16 +7890,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ntreetype->foreach_nodetree(main, NULL, do_version_ntree_mask_264); } - { - Object *ob; - for (ob = main->object.first; ob; ob = ob->id.next) { - if (ob->col_group == 0) { - ob->col_group = 0x01; - ob->col_mask = 0xff; - } - } - } - /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */ diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index cf28f36ef77..3da6d0fc99d 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -241,9 +241,6 @@ typedef struct Object { short recalc; /* dependency flag */ float anisotropicFriction[3]; - /** Collision mask settings */ - unsigned short col_group, col_mask, col_pad[2]; - ListBase constraints; /* object constraints */ ListBase nlastrips DNA_DEPRECATED; // XXX depreceated... old animation system ListBase hooks DNA_DEPRECATED; // XXX depreceated... old animation system @@ -475,9 +472,6 @@ typedef struct DupliObject { /* controller state */ #define OB_MAX_STATES 30 -/* collision masks */ -#define OB_MAX_COL_MASKS 8 - /* ob->gameflag */ #define OB_DYNAMIC 1 #define OB_CHILD 2 diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index a95645e5d9f..7aedbf40eba 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1077,62 +1077,6 @@ static void rna_GameObjectSettings_state_set(PointerRNA *ptr, const int *values) } } -static void rna_GameObjectSettings_col_group_get(PointerRNA *ptr, int *values) -{ - Object *ob = (Object*)ptr->data; - int i; - - for (i = 0; i < OB_MAX_COL_MASKS; i++) - values[i] = (ob->col_group & (1<<i)); -} - -static void rna_GameObjectSettings_col_group_set(PointerRNA *ptr, const int *values) -{ - Object *ob = (Object*)ptr->data; - int i, tot = 0; - - /* ensure we always have some group selected */ - for (i = 0; i < OB_MAX_COL_MASKS; i++) - if(values[i]) - tot++; - - if (tot==0) - return; - - for (i = 0; i < OB_MAX_COL_MASKS; i++) { - if (values[i]) ob->col_group |= (1<<i); - else ob->col_group &= ~(1<<i); - } -} - -static void rna_GameObjectSettings_col_mask_get(PointerRNA *ptr, int *values) -{ - Object *ob = (Object*)ptr->data; - int i; - - for (i = 0; i < OB_MAX_COL_MASKS; i++) - values[i] = (ob->col_mask & (1<<i)); -} - -static void rna_GameObjectSettings_col_mask_set(PointerRNA *ptr, const int *values) -{ - Object *ob = (Object*)ptr->data; - int i, tot = 0; - - /* ensure we always have some mask selected */ - for (i = 0; i < OB_MAX_COL_MASKS; i++) - if(values[i]) - tot++; - - if (tot==0) - return; - - for (i = 0; i < OB_MAX_COL_MASKS; i++) { - if (values[i]) ob->col_mask |= (1<<i); - else ob->col_mask &= ~(1<<i); - } -} - static void rna_GameObjectSettings_used_state_get(PointerRNA *ptr, int *values) { Object *ob = (Object *)ptr->data; @@ -1494,8 +1438,6 @@ static void rna_def_object_game_settings(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - int default_col_mask[8] = {1,0,0,0, 0,0,0,0}; - static EnumPropertyItem body_type_items[] = { {OB_BODY_TYPE_NO_COLLISION, "NO_COLLISION", 0, "No Collision", "Disable collision for this object"}, {OB_BODY_TYPE_STATIC, "STATIC", 0, "Static", "Stationary object"}, @@ -1619,18 +1561,6 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Fall Speed Max", "Maximum speed at which the character will fall"); - prop = RNA_def_property(srna, "collision_group", PROP_BOOLEAN, PROP_LAYER_MEMBER); - RNA_def_property_boolean_sdna(prop, NULL, "col_group", 1); - RNA_def_property_array(prop, OB_MAX_COL_MASKS); - RNA_def_property_ui_text(prop, "Collision Group", "The collision group of the object"); - RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_col_group_get", "rna_GameObjectSettings_col_group_set"); - - prop = RNA_def_property(srna, "collision_mask", PROP_BOOLEAN, PROP_LAYER_MEMBER); - RNA_def_property_boolean_sdna(prop, NULL, "col_mask", 1); - RNA_def_property_array(prop, OB_MAX_COL_MASKS); - RNA_def_property_ui_text(prop, "Collision Mask", "The groups this object can collide with"); - RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_col_mask_get", "rna_GameObjectSettings_col_mask_set"); - /* lock position */ prop = RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_AXIS); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 5b8d5fbfe1f..04a806dfd92 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -481,19 +481,6 @@ void KX_GameObject::ActivateGraphicController(bool recurse) } } -void KX_GameObject::SetUserCollisionGroup(short group) -{ - m_userCollisionGroup = group; -} -void KX_GameObject::SetUserCollisionMask(short mask) -{ - m_userCollisionMask = mask; -} - -bool KX_GameObject::CheckCollision(KX_GameObject* other) -{ - return this->m_userCollisionGroup & other->m_userCollisionMask; -} CValue* KX_GameObject::GetReplica() { diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 569a4a2b2a1..2b0d13ff2f7 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -98,10 +98,6 @@ protected: bool m_bIsNegativeScaling; MT_Vector4 m_objectColor; - // Bit fields for user control over physics collisions - short m_userCollisionGroup; - short m_userCollisionMask; - // visible = user setting // culled = while rendering, depending on camera bool m_bVisible; @@ -468,13 +464,6 @@ public: * @add/remove the graphic controller to the physic system */ void ActivateGraphicController(bool recurse); - - void SetUserCollisionGroup(short filter); - void SetUserCollisionMask(short mask); - /** - * Extra broadphase check for user controllable collisions - */ - bool CheckCollision(KX_GameObject *other); /** * \section Coordinate system manipulation functions diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 49652ef9544..5d28bf47401 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -2214,19 +2214,11 @@ void CcdPhysicsEnvironment::CallbackTriggers() bool CcdOverlapFilterCallBack::needBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const { btCollisionObject *colObj0, *colObj1; - KX_GameObject *gameObj0 = KX_GameObject::GetClientObject((KX_ClientObjectInfo*)((CcdPhysicsController*)((btCollisionObject*)proxy0->m_clientObject)->getUserPointer())->getNewClientInfo()); - KX_GameObject *gameObj1 = KX_GameObject::GetClientObject((KX_ClientObjectInfo*)((CcdPhysicsController*)((btCollisionObject*)proxy1->m_clientObject)->getUserPointer())->getNewClientInfo()); CcdPhysicsController *sensorCtrl, *objCtrl; - bool collides; // first check the filters collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0; collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask); - if (gameObj0 && gameObj1) - { - collides = collides && gameObj0->CheckCollision(gameObj1); - collides = collides && gameObj1->CheckCollision(gameObj0); - } if (!collides) return false; |