예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #4
0
        public Vector3 CalcInterpolatedVertexPosition(int index, Md5Anim anim, float frame)
        {
            Md5Vertex v = Vertices[index];

            return(CalcInterpolatedVertexPosition(v, anim, frame));
        }
예제 #5
0
        public Vector3 CalcVertexPosition(int index, Md5Anim anim, int frame)
        {
            Md5Vertex v = Vertices[index];

            return(CalcVertexPosition(v, anim, frame));
        }
예제 #6
0
        public Vector3 CalcVertexPosition(int index, Md5Joint[] joints)
        {
            Md5Vertex v = Vertices[index];

            return(CalcVertexPosition(v, joints));
        }
예제 #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;
        }
예제 #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;
        }
예제 #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;
        }