Hi
When I add a new collsiongroup, I find that it is normal collsion with all other previous collisiongroup. I think it should be default nopair. The reason of grouping entities with collisiongroup is to prevent certain groups to collide with another. So
say I have
collisionGroup1
collisionGroup2
collisionGroup3
and I add a new CollisionGroup4, I need to add code to disablepair with all the groups I don't want. Imagine I have more than 10 collisiongroup, I have to do it 10x9 times.
0.10.0 CollisionPair should be default to noPair
Re: 0.10.0 CollisionPair should be default to noPair
CollisionGroups were not designed primarily to prevent collision between groups of entities, but rather as a more general way to manage interactions. That's why it defaults to normal if no other rule is specified.
For every simulation that would benefit from having group relationships default to noPair, there is another simulation that benefits from having it default to normal. In either case, resolving the issue is fairly trivial. If you want to essentially make every pair relationship noPair by default, you can keep a list of CollisionGroups handy and iterate over it.
I will probably end up adding in a static CollisionRule variable that allows you to specify what CollisionRule to use when no CollisionRule is specified by the entities. You'd still need to iterate over a list of collision groups and make them collide with themselves, though.
For every simulation that would benefit from having group relationships default to noPair, there is another simulation that benefits from having it default to normal. In either case, resolving the issue is fairly trivial. If you want to essentially make every pair relationship noPair by default, you can keep a list of CollisionGroups handy and iterate over it.
I will probably end up adding in a static CollisionRule variable that allows you to specify what CollisionRule to use when no CollisionRule is specified by the entities. You'd still need to iterate over a list of collision groups and make them collide with themselves, though.
Re: 0.10.0 CollisionPair should be default to noPair
Yeah I think that would be fine. Manual defining who collide who is easier.
Re: 0.10.0 CollisionPair should be default to noPair
Hmm, a few questions.
Do I need to add collisionGroup two times? ? It seems I can do this with the group swapped.
add (new CollisionGroupPair (CollisionGroup1, CollisionGroup2), CollisionRule.noPair);
add (new CollisionGroupPair (CollisionGroup2, CollisionGroup1), CollisionRule.noPair);
Also, it seems I can add duplicates in there.
Do I need to add collisionGroup two times? ? It seems I can do this with the group swapped.
add (new CollisionGroupPair (CollisionGroup1, CollisionGroup2), CollisionRule.noPair);
add (new CollisionGroupPair (CollisionGroup2, CollisionGroup1), CollisionRule.noPair);
Also, it seems I can add duplicates in there.
Re: 0.10.0 CollisionPair should be default to noPair
No, the duplicates seems to be my mistake. Sorry about that.
Re: 0.10.0 CollisionPair should be default to noPair
To clarify, no, you do not need both a relationship between group A and group B and between group B and group A. The two orderings are considered equal as far as the equality comparer and hash code are considered, so a rule between two groups can be thought of as 'two way.'