Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Assets/Scripts/ControllerAngleChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ private void CheckAngles()
var angle = Quaternion.Angle(CalibrationPositionHolder.Instance.GetRotation(playerSelection),
targetTransform.localRotation);

if (angle > Settings.System.ControllerLimitAngle)
var v = (targetTransform.localRotation * Quaternion.Inverse(CalibrationPositionHolder.Instance.GetRotation(playerSelection))).eulerAngles;
var x = v.x > 180f ? Mathf.Abs(v.x - 360f) : v.x;
var y = v.y > 180f ? Mathf.Abs(v.y - 360f) : v.y;
var z = v.z > 180f ? Mathf.Abs(v.z - 360f) : v.z;

if (x > Settings.System.ControllerLimitXAngle || y > Settings.System.ControllerLimitYAngle)
{
if (!isOutOfRange)
{
Expand Down
3 changes: 2 additions & 1 deletion Assets/Scripts/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public class System
public static SettingFloat AirBlowToWeakenWait = new("空気吹きを弱めるまでの待機時間(秒)", 2f);
public static SettingFloat TrackerLostCheckDuration = new("トラッカーが見失われたとみなすまでの時間(秒)", 1f);
public static SettingBool UsedSpaceCalibrator = new("スペースキャリブレーターを使ってトラッカーのキャリブレーションを実施した【旧トラッカーでは必須】", false);
public static SettingFloat ControllerLimitAngle = new("コントローラーの角度制限", 80f);
public static SettingFloat ControllerLimitXAngle = new("コントローラーのX軸角度制限", 80f);
public static SettingFloat ControllerLimitYAngle = new("コントローラーのY軸角度制限", 80f);
}

public class Calibration
Expand Down