Skip to content

Commit

Permalink
Disable limits when in FPFC
Browse files Browse the repository at this point in the history
  • Loading branch information
kinsi55 committed Sep 26, 2022
1 parent 76d6600 commit 7367186
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
35 changes: 18 additions & 17 deletions Middlewares/Smoothfollow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,31 +149,32 @@ float ClampAngle(float angle, float from, float to) {
targetRotation = currentReplaySource.localHeadRotation;
}

// TODO: This is kinda shit
var l = settings.Smoothfollow.limits;
if(!HookFPFCToggle.isInFPFC) {
// TODO: This is kinda shit
var l = settings.Smoothfollow.limits;

if(!float.IsNegativeInfinity(l.pos_x_min) || !float.IsPositiveInfinity(l.pos_x_max))
targetPosition.x = Mathf.Clamp(targetPosition.x, l.pos_x_min, l.pos_x_max);
if(!float.IsNegativeInfinity(l.pos_x_min) || !float.IsPositiveInfinity(l.pos_x_max))
targetPosition.x = Mathf.Clamp(targetPosition.x, l.pos_x_min, l.pos_x_max);

if(!float.IsNegativeInfinity(l.pos_y_min) || !float.IsPositiveInfinity(l.pos_y_max))
targetPosition.y = Mathf.Clamp(targetPosition.y, l.pos_y_min, l.pos_y_max);
if(!float.IsNegativeInfinity(l.pos_y_min) || !float.IsPositiveInfinity(l.pos_y_max))
targetPosition.y = Mathf.Clamp(targetPosition.y, l.pos_y_min, l.pos_y_max);

if(!float.IsNegativeInfinity(l.pos_z_min) || !float.IsPositiveInfinity(l.pos_z_max))
targetPosition.z = Mathf.Clamp(targetPosition.z, l.pos_z_min, l.pos_z_max);
if(!float.IsNegativeInfinity(l.pos_z_min) || !float.IsPositiveInfinity(l.pos_z_max))
targetPosition.z = Mathf.Clamp(targetPosition.z, l.pos_z_min, l.pos_z_max);

var E = targetRotation.eulerAngles;
var E = targetRotation.eulerAngles;

if(!float.IsNegativeInfinity(l.rot_x_min) || !float.IsPositiveInfinity(l.rot_x_max))
E.x = ClampAngle(E.x, l.rot_x_min, l.rot_x_max);
if(!float.IsNegativeInfinity(l.rot_x_min) || !float.IsPositiveInfinity(l.rot_x_max))
E.x = ClampAngle(E.x, l.rot_x_min, l.rot_x_max);

if(!float.IsNegativeInfinity(l.rot_y_min) || !float.IsPositiveInfinity(l.rot_y_max))
E.y = ClampAngle(E.y, l.rot_y_min, l.rot_y_max);
if(!float.IsNegativeInfinity(l.rot_y_min) || !float.IsPositiveInfinity(l.rot_y_max))
E.y = ClampAngle(E.y, l.rot_y_min, l.rot_y_max);

if(!float.IsNegativeInfinity(l.rot_z_min) || !float.IsPositiveInfinity(l.rot_z_max))
E.z = ClampAngle(E.z, l.rot_z_min, l.rot_z_max);

targetRotation.eulerAngles = E;
if(!float.IsNegativeInfinity(l.rot_z_min) || !float.IsPositiveInfinity(l.rot_z_max))
E.z = ClampAngle(E.z, l.rot_z_min, l.rot_z_max);

targetRotation.eulerAngles = E;
}

if(!teleportOnNextFrame) {
teleportOnNextFrame =
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "Camera2",
"name": "Camera2",
"author": "Kinsi55",
"version": "0.6.97",
"version": "0.6.98",
"description": "If Camera Plus is so good, why is there no Camera Plus 2?",
"gameVersion": "1.20.0",
"dependsOn": {
Expand Down

0 comments on commit 7367186

Please sign in to comment.