public abstract Initialise ( IMesher meshmerizer, IVoxelMesher voxmesher, IConfigSource config ) : void | ||
meshmerizer | IMesher | |
voxmesher | IVoxelMesher | |
config | IConfigSource | |
return | void |
/// <summary> /// Get a physics scene for the given physics engine and mesher. /// </summary> /// <param name="physEngineName"></param> /// <param name="voxMesherName"></param> /// <param name="meshEngineName"></param> /// <param name="config"></param> /// <returns></returns> public PhysicsScene GetPhysicsScene(string physEngineName, string voxMesherName, string meshEngineName, IConfigSource config, string regionName) { if (String.IsNullOrEmpty(physEngineName)) { return(PhysicsScene.Null); } if (String.IsNullOrEmpty(meshEngineName)) { return(PhysicsScene.Null); } if (String.IsNullOrEmpty(voxMesherName)) { return(PhysicsScene.Null); } IMesher meshEngine = null; if (_MeshPlugins.ContainsKey(meshEngineName)) { m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName); meshEngine = _MeshPlugins[meshEngineName].GetMesher(config); } else { m_log.WarnFormat("[PHYSICS]: couldn't find meshingEngine: {0}", meshEngineName); throw new ArgumentException(String.Format("couldn't find meshingEngine: {0}", meshEngineName)); } IVoxelMesher voxelMesher = null; if (_VoxMeshPlugins.ContainsKey(voxMesherName)) { m_log.Info("[PHYSICS]: creating voxel meshing engine " + voxMesherName); voxelMesher = _VoxMeshPlugins[voxMesherName].GetMesher(config); } else { m_log.WarnFormat("[PHYSICS]: couldn't find meshingEngine: {0}", voxMesherName); throw new ArgumentException(String.Format("couldn't find meshingEngine: {0}", voxMesherName)); } if (_PhysPlugins.ContainsKey(physEngineName)) { m_log.Info("[PHYSICS]: creating " + physEngineName); PhysicsScene result = _PhysPlugins[physEngineName].GetScene(regionName); result.Initialise(meshEngine, voxelMesher, config); return(result); } else { m_log.WarnFormat("[PHYSICS]: couldn't find physicsEngine: {0}", physEngineName); throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}", physEngineName)); } }
/// <summary> /// Get a physics scene for the given physics engine and mesher. /// </summary> /// <param name="physEngineName"></param> /// <param name="meshEngineName"></param> /// <param name="config"></param> /// <returns></returns> public PhysicsScene GetPhysicsScene(string physEngineName, string meshEngineName, IConfigSource config, RegionInfo region) { if (String.IsNullOrEmpty(physEngineName)) { return(new NullPhysicsScene()); } if (String.IsNullOrEmpty(meshEngineName)) { return(new NullPhysicsScene()); } IMesher meshEngine = null; if (_MeshPlugins.ContainsKey(meshEngineName)) { m_log.Info("[Physics]: Loading meshing engine: " + meshEngineName); meshEngine = _MeshPlugins[meshEngineName].GetMesher(config); } else { m_log.WarnFormat("[Physics]: Couldn't find meshing engine: {0}", meshEngineName); throw new ArgumentException(String.Format("couldn't find meshing engine: {0}", meshEngineName)); } if (_PhysPlugins.ContainsKey(physEngineName)) { m_log.Info("[Physics]: Loading physics engine: " + physEngineName); PhysicsScene result = _PhysPlugins[physEngineName].GetScene(region.RegionName); result.Initialise(meshEngine, region); result.PostInitialise(config); return(result); } else { m_log.WarnFormat("[Physics]: Couldn't find physics engine: {0}", physEngineName); throw new ArgumentException(String.Format("couldn't find physics engine: {0}", physEngineName)); } }