示例#1
0
        //============================================================
        public FDxGeometry Create(FDxDevice3D device, string modelCode, string geometryCode)
        {
            // 创建几何体
            FDxGeometry geometry = RDxCore.Factory.Create <FDxGeometry>(EDxObject.ModelGeometry);

            geometry.Device = device;
            // 加载资源
            FDxModel         model         = RDxCore.ModelConsole.Get(device, modelCode);
            FDxModelGeometry modelGeometry = model.Geometries.Get(geometryCode);

            geometry.ModelGeometry = modelGeometry;
            geometry.Setup();
            return(geometry);
        }
示例#2
0
        //============================================================
        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);
        }