Skip to content

Commit d66afc7

Browse files
committed
Fix apparent z-fighting issue
1 parent 7b98821 commit d66afc7

13 files changed

Lines changed: 6302 additions & 34 deletions

Assets/AdjustClippingPlanes.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using ScriptableObjects;
4+
using UnityEngine;
5+
6+
public class AdjustClippingPlanes : MonoBehaviour
7+
{
8+
[SerializeField] private Camera camera;
9+
[SerializeField] private SessionSettings settings;
10+
// Start is called before the first frame update
11+
public void Start()
12+
{
13+
camera.farClipPlane = settings.stimulusDepth + 1f;
14+
}
15+
}

Assets/AdjustClippingPlanes.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/FollowCamera.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using ScriptableObjects;
2+
using UnityEngine;
3+
4+
public class FollowCamera : MonoBehaviour
5+
{
6+
[SerializeField] private Transform cameraTransform;
7+
8+
// Update is called once per frame
9+
private void FixedUpdate()
10+
{
11+
var o = gameObject;
12+
o.transform.position = cameraTransform.position;
13+
o.transform.rotation = cameraTransform.rotation;
14+
}
15+
}

Assets/FollowCamera.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)