Example #1
0
        public static DualQuaternion GetBoneLocalDQ(IINode _node, int[] _frames, int _f)
        {
            IINode     _parent_node     = _node.ParentNode;
            IIGameNode _GNode           = maxGlobal.IGameInterface.GetIGameNode(_node);
            IIGameNode _parentGNode     = maxGlobal.IGameInterface.GetIGameNode(_parent_node);
            int        _ticks_per_frame = maxGlobal.TicksPerFrame;

            // node Local Transform
            IGMatrix       _node_LGmatrix = _GNode.GetLocalTM(_frames[_f] * _ticks_per_frame);
            DualQuaternion _node_LDQ      = _node_LGmatrix.convertToDQ(Transformation.Rotation);

            _node_LDQ.Normalize();
            IGMatrix       _node_BLGmatrix = _GNode.GetLocalTM(0);
            DualQuaternion _node_BLDQ      = _node_BLGmatrix.convertToDQ(Transformation.Rotation);

            _node_BLDQ.Normalize();
            DualQuaternion _node_LTDQL = _node_LDQ * DualQuaternion.Conjugate(_node_BLDQ);

            return(_node_LTDQL);
        }