예제 #1
0
파일: MD5Mesh.cs 프로젝트: QuakeEngines/qio
 public void buildVertices(IBoneOrientations currentBones)
 {
     foreach (MD5Vertex v in vertices)
     {
         Vec3 pos = new Vec3();
         pos.set(0, 0, 0);
         for (int i = 0; i < v.getNumWeights(); i++)
         {
             MD5Weight w = weights[v.getFirstWeightIndex() + i];
             Quat      q = currentBones.getBoneQuat(w.getBoneIndex());
             Vec3      p = currentBones.getBonePos(w.getBoneIndex());
             // get weight position rotated by joint quaternion
             Vec3 ofsRotated = q.rotatePoint(w.getOfs());
             // get weight position in world coordinates
             Vec3 ofsWorld = ofsRotated + p;
             pos += ofsWorld * w.getWeight();
         }
         v.setCurrentPos(pos);
     }
 }
예제 #2
0
파일: MD5Mesh.cs 프로젝트: QuakeEngines/qio
 public void addWeight(MD5Weight w)
 {
     weights.Add(w);
 }