Accidentally did a commit when I wanted to revert... (ignore my last revision)
authorMitchell Stokes <mogurijin@gmail.com>
Wed, 8 Aug 2012 01:29:20 +0000 (01:29 +0000)
committerMitchell Stokes <mogurijin@gmail.com>
Wed, 8 Aug 2012 01:29:20 +0000 (01:29 +0000)
release/scripts/startup/bl_ui/properties_game.py
source/blender/blenkernel/intern/object.c
source/blender/blenloader/intern/readfile.c
source/blender/makesdna/DNA_object_types.h
source/blender/makesrna/intern/rna_object.c
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_GameObject.h
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp

index f055ac61b72541c36453d04fb5e478ece1a90872..5ff49a7d369b3d4b74a68dfe709b18f90aefdc3b 100644 (file)
@@ -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'}
index f2b1dada7916f0f37a0dc15019f79312edcf584f..baf216b95e9726d376ee3618f3589096baff8e50 100644 (file)
@@ -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;
index 4c5c796aec495448ca5c8c558f5cb06e813a4770..73494d118d4e141bebb1614343de40bd14b707d8 100644 (file)
@@ -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! */
 
index cf28f36ef771dbde3b1f79576a10d71a7c020e67..3da6d0fc99d5a8cca8e16a03a8346e01a41dfa1a 100644 (file)
@@ -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
index a95645e5d9f554757fc2a91349875204d15a1649..7aedbf40eba6d1df6fac011a48c125071cb3e47b 100644 (file)
@@ -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);
index 5b8d5fbfe1fc7e3f3552c9af579668a9cf3a6408..04a806dfd92cd7767a3622bf421ffdca855b95ed 100644 (file)
@@ -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()
 {
index 569a4a2b2a1e3807817aac5b96656291f813ed3c..2b0d13ff2f73a2c5b50b217a581c28c56610a417 100644 (file)
@@ -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
index 49652ef95446f0af46da3033aa9b66745cb9c472..5d28bf47401e52bf5de5055e2b0e990fec5e766e 100644 (file)
@@ -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;