private void HandleAddBoneIndexWeight(List <VertexArealBoneIndexWeight> tmpStorage, ref MyVertex_BoneIndicesWeights indicesWeights, int index, float arealCoord) { float boneWeight = indicesWeights.Weights[index]; if (boneWeight == 0) { return; } byte boneIndex = indicesWeights.Indices[index]; int existingBoneIndex = FindExsistingBoneIndexWeight(tmpStorage, boneIndex); if (existingBoneIndex == -1) { tmpStorage.Add(new VertexArealBoneIndexWeight() { Index = boneIndex, Weight = boneWeight * arealCoord }); } else { VertexArealBoneIndexWeight boneIndexWeight = tmpStorage[existingBoneIndex]; boneIndexWeight.Weight += boneWeight * arealCoord; tmpStorage[existingBoneIndex] = boneIndexWeight; } }
// Compare in reverse order private int Comparison(VertexArealBoneIndexWeight x, VertexArealBoneIndexWeight y) { if (x.Weight > y.Weight) { return(-1); } else if (x.Weight == y.Weight) { return(0); } else { return(1); } }
// Compare in reverse order private int Comparison(VertexArealBoneIndexWeight x, VertexArealBoneIndexWeight y) { if (x.Weight > y.Weight) return -1; else if (x.Weight == y.Weight) return 0; else return 1; }