//============================================================ public void LoadResource(FDxRsModel resource) { int count = resource.Mesh.Geometries.Count; for (int n = 0; n < count; n++) { // 创建几何体 FDxModelGeometry geometry = new FDxModelGeometry(); geometry.Device = _device; // 加载资源 FDxRsGeometry geometryResource = resource.Mesh.Geometries[n]; geometry.LoadResource(geometryResource); // 存储对象 _geometries.Set(geometry.Name, geometry); _renderables.Push(geometry); } }
//============================================================ public FDxModel Get(FDxDevice3D device, string code) { FDxModel model = _models.Find(code); if (null == model) { // 创建模型 model = new FDxModel(); model.Device = device; // 加载模型资源 FDxRsModel rsModel = RDxCore.ModelResourceConsole.Get(code); model.LoadResource(rsModel); // 存储模型 _models.Set(code, model); } return(model); }