本文整理汇总了C#中ModelBase.GetNextSiblingOffset方法的典型用法代码示例。如果您正苦于以下问题:C# ModelBase.GetNextSiblingOffset方法的具体用法?C# ModelBase.GetNextSiblingOffset怎么用?C# ModelBase.GetNextSiblingOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelBase
的用法示例。
在下文中一共展示了ModelBase.GetNextSiblingOffset方法的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();
}