コード例 #1
0
ファイル: ScenarioObject.cs プロジェクト: mksbamford/Moonfxsh
        private Matrix4 CalculateWorldMatrix(RenderModelNodeBlock nodeBlock)
        {
            if (!(( RenderModelBlock )Model.RenderModel.Get(_key)).Nodes.Contains(nodeBlock))
            {
                throw new ArgumentOutOfRangeException( );
            }

            return(Nodes.GetWorldMatrix(nodeBlock));
        }
コード例 #2
0
        public static void SetWorldMatrix(this IList <RenderModelNodeBlock> list, RenderModelNodeBlock node,
                                          Matrix4 value)
        {
            if (!list.Contains(node))
            {
                throw new ArgumentOutOfRangeException();
            }

            var matrix = node.ParentNode < 0
                ? value
                : value *list.GetWorldMatrix(list[node.ParentNode]).Inverted();

            node.WorldMatrix = matrix;
        }
コード例 #3
0
        public static Matrix4 GetWorldMatrix(this IList <RenderModelNodeBlock> list, RenderModelNodeBlock node)
        {
            if (!list.Contains(node))
            {
                throw new ArgumentOutOfRangeException();
            }

            var worldMatrix = node.WorldMatrix;

            if (node.ParentNode < 0)
            {
                return(worldMatrix);
            }
            return(worldMatrix * list.GetWorldMatrix(list[node.ParentNode]));
        }
コード例 #4
0
        public static Matrix4 GetInverseBindPoseTransfrom(this IList <RenderModelNodeBlock> list,
                                                          RenderModelNodeBlock node)
        {
            if (!list.Contains(node))
            {
                throw new ArgumentOutOfRangeException();
            }

            var inverseBindPoseTransfrom = node.CalculateInverseBindTransform();

            if (node.ParentNode < 0)
            {
                return(inverseBindPoseTransfrom);
            }
            return(list.GetInverseBindPoseTransfrom(list[node.ParentNode]) * inverseBindPoseTransfrom);
        }
コード例 #5
0
ファイル: ScenarioObject.cs プロジェクト: mksbamford/Moonfxsh
 private void SetWorldMatrix(RenderModelNodeBlock nodeBlock, Matrix4 value)
 {
     Nodes.SetWorldMatrix(nodeBlock, value);
 }