Skip to content

Commit

Permalink
fixed APF Messinger
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitGeslain committed Jun 26, 2024
1 parent f2f5e16 commit 4919238
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,27 @@ public class PhysicalEnvironmentCalibration : MonoBehaviour {
[SerializeField] private Transform user;
[SerializeField] private List<Vector3> bounds;

List<Vector3> obs, obs2;

// Start is called before the first frame update
void Start() {

}

// Update is called once per frame
void Update() {
var obs = bounds.CyclicPairs().SelectMany(
Random.InitState(1);
obs = bounds.CyclicPairs().SelectMany(
p => {
var dir = (p.Item1 - p.Item2).normalized;
var n = (int)(Vector3.Distance(p.Item1, p.Item2) / eps);
return Enumerable.Range(0, n).Select(j => p.Item1 + (j + 0.5f) * eps * dir);

return Enumerable.Range(0, n).Select(j => p.Item2 + (j + 0.5f) * eps * dir);
}
).ToList();

Debug.Log(obs.Count);
obs.ForEach(o => Debug.Log(o));
// Debug.Log(obs.Count);
// obs.ForEach(o => Debug.Log(o));

Debug.DrawRay(user.position, ComputeGradient(user, obs).normalized);
}
Expand Down

0 comments on commit 4919238

Please sign in to comment.