CollisionRule.NoPair Help

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Danthekilla
Posts: 136
Joined: Sun Jan 17, 2010 11:35 am

CollisionRule.NoPair Help

Post by Danthekilla »

When setting collision pair stuff is this needed

Bodys[0].CollisionRules.SpecificEntities.Add(Bodys[1], CollisionRule.NoPair);
Bodys[1].CollisionRules.SpecificEntities.Add(Bodys[0], CollisionRule.NoPair);

or would this have the same effect

Bodys[0].CollisionRules.SpecificEntities.Add(Bodys[1], CollisionRule.NoPair);

I would assume the 2nd one would be fine...
Also how is the new version going? Much more to do?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: CollisionRule.NoPair Help

Post by Norbo »

The second option (one-way) is fine. If both ways are defined, it chooses the less interactive rule of the pair (NoPair over NoContacts, for example). And of course, the rule calculator callback in the broadphase can always be changed.

Also how is the new version going? Much more to do?
I recently finished up the rewrite of GJK and the general convex-convex collision system. Now that the basic required features are back in, I'm running around connecting bits and pieces to get it running. After that, the remaining work is going to be mostly collision detection special cases which are already partially implemented (compounds, meshes, fluid volumes, detector volumes, etc.), setting up CCD, and debugging.
Danthekilla
Posts: 136
Joined: Sun Jan 17, 2010 11:35 am

Re: CollisionRule.NoPair Help

Post by Danthekilla »

Cool thanks for that.

Nice sounds like its coming along well then.
Thanks for the info.
Alic
Posts: 39
Joined: Fri Jul 29, 2011 2:25 pm

Re: CollisionRule.NoPair Help

Post by Alic »

How would I change the rule calculator callback in the broadphase object? Space.broadphase doesn't contain anything I recognize as a delegate for calculating collision rules. I'm probably missing it while it's right in front of me...


Oops, just realized this is from 2010... sorry Norbo. Is this still something that's doable? I'm tempted to make collision group rules supercede personal rules... for some reason that seems easier to me.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: CollisionRule.NoPair Help

Post by Norbo »

Is this still something that's doable? I'm tempted to make collision group rules supercede personal rules... for some reason that seems easier to me.
Yup. It's now located in the CollisionRules.CollisionRuleCalculator property.

The CollisionRules.GetCollisionRuleDefault method is a good reference for switching the priorities around:

Code: Select all

        public static CollisionRule GetCollisionRuleDefault(CollisionRules a, CollisionRules b)
        {
            CollisionRule pairRule = GetSpecificCollisionRuleDefault(a, b);
            if (pairRule == CollisionRule.Defer)
            {
                pairRule = GetPersonalCollisionRuleDefault(a, b);
                if (pairRule == CollisionRule.Defer)
                    pairRule = GetGroupCollisionRuleDefault(a, b);
            }

            if (pairRule == CollisionRule.Defer)
                pairRule = DefaultCollisionRule;
            return pairRule;
        }
Post Reply