diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-10-30 19:44:16 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-10-30 19:44:16 +0400 |
commit | 3bf9bb3b13521c8bba4d559f308c5b2c04973df8 (patch) | |
tree | 2f1e92d25671239d16b51df88f57ffc6dea93c79 /source/blender/blenloader | |
parent | 5753ede9a5cda9e23cc346ca57f6fb677e9fbb92 (diff) |
BGE: Adding support for Bullet's collision masks. Each object now has a collision mask and a collision group. Object A and object B collide if object A's groups is in object B's mask and object B's group is in object A's mask. In other words, the group defines what the object is (collision wise) and the group defines what the object can collide with.
The majority of this patch was provided by Kupoman with some edits from me and heavy testing by z0r.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index de9e5f5e08e..d694de61131 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8247,6 +8247,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } + { + 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! */ |