示例#1
0
        internal void ApplyCHR0(CHR0Node node, float index)
        {
            CHR0EntryNode e;

            _frameState = _bindState;

            if (node != null && index >= 1 && (e = node.FindChild(Name, false) as CHR0EntryNode) != null) //Set to anim pose
                fixed(FrameState *v = &_frameState)
                {
                    float *f = (float *)v;

                    for (int i = 0; i < 9; i++)
                    {
                        if (e.Keyframes[i]._keyCount > 0)
                        {
                            f[i] = e.GetFrameValue(i, index - 1);
                        }
                    }

                    _frameState.CalcTransforms();
                }

            foreach (MDL0BoneNode b in Children)
            {
                b.ApplyCHR0(node, index);
            }
        }
示例#2
0
        internal void ApplyCHR0(CHR0Node node, int index, bool linear)
        {
            CHR0EntryNode e;

            _frameState = _bindState;

            if (node != null && index > 0 && (e = node.FindChild(Name, false) as CHR0EntryNode) != null) //Set to anim pose
                fixed(FrameState *v = &_frameState)
                {
                    float *f = (float *)v;

                    for (int i = 0; i < 9; i++)
                    {
                        if (e.Keyframes[(KeyFrameMode)(i + 0x10)] > 0)
                        {
                            f[i] = e.GetFrameValue((KeyFrameMode)(i + 0x10), index - 1, linear, node.Loop);
                        }
                    }

                    _frameState.CalcTransforms();
                }

            foreach (MDL0BoneNode b in Children)
            {
                b.ApplyCHR0(node, index, linear);
            }
        }
示例#3
0
        internal void ApplyCHR0(CHR0Node node, int index)
        {
            CHR0EntryNode e;

            if ((node == null) || (index == 0)) //Reset to bind pose
            {
                _frameState = _bindState;
            }
            else if ((e = node.FindChild(Name, false) as CHR0EntryNode) != null) //Set to anim pose
            {
                _frameState = new FrameState(e.GetAnimFrame(index - 1));
            }
            else //Set to neutral pose
            {
                _frameState = _bindState;
            }

            foreach (MDL0BoneNode b in Children)
            {
                b.ApplyCHR0(node, index);
            }
        }
        internal void ApplyCHR0(CHR0Node node, int index, bool linear)
        {
            CHR0EntryNode e;

            _frameState = _bindState;

            if (node != null && index > 0 && (e = node.FindChild(Name, false) as CHR0EntryNode) != null) //Set to anim pose
                fixed (FrameState* v = &_frameState)
                {
                    float* f = (float*)v;
                    for (int i = 0; i < 9; i++)
                        if (e.Keyframes[(KeyFrameMode)(i + 0x10)] > 0)
                            f[i] = e.GetFrameValue((KeyFrameMode)(i + 0x10), index - 1, linear, node.Loop);

                    _frameState.CalcTransforms();
                }

            foreach (MDL0BoneNode b in Children)
                b.ApplyCHR0(node, index, linear);
        }