public static void RegisterMe() { NarrowPhasePairFactory <ConvexFCOPairHandler> fact = new NarrowPhasePairFactory <ConvexFCOPairHandler>(); NarrowPhasePairFactory <MCCFCOPairHandler> fact2 = new NarrowPhasePairFactory <MCCFCOPairHandler>(); NarrowPhasePairFactory <ConvexMCCPairHandler> fact3 = new NarrowPhasePairFactory <ConvexMCCPairHandler>(); NarrowPhasePairFactory <MCCMCCPairHandler> fact4 = new NarrowPhasePairFactory <MCCMCCPairHandler>(); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <BoxShape>), typeof(FullChunkObject)), fact); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <SphereShape>), typeof(FullChunkObject)), fact); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <CapsuleShape>), typeof(FullChunkObject)), fact); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <TriangleShape>), typeof(FullChunkObject)), fact); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <CylinderShape>), typeof(FullChunkObject)), fact); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <ConeShape>), typeof(FullChunkObject)), fact); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <TransformableShape>), typeof(FullChunkObject)), fact); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <MinkowskiSumShape>), typeof(FullChunkObject)), fact); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <WrappedShape>), typeof(FullChunkObject)), fact); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <ConvexHullShape>), typeof(FullChunkObject)), fact); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(TriangleCollidable), typeof(FullChunkObject)), fact); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(MobileChunkCollidable), typeof(FullChunkObject)), fact2); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <BoxShape>), typeof(MobileChunkCollidable)), fact3); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <SphereShape>), typeof(MobileChunkCollidable)), fact3); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <CapsuleShape>), typeof(MobileChunkCollidable)), fact3); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <TriangleShape>), typeof(MobileChunkCollidable)), fact3); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <CylinderShape>), typeof(MobileChunkCollidable)), fact3); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <ConeShape>), typeof(MobileChunkCollidable)), fact3); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <TransformableShape>), typeof(MobileChunkCollidable)), fact3); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <MinkowskiSumShape>), typeof(MobileChunkCollidable)), fact3); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <WrappedShape>), typeof(MobileChunkCollidable)), fact3); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <ConvexHullShape>), typeof(MobileChunkCollidable)), fact3); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(TriangleCollidable), typeof(MobileChunkCollidable)), fact3); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(MobileChunkCollidable), typeof(MobileChunkCollidable)), fact4); }
public static void EnsurePairsAreRegistered() { //Assume if one has been added, all have. if (!NarrowPhaseHelper.CollisionManagers.ContainsKey(new TypePair(typeof(ConvexCollidable <BoxShape>), typeof(VoxelGrid)))) { var factory = new NarrowPhasePairFactory <VoxelGridConvexPairHandler>(); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <BoxShape>), typeof(VoxelGrid)), factory); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <SphereShape>), typeof(VoxelGrid)), factory); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <CapsuleShape>), typeof(VoxelGrid)), factory); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <TriangleShape>), typeof(VoxelGrid)), factory); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <CylinderShape>), typeof(VoxelGrid)), factory); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <ConeShape>), typeof(VoxelGrid)), factory); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <TransformableShape>), typeof(VoxelGrid)), factory); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <MinkowskiSumShape>), typeof(VoxelGrid)), factory); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <WrappedShape>), typeof(VoxelGrid)), factory); NarrowPhaseHelper.CollisionManagers.Add(new TypePair(typeof(ConvexCollidable <ConvexHullShape>), typeof(VoxelGrid)), factory); } }