Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public Vector3 CalcInterpolatedVertexPosition(int index, Md5Anim anim, float frame)
        {
            Md5Vertex v = Vertices[index];

            return(CalcInterpolatedVertexPosition(v, anim, frame));
        }
Exemplo n.º 5
0
        public Vector3 CalcVertexPosition(int index, Md5Anim anim, int frame)
        {
            Md5Vertex v = Vertices[index];

            return(CalcVertexPosition(v, anim, frame));
        }
Exemplo n.º 6
0
        public Vector3 CalcVertexPosition(int index, Md5Joint[] joints)
        {
            Md5Vertex v = Vertices[index];

            return(CalcVertexPosition(v, joints));
        }
Exemplo n.º 7
0
        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;
        }
Exemplo n.º 8
0
        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;
        }
Exemplo n.º 9
0
        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;
        }