コード例 #1
0
ファイル: modelprocessor.cs プロジェクト: zfedoran/helium
        private static AnimationMesh CreateMesh(SerializableMesh meshContent)
        {
            AnimationMesh mesh = new AnimationMesh(meshContent.name);
            AnimationVertex[] vertices = new AnimationVertex[meshContent.vertices.Length];

            for (int i = 0; i < vertices.Length; i++)
            {
                SerializableVertex vertexContent = meshContent.vertices[i];
                vertices[i] = new AnimationVertex
                {
                    position = vertexContent.position,
                    normal = vertexContent.normal,
                    texture = vertexContent.texture,
                    blendweights = vertexContent.blendweights,
                    blendindices = vertexContent.blendindices
                };
            }

            mesh.SetIndices(meshContent.indices);
            mesh.SetVertices(vertices);
            mesh.SetTextureName(meshContent.textureName);

            return mesh;
        }
コード例 #2
0
ファイル: mesh.cs プロジェクト: zfedoran/helium
 //-----------------------------------------------------------------------
 //////////////////////////////////////////////////////////////////////////
 // PUBLIC METHODS
 //////////////////////////////////////////////////////////////////////////
 //-----------------------------------------------------------------------
 public void SetVertices(AnimationVertex[] vertexArray)
 {
     this.vertices = vertexArray; isDirty = true;
 }