BGE PHYSICS DEV: The long awaited collision mask functionality is now in trunk.

From Moguri and Kupoman:

http://lists.blender.org/pipermail/bf-blender-cvs/2012-October/050942.html

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.

They also mention that it’s been heavily tested so any remaining issues that blocked its inclusion in 2.64 is likely resolved. You should now be able to find this new feature in any build after Rev. 51769 as well as expect to see it in 2.65.

I know that it’s been a long wait for this, but now you can be excited that you can finally make use of it in your games.

Enjoy.:slight_smile:

Thanks for the great news, Ace Dragon!

And even more thanks to Moguri and Kupoman for giving this to us!

is it possible to use this “fake” holes through solid objects? as in putting a cylinder through a wall, and the cylinder acts as a hallway?

perhaps I’m not grasping it’s intended use?

:smiley: Have wanted this for a while now

It means you can have different sets of objects that collide with some of the other sets, but not others.

So you have objects A, B, C, and D.
-Objects A and B are in collision group 1
-Objects C and D are in collision group 2
-You can set it so object A can collide with B, but won’t collide with C and D (it will just go through them as if it was a ghost object).

As an example, you can use it to create invisible barriers for a select group of objects, you can also use it for trick platforms that the player falls through but the enemies don’t, and that is just for starters.

Really really needed for my game! YESS!

Yeah, this is really super useful to have. Very nice. Gonna go test it out really quickly.

EDIT: Just tested it out. Seems to work really well.

EDIT 2: As a side-note, it appears the new group functionality has been renamed - objects don’t have a group property, but rather group_parent and group_children properties.

This kicks so much butt. I’m coming from UDK and there has been so many times where the collisions have frustrated me because of the lack of this kind of functionality.

Thanks a bunch guys :slight_smile:

This is wonderful. Thanks so much.

However, I think I may have found a bug. I have some objects who are in group 2 but are only masked to collide with group 1. If the game starts without any of the objects intersecting, it works fine: they float straight through one another. But, if the game starts with them intersecting one another, they pop away like normal, before ignoring collisions once more.

EDIT:
I’ve submitted a bug report

Attachments

maskError.blend (422 KB)

That’s some great news! Really useful feature

That does indeed seem to be the case. It looks like if you want to have objects that don’t collide with one another on starting the engine, you’ll need to position them safely away and then move them after the game begins. I think you should post a bug report on the game engine bug tracker. That helps to give bugs a centralized place for sorting.

Yes I see now, :slight_smile:

This will allow me to have a camera collide with the environment, and still ghost through the player! Nice! (I really needed this feature)

This will be very useful. Can you also make it so that object A can collide with B & C while B & C do not collide with each other?

@Wraaah
Yes, indeed. See my this attatchment: wraaahExample.blend (436 KB)

Incidentally, the bug I posted earlier isn’t present when you use dupligroups. When you have several dupligroup cubes, they don’t bounce apart on startup. See here: groupsOfGroups.blend (506 KB)

Out of curiosity, does this extend to raycasts as well? For example, if Object A and B can’t collide with one another, can object A detect object B using the raycast sensor or A.rayCast( … )?

very cool!!
i tryed it and seem fulll of cool improvement .(i have to test a bit more but seem all right)

finally also the group stuff!
i just not like much the underscore
group_parent
group_children
is decisely a exception as sintax .(while i like the choose of the word)

the collision improvement is very useful ,and pretty easy to use :wink:

thanks !!!

To note, this was not Moerdn’s decision, this change was made by Campbell on the count of making it more clear what these attributes are used for. (he tends to be specific on these sort of things).

oops I downloaded the latest official version, I thought that there were updates of collisions.

instead there is nothing … how do you make a character without groups collision? (I’m already addicted :))

just to say, it seems that everything works really well.

the only problem (bug) that I noticed in this version, is that sometimes I can not add the controller, in the logic brick. (or should I add 2/3 times)

everything else is perfect
r51581

thanks Ace Dragon for this TD (i not agree anyway with the underscore :wink: )