Superclass of the generic typed NarrowPhasePairFactory. Offers interaction with the factory on a INarrowPhasePair level.
 /// <summary>
 /// Constructs all factories.
 /// </summary>
 public Factories()
 {
     factories.Add(BoxBox = new NarrowPhasePairFactory <BoxPairHandler>());
     //factories.Add(BoxSphere = new NarrowPhasePairFactory<BoxSpherePairHandler>());
     factories.Add(SphereSphere             = new NarrowPhasePairFactory <SpherePairHandler>());
     factories.Add(ConvexConvex             = new NarrowPhasePairFactory <GeneralConvexPairHandler>());
     factories.Add(TriangleConvex           = new NarrowPhasePairFactory <TriangleConvexPairHandler>());
     factories.Add(CompoundConvex           = new NarrowPhasePairFactory <CompoundConvexPairHandler>());
     factories.Add(CompoundCompound         = new NarrowPhasePairFactory <CompoundPairHandler>());
     factories.Add(CompoundStaticMesh       = new NarrowPhasePairFactory <CompoundStaticMeshPairHandler>());
     factories.Add(CompoundTerrain          = new NarrowPhasePairFactory <CompoundTerrainPairHandler>());
     factories.Add(CompoundInstancedMesh    = new NarrowPhasePairFactory <CompoundInstancedMeshPairHandler>());
     factories.Add(CompoundMobileMesh       = new NarrowPhasePairFactory <CompoundMobileMeshPairHandler>());
     factories.Add(StaticMeshConvex         = new NarrowPhasePairFactory <StaticMeshConvexPairHandler>());
     factories.Add(StaticMeshSphere         = new NarrowPhasePairFactory <StaticMeshSpherePairHandler>());
     factories.Add(TerrainConvex            = new NarrowPhasePairFactory <TerrainConvexPairHandler>());
     factories.Add(TerrainSphere            = new NarrowPhasePairFactory <TerrainSpherePairHandler>());
     factories.Add(InstancedMeshConvex      = new NarrowPhasePairFactory <InstancedMeshConvexPairHandler>());
     factories.Add(InstancedMeshSphere      = new NarrowPhasePairFactory <InstancedMeshSpherePairHandler>());
     factories.Add(MobileMeshConvex         = new NarrowPhasePairFactory <MobileMeshConvexPairHandler>());
     factories.Add(MobileMeshSphere         = new NarrowPhasePairFactory <MobileMeshSpherePairHandler>());
     factories.Add(MobileMeshTriangle       = new NarrowPhasePairFactory <MobileMeshTrianglePairHandler>());
     factories.Add(MobileMeshStaticMesh     = new NarrowPhasePairFactory <MobileMeshStaticMeshPairHandler>());
     factories.Add(MobileMeshInstancedMesh  = new NarrowPhasePairFactory <MobileMeshInstancedMeshPairHandler>());
     factories.Add(MobileMeshTerrain        = new NarrowPhasePairFactory <MobileMeshTerrainPairHandler>());
     factories.Add(MobileMeshMobileMesh     = new NarrowPhasePairFactory <MobileMeshMobileMeshPairHandler>());
     factories.Add(StaticGroupConvex        = new NarrowPhasePairFactory <StaticGroupConvexPairHandler>());
     factories.Add(StaticGroupCompound      = new NarrowPhasePairFactory <StaticGroupCompoundPairHandler>());
     factories.Add(StaticGroupMobileMesh    = new NarrowPhasePairFactory <StaticGroupMobileMeshPairHandler>());
     factories.Add(DetectorVolumeConvex     = new NarrowPhasePairFactory <DetectorVolumeConvexPairHandler>());
     factories.Add(DetectorVolumeMobileMesh = new NarrowPhasePairFactory <DetectorVolumeMobileMeshPairHandler>());
     factories.Add(DetectorVolumeCompound   = new NarrowPhasePairFactory <DetectorVolumeCompoundPairHandler>());
 }
示例#2
0
 /// <summary>
 /// Constructs all factories.
 /// </summary>
 public Factories()
 {
     factories.Add(BoxBox = new NarrowPhasePairFactory<BoxPairHandler>());
     factories.Add(BoxSphere = new NarrowPhasePairFactory<BoxSpherePairHandler>());
     factories.Add(SphereSphere = new NarrowPhasePairFactory<SpherePairHandler>());
     factories.Add(ConvexConvex = new NarrowPhasePairFactory<GeneralConvexPairHandler>());
     factories.Add(TriangleConvex = new NarrowPhasePairFactory<TriangleConvexPairHandler>());
     factories.Add(CompoundConvex = new NarrowPhasePairFactory<CompoundConvexPairHandler>());
     factories.Add(CompoundCompound = new NarrowPhasePairFactory<CompoundPairHandler>());
     factories.Add(CompoundStaticMesh = new NarrowPhasePairFactory<CompoundStaticMeshPairHandler>());
     factories.Add(CompoundTerrain = new NarrowPhasePairFactory<CompoundTerrainPairHandler>());
     factories.Add(CompoundInstancedMesh = new NarrowPhasePairFactory<CompoundInstancedMeshPairHandler>());
     factories.Add(CompoundMobileMesh = new NarrowPhasePairFactory<CompoundMobileMeshPairHandler>());
     factories.Add(StaticMeshConvex = new NarrowPhasePairFactory<StaticMeshConvexPairHandler>());
     factories.Add(StaticMeshSphere = new NarrowPhasePairFactory<StaticMeshSpherePairHandler>());
     factories.Add(TerrainConvex = new NarrowPhasePairFactory<TerrainConvexPairHandler>());
     factories.Add(TerrainSphere = new NarrowPhasePairFactory<TerrainSpherePairHandler>());
     factories.Add(InstancedMeshConvex = new NarrowPhasePairFactory<InstancedMeshConvexPairHandler>());
     factories.Add(InstancedMeshSphere = new NarrowPhasePairFactory<InstancedMeshSpherePairHandler>());
     factories.Add(MobileMeshConvex = new NarrowPhasePairFactory<MobileMeshConvexPairHandler>());
     factories.Add(MobileMeshSphere = new NarrowPhasePairFactory<MobileMeshSpherePairHandler>());
     factories.Add(MobileMeshTriangle = new NarrowPhasePairFactory<MobileMeshTrianglePairHandler>());
     factories.Add(MobileMeshStaticMesh = new NarrowPhasePairFactory<MobileMeshStaticMeshPairHandler>());
     factories.Add(MobileMeshInstancedMesh = new NarrowPhasePairFactory<MobileMeshInstancedMeshPairHandler>());
     factories.Add(MobileMeshTerrain = new NarrowPhasePairFactory<MobileMeshTerrainPairHandler>());
     factories.Add(MobileMeshMobileMesh = new NarrowPhasePairFactory<MobileMeshMobileMeshPairHandler>());
     factories.Add(StaticGroupConvex = new NarrowPhasePairFactory<StaticGroupConvexPairHandler>());
     factories.Add(StaticGroupCompound = new NarrowPhasePairFactory<StaticGroupCompoundPairHandler>());
     factories.Add(StaticGroupMobileMesh = new NarrowPhasePairFactory<StaticGroupMobileMeshPairHandler>());
     factories.Add(DetectorVolumeConvex = new NarrowPhasePairFactory<DetectorVolumeConvexPairHandler>());
     factories.Add(DetectorVolumeMobileMesh = new NarrowPhasePairFactory<DetectorVolumeMobileMeshPairHandler>());
     factories.Add(DetectorVolumeCompound = new NarrowPhasePairFactory<DetectorVolumeCompoundPairHandler>());
 }
示例#3
0
		public static void EnsurePairsAreRegistered()
		{
			//Assume if one has been added, all have.
			if( !NarrowPhaseHelper.CollisionManagers.ContainsKey( new TypePair( typeof( ConvexCollidable<BoxShape> ), typeof( VoxelBlob ) ) ) )
			{
				var factory = new NarrowPhasePairFactory<VoxelBlobConvexPairHandler>();
				NarrowPhaseHelper.CollisionManagers.Add( new TypePair( typeof( ConvexCollidable<BoxShape> ), typeof( VoxelBlob ) ), factory );
				NarrowPhaseHelper.CollisionManagers.Add( new TypePair( typeof( ConvexCollidable<SphereShape> ), typeof( VoxelBlob ) ), factory );
				NarrowPhaseHelper.CollisionManagers.Add( new TypePair( typeof( ConvexCollidable<CapsuleShape> ), typeof( VoxelBlob ) ), factory );
				NarrowPhaseHelper.CollisionManagers.Add( new TypePair( typeof( ConvexCollidable<TriangleShape> ), typeof( VoxelBlob ) ), factory );
				NarrowPhaseHelper.CollisionManagers.Add( new TypePair( typeof( ConvexCollidable<CylinderShape> ), typeof( VoxelBlob ) ), factory );
				NarrowPhaseHelper.CollisionManagers.Add( new TypePair( typeof( ConvexCollidable<ConeShape> ), typeof( VoxelBlob ) ), factory );
				NarrowPhaseHelper.CollisionManagers.Add( new TypePair( typeof( ConvexCollidable<TransformableShape> ), typeof( VoxelBlob ) ), factory );
				NarrowPhaseHelper.CollisionManagers.Add( new TypePair( typeof( ConvexCollidable<MinkowskiSumShape> ), typeof( VoxelBlob ) ), factory );
				NarrowPhaseHelper.CollisionManagers.Add( new TypePair( typeof( ConvexCollidable<WrappedShape> ), typeof( VoxelBlob ) ), factory );
				NarrowPhaseHelper.CollisionManagers.Add( new TypePair( typeof( ConvexCollidable<ConvexHullShape> ), typeof( VoxelBlob ) ), factory );
			}
		}
示例#4
0
 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);
 }