Пример #1
0
 public override PmxMaterialData[] CreateMaterials(World wolrd, ShotProperty prop)
 {
     PmxMaterialData[] result = new PmxMaterialData[Data.MaterialArray.Length];
     for (int i = 0; i < result.Length; i++)
     {
         result[i] = CloneUtil.Clone(Data.MaterialArray[i]);
     }
     return(result);
 }
Пример #2
0
        static Material GetMat(PmxModelData model, int matInd)
        {
            PmxMaterialData data        = model.MaterialArray[matInd];
            var             faceIndex   = IndiceByMaterial(model, matInd);
            var             flattenFace = faceIndex.SelectMany(x => x).Select(x => GetVert(model, x));
            string          texName     = string.Empty;
            string          sphereName  = string.Empty;

            // テクスチャがない場合255が使われる
            if (data.TextureId != 255)
            {
                texName = model.TextureFiles[data.TextureId];
            }
            if (data.SphereId != 255)
            {
                sphereName = model.TextureFiles[data.SphereId];
            }
            Material temp =
                new Material(data.MaterialName, texName, sphereName, flattenFace, faceIndex, data.Mode);

            return(temp);
        }
        public ShotModelData(World world, ShotProperty property)
        {
            Property = property;
            World    = world;

            Bones = Property.Type.CreateBones(world, property);

            if (Property.Type.HasMesh)
            {
                Vertices  = Property.Type.CreateVertices(world, property);
                Indices   = Property.Type.CreateVertexIndices(world, property);
                Materials = Property.Type.CreateMaterials(world, property);
                Textures  = Property.Type.CreateTextures(world, property);
            }
            else
            {
                Vertices  = new PmxVertexData[0];
                Indices   = new int[0];
                Materials = new PmxMaterialData[0];
                Textures  = new string[0];
            }
        }