Exemplo n.º 1
0
        protected override async System.Threading.Tasks.Task <ResourceInfo> CreateResourceInfoFromResourceOverride(RName resourceName)
        {
            await EngineNS.Thread.AsyncDummyClass.DummyFunc();

            var result = new VertexCloudResourceInfo();

            result.ResourceName = resourceName;

            return(result);
        }
Exemplo n.º 2
0
        public async System.Threading.Tasks.Task <ResourceInfo> CreateEmptyResource(string Absfolder, string rootFolder, EditorCommon.Resources.IResourceCreateData createData)
        {
            var result = new VertexCloudResourceInfo();

            var mcd    = createData as VertexCloudResourceInfoData;
            var reName = EngineNS.CEngine.Instance.FileManager._GetRelativePathFromAbsPath(Absfolder + "/" + mcd.ResourceName, rootFolder) + CEngineDesc.VertexCloudExtension;

            result.ResourceName = RName.GetRName(reName, mcd.RNameType);

            var mesh = EngineNS.CEngine.Instance.MeshPrimitivesManager.GetMeshPrimitives(EngineNS.CEngine.Instance.RenderContext, mcd.GeomMesh);

            if (mesh == null)
            {
                return(null);
            }

            var density = 1.0f;

            if (mcd.Density == VertexCloudResourceInfoData.DensityType.Density2)
            {
                density = 1.5f;
            }
            else if (mcd.Density == VertexCloudResourceInfoData.DensityType.Density3)
            {
                density = 2f;
            }
            else if (mcd.Density == VertexCloudResourceInfoData.DensityType.Density4)
            {
                density = 3f;
            }

            var vcobj = await EngineNS.Graphics.Mesh.CGfxVertexCloud.CookFromMesh(EngineNS.CEngine.Instance.RenderContext, mesh, density);

            vcobj.SaveVertexCloud(result.ResourceName);

            return(result);
        }