public static GetPairHandler ( CollidablePair &pair ) : |
||
pair | CollidablePair | Pair of collidables to use to create the pair handler. |
return |
public static CollidablePairHandler GetPairHandler(ref CollidablePair pair)
{
var overlap = new BroadPhaseOverlap(pair.collidableA, pair.collidableB);
return GetPairHandler(ref overlap) as CollidablePairHandler;
}
NarrowPhaseHelper::GetPairHandler ( CollidablePair &pair, CollisionRule rule ) : |
|
NarrowPhaseHelper::GetPairHandler ( BEPUphysics.BroadPhaseSystems.BroadPhaseEntry entryA, BEPUphysics.BroadPhaseSystems.BroadPhaseEntry entryB ) : BEPUphysics.NarrowPhaseSystems.Pairs.NarrowPhasePair | |
NarrowPhaseHelper::GetPairHandler ( BEPUphysics.BroadPhaseSystems.BroadPhaseEntry entryA, BEPUphysics.BroadPhaseSystems.BroadPhaseEntry entryB, CollisionRule rule ) : BEPUphysics.NarrowPhaseSystems.Pairs.NarrowPhasePair | |
NarrowPhaseHelper::GetPairHandler ( BroadPhaseOverlap &pair ) : BEPUphysics.NarrowPhaseSystems.Pairs.NarrowPhasePair |
void UpdateBroadPhaseOverlap(int i) { BroadPhaseOverlap overlap = broadPhaseOverlaps.Elements[i]; if (overlap.collisionRule < CollisionRule.NoNarrowPhasePair) { NarrowPhasePair pair; //see if the overlap is already present in the narrow phase. if (!overlapMapping.TryGetValue(overlap, out pair)) { //Create/enqueue based on collision table pair = NarrowPhaseHelper.GetPairHandler(ref overlap); if (pair != null) { pair.NarrowPhase = this; //Add the new object to the 'todo' list. //Technically, this doesn't need to be thread-safe when this is called from the sequential context. //It's just bunched together for maintainability despite the slight performance hit. newNarrowPhasePairs.Enqueue(pair); } } if (pair != null) { //Update the collision rule. pair.CollisionRule = overlap.collisionRule; if (pair.BroadPhaseOverlap.collisionRule < CollisionRule.NoNarrowPhaseUpdate) { pair.UpdateCollision(TimeStepSettings.TimeStepDuration); } pair.NeedsUpdate = false; } } }