create main menu

This commit is contained in:
2022-11-12 15:15:01 +05:00
parent b9e9cb72fe
commit a488ab8f99
82 changed files with 7068 additions and 989 deletions
-30
View File
@@ -6,38 +6,8 @@ using UnityEngine;
public class InputHandler : MonoBehaviour, IGameComponent
{
enum Axis
{
x,
y,
z,
w
}
private Transform cameraTransform;
private float X0;
private float P0;
private readonly float F = 1;
private readonly float Q = 6;
private readonly float H = 1;
private readonly float R = 15;
private float Covariance = .1f;
private float[] state = new float[4];
float GetValueAfterFilter(float value, Axis axis)
{
X0 = F * state[(int)axis];
P0 = F * Covariance * F + Q;
var K = H *P0 / (H * P0 * H + R);
state[(int)axis] = X0 + K * (value - H * X0);
Covariance = (1 - K * H) * P0;
return state[(int)axis];
}
void Awake()
{
cameraTransform = transform;