private SSSkeletalMeshMD5 readMesh(SSSkeletalJoint[] joints) { SSSkeletalMeshMD5 newMesh = new SSSkeletalMeshMD5(); Match[] matches; matches = seekEntry("shader", SSMD5Parser._quotedStrRegex); newMesh.materialShaderString = matches[1].Value; matches = seekEntry("numverts", SSMD5Parser._uintRegex); int numVertices = Convert.ToInt32(matches [1].Value); newMesh.vertices = new SSSkeletalVertex[numVertices]; for (int v = 0; v < numVertices; ++v) { int vertexIndex; var vertex = readVertex(out vertexIndex); newMesh.vertices [vertexIndex] = vertex; } matches = seekEntry("numtris", SSMD5Parser._uintRegex); int numTris = Convert.ToUInt16(matches [1].Value); newMesh.triangleIndices = new UInt16[numTris * 3]; for (int t = 0; t < numTris; ++t) { readTriangle(newMesh.triangleIndices); } matches = seekEntry("numweights", SSMD5Parser._uintRegex); int numWeights = Convert.ToInt32(matches [1].Value); newMesh.weights = new SSSkeletalWeight[numWeights]; for (int w = 0; w < numWeights; ++w) { int weightIdx; SSSkeletalWeight weight = readWeight(out weightIdx); newMesh.weights [weightIdx] = weight; } return(newMesh); }
public SSSkeletalWeightRuntime(SSSkeletalWeight weight) { baseInfo = weight; jointLocalNormal = Vector3.Zero; }