public Vector3 CalcInterpolatedVertexPosition(Md5Vertex v, Md5Anim a, float frame) { int frame1 = (int)frame; int frame2 = (int)(frame + 1); float alpha = frame - (float)frame1; return(CalcVertexPosition(v, a, frame1) * (1 - alpha) + CalcVertexPosition(v, a, frame2) * alpha); }
public Vector3 CalcVertexPosition(Md5Vertex v, Md5Joint[] joints) { Vector3 pos = Vector3.Zero; for (int i = v.WeightIndex; i < v.WeightIndex + v.WeightCount; ++i) { Md5Weight w = Weights[i]; Md5Joint j = joints[w.JointIndex]; pos += w.Value * Transform(w.Position, j); } return(pos); }
public Vector3 CalcVertexPosition(Md5Vertex v, Md5Anim a, int frame) { Vector3 pos = Vector3.Zero; for (int i = v.WeightIndex; i < v.WeightIndex + v.WeightCount; ++i) { Md5Weight w = Weights[i]; Md5JointValue j = a.Frames[frame].Values[w.JointIndex]; Matrix4 m = Matrix4Extensions.FromTranslation(j.Position) * Matrix4Extensions.FromQuaternion(j.Orientation); pos += w.Value * Vector3.Transform(w.Position, m); } return(pos); }
public Vector3 CalcInterpolatedVertexPosition(int index, Md5Anim anim, float frame) { Md5Vertex v = Vertices[index]; return(CalcInterpolatedVertexPosition(v, anim, frame)); }
public Vector3 CalcVertexPosition(int index, Md5Anim anim, int frame) { Md5Vertex v = Vertices[index]; return(CalcVertexPosition(v, anim, frame)); }
public Vector3 CalcVertexPosition(int index, Md5Joint[] joints) { Md5Vertex v = Vertices[index]; return(CalcVertexPosition(v, joints)); }
public Vector3 CalcVertexPosition(Md5Vertex v, Md5Anim a, int frame) { Vector3 pos = Vector3.Zero; for (int i = v.WeightIndex; i < v.WeightIndex + v.WeightCount; ++i) { Md5Weight w = Weights[i]; Md5JointValue j = a.Frames[frame].Values[w.JointIndex]; Matrix4 m = Matrix4Extensions.FromTranslation(j.Position) * Matrix4Extensions.FromQuaternion(j.Orientation); pos += w.Value * Vector3.Transform(w.Position,m); } return pos; }
public Vector3 CalcVertexPosition(Md5Vertex v, Md5Joint[] joints) { Vector3 pos=Vector3.Zero; for (int i = v.WeightIndex; i < v.WeightIndex + v.WeightCount; ++i) { Md5Weight w = Weights[i]; Md5Joint j = joints[w.JointIndex]; pos += w.Value * Transform(w.Position, j); } return pos; }
public Vector3 CalcInterpolatedVertexPosition(Md5Vertex v, Md5Anim a, float frame) { int frame1 = (int)frame; int frame2 = (int)(frame + 1); float alpha = frame - (float)frame1; return CalcVertexPosition(v, a, frame1) * (1 - alpha) + CalcVertexPosition(v, a, frame2) * alpha; }