当前位置: 首页>>代码示例>>C#>>正文


C# ModelBase.GetParentOffset方法代码示例

本文整理汇总了C#中ModelBase.GetParentOffset方法的典型用法代码示例。如果您正苦于以下问题:C# ModelBase.GetParentOffset方法的具体用法?C# ModelBase.GetParentOffset怎么用?C# ModelBase.GetParentOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModelBase的用法示例。


在下文中一共展示了ModelBase.GetParentOffset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteBonesFileOBJ

        private static void WriteBonesFileOBJ(string filename, ModelBase.BoneDefRoot boneTree)
        {
            // Write information about each bone, whether it's a parent or child to file
            // This is specific to this editor and will need re-added when re-importing if model modified

            StreamWriter bonesWriter = new StreamWriter(filename);

            foreach (ModelBase.BoneDef bone in boneTree)
            {
                bonesWriter.Write("newbone " + bone.m_ID + "\n");
                // Offset in bones to parent bone (signed 16-bit. 0=no parent, -1=parent is the previous bone, ...)
                bonesWriter.Write("parent_offset " + boneTree.GetParentOffset(bone) + "\n");
                // 1 if the bone has children, 0 otherwise
                bonesWriter.Write("has_children " + ((bone.m_HasChildren) ? "1" : "0") + "\n");
                // Offset in bones to the next sibling bone (0=bone is last child of its parent)
                bonesWriter.Write("sibling_offset " + boneTree.GetNextSiblingOffset(bone) + "\n");
                // Scale component
                bonesWriter.Write("scale " + bone.m_20_12Scale[0].ToString("X8") + " " + bone.m_20_12Scale[1].ToString("X8") + " " +
                    bone.m_20_12Scale[2].ToString("X8") + "\n");
                // Rotation component
                bonesWriter.Write("rotation " + bone.m_4_12Rotation[0].ToString("X4") + " " + bone.m_4_12Rotation[1].ToString("X4") + " " +
                    bone.m_4_12Rotation[2].ToString("X4") + "\n");
                // Translation component
                bonesWriter.Write("translation " + bone.m_20_12Translation[0].ToString("X8") + " " + bone.m_20_12Translation[0].ToString("X8") +
                    " " + bone.m_20_12Translation[2].ToString("X8") + "\n\n");
            }

            bonesWriter.Close();
        }
开发者ID:RicoPlays,项目名称:sm64dse,代码行数:29,代码来源:OBJWriter.cs


注:本文中的ModelBase.GetParentOffset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。