From 9a6fdac7b40ba3eba601d545d28350d4c53d3a3d Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sun, 20 Sep 2026 12:46:19 -0400 Subject: body/faceOffsets -> body/faceRotations Signed-off-by: Andrew Opalach --- Plugin.cs | 60 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/Plugin.cs b/Plugin.cs index 2070add..ee9580f 100755 --- a/Plugin.cs +++ b/Plugin.cs @@ -520,10 +520,10 @@ namespace NewCamera private Hook? updateJointsHook; private List bodyJoints = new List(); private List ignoredJoints = new List(); - private Dictionary> bodyOffsets = new Dictionary>(); + private Dictionary> bodyRotations = new Dictionary>(); private List faceJoints = new List(); - private Dictionary> faceOffsets = new Dictionary>(); + private Dictionary> faceRotations = new Dictionary>(); #if QUARANTINED_FEATURES private delegate void UpdateIK(nint superOfChild, nint joint, nint obj); @@ -2724,9 +2724,9 @@ namespace NewCamera Assert(playerJoints[id] == 0x0); playerJoints[id] = jointAddr; } - foreach (nint joint in bodyOffsets.Where(e => !bodyJoints.Contains(e.Key)).Select(e => e.Key).ToList()) + foreach (nint joint in bodyRotations.Where(e => !bodyJoints.Contains(e.Key)).Select(e => e.Key).ToList()) { - bodyOffsets.Remove(joint); + bodyRotations.Remove(joint); } #if QUARANTINED_FEATURES foreach (nint joint in ikOffsets.Where(e => !bodyJoints.Contains(e.Key)).Select(e => e.Key).ToList()) @@ -2737,7 +2737,7 @@ namespace NewCamera } } - private void drawJoint(nint jointAddr, Dictionary> offsets) + private void drawJoint(nint jointAddr, Dictionary> rotations) { if (jointAddr == 0x0) return; ImGui.PushID(jointAddr); @@ -2775,12 +2775,12 @@ namespace NewCamera { ImGui.PushStyleVar(ImGuiStyleVar.Alpha, ImGui.GetStyle().Alpha * 0.5f); } - bool hasOffset = offsets.ContainsKey(jointAddr); - if (!hasOffset) + bool hasRotation = rotations.ContainsKey(jointAddr); + if (!hasRotation) { - if (ImGui.Button("Add Offset")) + if (ImGui.Button("Add Rotation")) { - offsets.Add(jointAddr, new List() + rotations.Add(jointAddr, new List() { new Vector3() }); @@ -2795,31 +2795,31 @@ namespace NewCamera ImGui.Text("(Enforced by Inverse Kinematics)"); ImGui.PopStyleVar(); } - if (hasOffset) + if (hasRotation) { bool doRemove = ImGui.Button("X"); ImGui.SameLine(); if (ImGui.Button("Reset")) { - offsets[jointAddr][0] = new Vector3(); + rotations[jointAddr][0] = new Vector3(); } ImGui.SameLine(); - Vector3 v = offsets[jointAddr][0]; - if (ImGui.DragFloat3($"Offset", ref v, 0.005f)) + Vector3 v = rotations[jointAddr][0]; + if (ImGui.DragFloat3($"Rotation", ref v, 0.005f)) { - offsets[jointAddr][0] = v; + rotations[jointAddr][0] = v; } - if (doRemove) offsets.Remove(jointAddr); + if (doRemove) rotations.Remove(jointAddr); } ImGui.PopID(); } private void drawJoint(nint jointAddr) { - drawJoint(jointAddr, bodyOffsets); + drawJoint(jointAddr, bodyRotations); } - private void drawJointLeaf(ref List joints, int i, Dictionary> offsets) + private void drawJointLeaf(ref List joints, int i, Dictionary> rotations) { if (i >= joints.Count) return; nint jointAddr = joints[i]; @@ -2827,10 +2827,10 @@ namespace NewCamera ImGui.PushID(jointAddr); if (ImGui.CollapsingHeader($"Joint #{i} (0x{jointAddr:X}, id: 0x{id:X})")) { - drawJoint(jointAddr, offsets); + drawJoint(jointAddr, rotations); } ImGui.PopID(); - drawJointLeaf(ref joints, i + 1, offsets); + drawJointLeaf(ref joints, i + 1, rotations); } private void drawJoints(float width) @@ -3263,11 +3263,11 @@ namespace NewCamera ImGui.Separator(); if (ImGui.CollapsingHeader("Body Joints")) { - drawJointLeaf(ref bodyJoints, 0, bodyOffsets); + drawJointLeaf(ref bodyJoints, 0, bodyRotations); } if (ImGui.CollapsingHeader("Face Joints")) { - drawJointLeaf(ref faceJoints, 0, faceOffsets); + drawJointLeaf(ref faceJoints, 0, faceRotations); } ImGui.PopItemWidth(); } @@ -3362,8 +3362,8 @@ namespace NewCamera private void dropJointOffsets() { - bodyOffsets.Clear(); - faceOffsets.Clear(); + bodyRotations.Clear(); + faceRotations.Clear(); #if QUARANTINED_FEATURES ikOffsets.Clear(); #endif @@ -3466,7 +3466,7 @@ namespace NewCamera private bool usingArmorState() { - return (bodyOffsets.Count > 0 || faceOffsets.Count > 0) || (hideKnife || checkKnifeHidden) || (enableFreeCamera && orbitPlayer && orbitJoint >= 0); + return (bodyRotations.Count > 0 || faceRotations.Count > 0) || (hideKnife || checkKnifeHidden) || (enableFreeCamera && orbitPlayer && orbitJoint >= 0); } private void UpdateJointsHook(nint model) @@ -3477,9 +3477,9 @@ namespace NewCamera if (player != null && model == player.Instance) { refreshArmorState(player); - foreach ((nint addr, List offsets) in bodyOffsets) + foreach ((nint addr, List rotations) in bodyRotations) { - MemoryUtil.GetRef(addr + 0x70) *= Quaternion.CreateFromYawPitchRoll(offsets[0].X, offsets[0].Y, offsets[0].Z); + MemoryUtil.GetRef(addr + 0x70) *= Quaternion.CreateFromYawPitchRoll(rotations[0].X, rotations[0].Y, rotations[0].Z); } if (playerArmor[Armor.Waist] != 0x0) { @@ -3490,9 +3490,9 @@ namespace NewCamera else if (player != null && model == playerArmor[Armor.Face]) { refreshArmorState(player); - foreach ((nint addr, List offsets) in faceOffsets) + foreach ((nint addr, List rotations) in faceRotations) { - MemoryUtil.GetRef(addr + 0x70) *= Quaternion.CreateFromYawPitchRoll(offsets[0].X, offsets[0].Y, offsets[0].Z); + MemoryUtil.GetRef(addr + 0x70) *= Quaternion.CreateFromYawPitchRoll(rotations[0].X, rotations[0].Y, rotations[0].Z); } } } @@ -4087,9 +4087,9 @@ namespace NewCamera } ImGui.SetCursorPos(ImGui.GetCursorPos() + new Vector2(0.0f, 6.0f)); #if QUARANTINED_FEATURES - ImGui.Text($"Joint Offsets: {bodyOffsets.Count + faceOffsets.Count}, IK Offsets: {ikOffsets.Count}"); + ImGui.Text($"Joint Rotations: {bodyRotations.Count + faceRotations.Count}, IK Offsets: {ikOffsets.Count}"); #else - ImGui.Text($"Joint Offsets: {bodyOffsets.Count + faceOffsets.Count}"); + ImGui.Text($"Joint Rotations: {bodyRotations.Count + faceRotations.Count}"); #endif ImGui.SameLine(); ImGui.SetCursorPos(ImGui.GetCursorPos() - new Vector2(0.0f, 6.0f)); -- cgit v1.2.3-101-g0448