Esempio n. 1
0
        /// <summary>
        /// c-tor - generic way for collecting resources
        /// </summary>
        /// <param name="meshInfo"></param>
        /// assetName - just for debug output
        public MyMesh(MyMeshPartInfo meshInfo, string assetName)
        {
            MyMaterialDescriptor matDesc = meshInfo.m_MaterialDesc;

            if (matDesc != null)
            {
                string texName;
                matDesc.Textures.TryGetValue("DiffuseTexture", out texName);

                var material = new MyMeshMaterial();
                material.Name              = meshInfo.m_MaterialDesc.MaterialName;
                material.DiffuseTexture    = texName;
                material.Textures          = matDesc.Textures;
                material.SpecularIntensity = meshInfo.m_MaterialDesc.SpecularIntensity;
                material.SpecularPower     = meshInfo.m_MaterialDesc.SpecularPower;
                material.DrawTechnique     = meshInfo.Technique;
                material.GlassCW           = meshInfo.m_MaterialDesc.GlassCW;
                material.GlassCCW          = meshInfo.m_MaterialDesc.GlassCCW;
                material.GlassSmooth       = meshInfo.m_MaterialDesc.GlassSmoothNormals;

                Material = material;
            }
            else
            {
                //It is OK because ie. collision meshes dont have materials
                Material = new MyMeshMaterial();
            }

            AssetName = assetName;
        }
Esempio n. 2
0
        /// <summary>
        /// c-tor - generic way for collecting resources
        /// </summary>
        /// <param name="meshInfo"></param>
        /// assetName - just for debug output
        public MyMesh(MyMeshPartInfo meshInfo, string assetName)
        {
            MyMaterialDescriptor matDesc = meshInfo.m_MaterialDesc;
            if (matDesc != null)
            {
                string texName;
                matDesc.Textures.TryGetValue("DiffuseTexture", out texName);

                var material = new MyMeshMaterial();
                material.Name = meshInfo.m_MaterialDesc.MaterialName;
                material.DiffuseTexture = texName;
                material.Textures = matDesc.Textures;
                material.SpecularIntensity = meshInfo.m_MaterialDesc.SpecularIntensity;
                material.SpecularPower = meshInfo.m_MaterialDesc.SpecularPower;
                material.DrawTechnique = meshInfo.Technique;
                material.GlassCW = meshInfo.m_MaterialDesc.GlassCW;
                material.GlassCCW = meshInfo.m_MaterialDesc.GlassCCW;
                material.GlassSmooth = meshInfo.m_MaterialDesc.GlassSmoothNormals;

                Material = material;
            }
            else
            {
                //It is OK because ie. collision meshes dont have materials
                Material = new MyMeshMaterial();
            }

            AssetName = assetName;
        }
Esempio n. 3
0
 public MyMesh(MyMeshMaterial material, string assetName)
 {
     Material  = material;
     AssetName = assetName;
 }
Esempio n. 4
0
 public MyMesh(MyMeshMaterial material, string assetName)
 {
     Material = material;
     AssetName = assetName;
 }