Beispiel #1
0
        private PMD_FACE_VTX[] _face_vertex; // 表情頂点データ

        public PmdFace(PMD_FACE pPMDFaceData, PmdFace pPMDFaceBase)
        {
            // 表情名のコピー
            this._name = pPMDFaceData.szName;

            // 表情頂点データのコピー
            int number_of_vertex = pPMDFaceData.ulNumVertices;

            this._face_vertex = PMD_FACE_VTX.createArray(number_of_vertex);
            for (int i = 0; i < this._face_vertex.Length; i++)
            {
                this._face_vertex[i].setValue(pPMDFaceData.pVertices[i]);
            }
            // baseとの相対インデックスを絶対インデックスに変換
            if (pPMDFaceBase != null)
            {
                PMD_FACE_VTX[] vertex_array = this._face_vertex;
                for (int i = 0; i < this._face_vertex.Length; i++)
                {
                    PMD_FACE_VTX vertex = vertex_array[i];
                    vertex.vec3Pos.Vector3Add(pPMDFaceBase._face_vertex[vertex.ulIndex].vec3Pos, vertex.vec3Pos);
                    vertex.ulIndex = pPMDFaceBase._face_vertex[vertex.ulIndex].ulIndex;
                }
            }
            return;
        }
Beispiel #2
0
        public void setFace(MmdVector3[] pvec3Vertices)
        {
            if (this._face_vertex == null)
            {
                throw new MmdException();
            }

            PMD_FACE_VTX[] vertex_array = this._face_vertex;
            for (int i = 0; i < vertex_array.Length; i++)
            {
                PMD_FACE_VTX vertex = vertex_array[i];
                pvec3Vertices[vertex.ulIndex].setValue(vertex.vec3Pos);
            }
            return;
        }
Beispiel #3
0
        public void blendFace(MmdVector3[] pvec3Vertices, float fRate)
        {
            if (this._face_vertex == null)
            {
                throw new MmdException();
            }

            PMD_FACE_VTX[] vertex_array = this._face_vertex;
            for (int i = 0; i < vertex_array.Length; i++)
            {
                PMD_FACE_VTX vertex  = vertex_array[i];
                int          ulIndex = vertex.ulIndex;
                pvec3Vertices[ulIndex].Vector3Lerp(pvec3Vertices[ulIndex], vertex.vec3Pos, fRate);
            }
            return;
        }