diff options
Diffstat (limited to 'Plugin.cs')
| -rwxr-xr-x | Plugin.cs | 60 |
1 files changed, 30 insertions, 30 deletions
@@ -520,10 +520,10 @@ namespace NewCamera private Hook<UpdateJoints>? updateJointsHook;
private List<nint> bodyJoints = new List<nint>();
private List<nint> ignoredJoints = new List<nint>();
- private Dictionary<nint, List<Vector3>> bodyOffsets = new Dictionary<nint, List<Vector3>>();
+ private Dictionary<nint, List<Vector3>> bodyRotations = new Dictionary<nint, List<Vector3>>();
private List<nint> faceJoints = new List<nint>();
- private Dictionary<nint, List<Vector3>> faceOffsets = new Dictionary<nint, List<Vector3>>();
+ private Dictionary<nint, List<Vector3>> faceRotations = new Dictionary<nint, List<Vector3>>();
#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<nint, List<Vector3>> offsets)
+ private void drawJoint(nint jointAddr, Dictionary<nint, List<Vector3>> 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<Vector3>()
+ rotations.Add(jointAddr, new List<Vector3>()
{
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<nint> joints, int i, Dictionary<nint, List<Vector3>> offsets)
+ private void drawJointLeaf(ref List<nint> joints, int i, Dictionary<nint, List<Vector3>> 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<Vector3> offsets) in bodyOffsets)
+ foreach ((nint addr, List<Vector3> rotations) in bodyRotations)
{
- MemoryUtil.GetRef<Quaternion>(addr + 0x70) *= Quaternion.CreateFromYawPitchRoll(offsets[0].X, offsets[0].Y, offsets[0].Z);
+ MemoryUtil.GetRef<Quaternion>(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<Vector3> offsets) in faceOffsets)
+ foreach ((nint addr, List<Vector3> rotations) in faceRotations)
{
- MemoryUtil.GetRef<Quaternion>(addr + 0x70) *= Quaternion.CreateFromYawPitchRoll(offsets[0].X, offsets[0].Y, offsets[0].Z);
+ MemoryUtil.GetRef<Quaternion>(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));
|