public static void DrawVBN(VBN vbn) { // Used for NUD, BFRES, BCH. float ToRad = (float)Math.PI / 180; int swinganim = 0; swinganim++; if (swinganim > 100) { swinganim = 0; } if (vbn != null) { Bone selectedBone = null; foreach (Bone bone in vbn.bones) { if (!bone.IsSelected) { bone.Draw(); } else { selectedBone = bone; } if (vbn.SwingBones != null && (Runtime.renderSwagY || Runtime.renderSwagZ)) { SB.SBEntry sb = null; vbn.SwingBones.TryGetEntry(bone.boneId, out sb); if (sb != null) { float sf = Math.Abs(((swinganim - 50) / 50f)); float sz = (sb.rz1 + (sb.rz2 - sb.rz1) * sf) * ToRad; float sy = (sb.ry1 + (sb.ry2 - sb.ry1) * sf) * ToRad; if (!Runtime.renderSwagY) { sy = 0; } if (!Runtime.renderSwagZ) { sz = 0; } bone.rot = VBN.FromEulerAngles(bone.rotation[2], bone.rotation[1], bone.rotation[0]) * VBN.FromEulerAngles(sz, sy, 0); } } } if (selectedBone != null) { GL.Clear(ClearBufferMask.DepthBufferBit); selectedBone.Draw(); } if (vbn.SwingBones != null && (Runtime.renderSwagY || Runtime.renderSwagZ)) { vbn.update(); } } }